diff options
author | Karen Martikyan <karen.martikyan@digitain.com> | 2020-11-07 17:03:58 +0300 |
---|---|---|
committer | Karen Martikyan <karen.martikyan@digitain.com> | 2020-11-07 17:03:58 +0300 |
commit | 035e34f1de71adebf0b64024fa94990fbc0774ce (patch) | |
tree | 025d235085a642d7b97e4b228e3db40c3f696371 /Duplicati/Server | |
parent | 9017878a3cc2ddcde6b14fc3646b9c8adf5e0208 (diff) |
Improvements made, bugfixes made
Diffstat (limited to 'Duplicati/Server')
-rw-r--r-- | Duplicati/Server/webroot/ngax/scripts/services/EditUriBuiltins.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Duplicati/Server/webroot/ngax/scripts/services/EditUriBuiltins.js b/Duplicati/Server/webroot/ngax/scripts/services/EditUriBuiltins.js index 7064fe76e..ff2309829 100644 --- a/Duplicati/Server/webroot/ngax/scripts/services/EditUriBuiltins.js +++ b/Duplicati/Server/webroot/ngax/scripts/services/EditUriBuiltins.js @@ -504,6 +504,24 @@ backupApp.service('EditUriBuiltins', function (AppService, AppUtils, SystemInfo, delete options[nukeopts[x]]; }; + EditUriBackendConfig.parsers['telegram'] = function (scope, module, server, port, path, options) { + if (options['--api-id']) + scope.api_id = options['--api-id']; + if (options['--api-hash']) + scope.api_hash = options['--api-hash']; + if (options['--auth-code']) + scope.auth_code = options['--auth-code']; + if (options['--channel-name']) + scope.channel_name = options['--channel-name']; + if (options['--phone-number']) + scope.phone_number = options['--phone-number']; + if (options['--auth_password']) + scope.auth_password = options['--auth_password']; + + var nukeopts = ['--api-id','--api-hash', '--auth-code', '--channel-name', '--phone-number', '--auth_password']; + for (var x in nukeopts) + delete options[nukeopts[x]]; + }; EditUriBackendConfig.parsers['cos'] = function (scope, module, server, port, path, options) { if (options['--cos-app-id']) @@ -1131,6 +1149,26 @@ backupApp.service('EditUriBuiltins', function (AppService, AppUtils, SystemInfo, continuation(); }; + EditUriBackendConfig.validaters['telegram'] = function (scope, continuation) { + var opts = { + 'api-id': scope.api_id, + 'api-hash': scope.api_hash, + 'auth-code': scope.auth_code, + 'channel-name': scope.channel_name, + 'phone-number': scope.phone_number, + 'auth-password': scope.auth_password, + }; + + var res = + EditUriBackendConfig.require_field(scope, 'api_id', gettextCatalog.getString('api_id')) && + EditUriBackendConfig.require_field(scope, 'api_hash', gettextCatalog.getString('api_hash')) && + EditUriBackendConfig.require_field(scope, 'channel_name', gettextCatalog.getString('channel_name')) && + EditUriBackendConfig.require_field(scope, 'phone_number', gettextCatalog.getString('phone_number')); + + if (res) + continuation(); + }; + EditUriBackendConfig.validaters['rclone'] = function (scope, continuation) { var res = EditUriBackendConfig.require_field(scope, 'Server', gettextCatalog.getString('Remote Repository')) && |