diff options
author | Karen Martikyan <karen.martikyan@digitain.com> | 2020-09-30 22:54:53 +0300 |
---|---|---|
committer | Karen Martikyan <karen.martikyan@digitain.com> | 2020-09-30 22:54:53 +0300 |
commit | b637df08f320bf5ae2700983122c5bef4e91d31c (patch) | |
tree | e41d50b834c219a92643d86e38867ef649cc046d /Duplicati/Server | |
parent | 3aa96accaa29dbac1e833952baabd2be7b00401b (diff) |
Implemented custom UI
Diffstat (limited to 'Duplicati/Server')
-rw-r--r-- | Duplicati/Server/webroot/ngax/scripts/services/EditUriBuiltins.js | 21 | ||||
-rw-r--r-- | Duplicati/Server/webroot/ngax/templates/backends/telegram.html | 24 |
2 files changed, 45 insertions, 0 deletions
diff --git a/Duplicati/Server/webroot/ngax/scripts/services/EditUriBuiltins.js b/Duplicati/Server/webroot/ngax/scripts/services/EditUriBuiltins.js index 5fc999fc0..7064fe76e 100644 --- a/Duplicati/Server/webroot/ngax/scripts/services/EditUriBuiltins.js +++ b/Duplicati/Server/webroot/ngax/scripts/services/EditUriBuiltins.js @@ -30,6 +30,7 @@ backupApp.service('EditUriBuiltins', function (AppService, AppUtils, SystemInfo, EditUriBackendConfig.templates['dropbox'] = 'templates/backends/oauth.html'; EditUriBackendConfig.templates['sia'] = 'templates/backends/sia.html'; EditUriBackendConfig.templates['tardigrade'] = 'templates/backends/tardigrade.html'; + EditUriBackendConfig.templates['telegram'] = 'templates/backends/telegram.html'; EditUriBackendConfig.templates['rclone'] = 'templates/backends/rclone.html'; EditUriBackendConfig.templates['cos'] = 'templates/backends/cos.html'; @@ -760,6 +761,26 @@ backupApp.service('EditUriBuiltins', function (AppService, AppUtils, SystemInfo, return url; }; + EditUriBackendConfig.builders['telegram'] = function (scope) { + 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, + }; + + EditUriBackendConfig.merge_in_advanced_options(scope, opts); + + var url = AppUtils.format('{0}://t.me/{1}', + scope.Backend.Key, + AppUtils.encodeDictAsUrl(opts) + ); + + return url; + }; + EditUriBackendConfig.builders['rclone'] = function (scope) { var opts = { diff --git a/Duplicati/Server/webroot/ngax/templates/backends/telegram.html b/Duplicati/Server/webroot/ngax/templates/backends/telegram.html new file mode 100644 index 000000000..f1987789d --- /dev/null +++ b/Duplicati/Server/webroot/ngax/templates/backends/telegram.html @@ -0,0 +1,24 @@ +<div class="input text"> + <label for="api_hash" translate>API Hash</label> + <input type="text" name="api_hash" id="api_hash" ng-model="$parent.api_hash" placeholder="{{' 0123456789abcdef... '}}" /> +</div> +<div class="input text"> + <label for="api_id" translate>API ID</label> + <input type="text" name="api_id" id="api_id" ng-model="$parent.api_id" placeholder="{{' 1234567 '}}" /> +</div> +<div class="input text"> + <label for="auth_code" translate>Authentication code</label> + <input type="text" name="auth_code" id="auth_code" ng-model="$parent.auth_code" placeholder="{{' 12345 '}}" /> +</div> +<div class="input text"> + <label for="channel_name" translate>The channel name</label> + <input type="text" name="channel_name" id="channel_name" ng-model="$parent.channel_name" placeholder="{{' My Backup '}}" /> +</div> +<div class="input text"> + <label for="phone_number" translate>The phone number</label> + <input type="text" name="phone_number" id="phone_number" ng-model="$parent.phone_number" placeholder="{{' +12223334455 '}}" /> +</div> +<div class="input password"> + <label for="auth_password" translate>The 2FA password</label> + <input type="password" name="auth_password" id="auth_password" ng-model="$parent.auth_password" /> +</div>
\ No newline at end of file |