diff --git a/Duplicati/Server/webroot/ngax/scripts/directives/backupEditUri.js b/Duplicati/Server/webroot/ngax/scripts/directives/backupEditUri.js index 4f21b0a26..ff8b8689f 100644 --- a/Duplicati/Server/webroot/ngax/scripts/directives/backupEditUri.js +++ b/Duplicati/Server/webroot/ngax/scripts/directives/backupEditUri.js @@ -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) diff --git a/Duplicati/Server/webroot/ngax/scripts/services/EditUriBackendConfig.js b/Duplicati/Server/webroot/ngax/scripts/services/EditUriBackendConfig.js index 52683e99a..0c31c12b4 100644 --- a/Duplicati/Server/webroot/ngax/scripts/services/EditUriBackendConfig.js +++ b/Duplicati/Server/webroot/ngax/scripts/services/EditUriBackendConfig.js @@ -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) {