Added common method to merge path and server for backends

This commit is contained in:
Kenneth Skovhede
2015-09-23 10:47:01 +02:00
parent 0a602264ee
commit 9c2ddfe746
@@ -1,5 +1,16 @@
backupApp.service('EditUriBuiltins', function(AppService, AppUtils, SystemInfo, EditUriBackendConfig, $http) {
EditUriBackendConfig.mergeServerAndPath = function(scope) {
if ((scope.Server || '') != '') {
var p = scope.Path;
scope.Path = scope.Server;
if ((p || '') != '')
scope.Path += '/' + p;
delete scope.Server;
}
};
// All backends with a custom UI must register here
EditUriBackendConfig.templates['file'] = 'templates/backends/file.html';
EditUriBackendConfig.templates['s3'] = 'templates/backends/s3.html';
@@ -135,14 +146,7 @@ backupApp.service('EditUriBuiltins', function(AppService, AppUtils, SystemInfo,
delete options['--authid'];
if ((scope.Server || '') != '') {
var p = scope.Path;
scope.Path = scope.Server;
if ((p || '') != '')
scope.Path += '/' + p;
delete scope.Server;
}
EditUriBackendConfig.mergeServerAndPath(scope);
};
EditUriBackendConfig.parsers['googledrive'] = function() { return this['oauth-base'].apply(this, arguments); },