Added option to allow backends to perform extra operations after the normal "test" operation has been performed.
Operations on the "test" function are not done with normal validation, and can thus have extended checks.
This commit is contained in:
@@ -41,7 +41,14 @@ backupApp.directive('backupEditUri', function() {
|
||||
AppService.post('/remoteoperation/test', uri).then(function() {
|
||||
scope.Testing = false;
|
||||
dlg.dismiss();
|
||||
DialogService.dialog('Success', 'Connection worked!');
|
||||
|
||||
if (EditUriBackendConfig.testers[scope.Backend.Key] != null)
|
||||
EditUriBackendConfig.testers[scope.Backend.Key](scope, function() {
|
||||
DialogService.dialog('Success', 'Connection worked!');
|
||||
});
|
||||
else
|
||||
DialogService.dialog('Success', 'Connection worked!');
|
||||
|
||||
}, handleError);
|
||||
});
|
||||
|
||||
@@ -108,8 +115,10 @@ backupApp.directive('backupEditUri', function() {
|
||||
if (!hasTriedCreate && message == 'missing-folder')
|
||||
{
|
||||
var folder = scope.Folder;
|
||||
if ((folder | "") == "")
|
||||
if ((folder || "") == "")
|
||||
folder = scope.Path;
|
||||
if ((folder || "") == "")
|
||||
folder = '';
|
||||
|
||||
DialogService.dialog('Create folder?', 'The folder ' + folder + ' does not exist\nCreate it now?', ['No', 'Yes'], function(ix) {
|
||||
if (ix == 1)
|
||||
|
||||
@@ -17,6 +17,9 @@ backupApp.service('EditUriBackendConfig', function(AppService, AppUtils, SystemI
|
||||
// Validaters check the input and show the user an error or warning
|
||||
this.validaters = { };
|
||||
|
||||
// Testers perform additional checks when pressing the Test button
|
||||
this.testers = { };
|
||||
|
||||
this.defaultbackend = 'file';
|
||||
this.defaulttemplate = 'templates/backends/generic.html';
|
||||
this.defaultbuilder = function(scope) {
|
||||
|
||||
Reference in New Issue
Block a user