backup ui: clear form if selector changes

This commit is contained in:
Girish Ramakrishnan
2017-04-22 14:14:21 -07:00
parent 6f0c271e6e
commit 00ac78c839
2 changed files with 12 additions and 2 deletions

View File

@@ -151,7 +151,7 @@
<div class="form-group">
<label class="control-label" for="storageProviderProvider">Storage provider <sup><a ng-href="{{ config.webServerOrigin }}/references/selfhosting.html#backups" class="help" target="_blank"><i class="fa fa-question-circle"></i></a></sup></label>
<select class="form-control" id="storageProviderProvider" ng-model="configureBackup.provider" ng-options="a.value as a.name for a in storageProvider"></select>
<select class="form-control" id="storageProviderProvider" ng-model="configureBackup.provider" ng-options="a.value as a.name for a in storageProvider" ng-change=configureBackup.clearForm()></select>
</div>
<!-- Filesystem -->

View File

@@ -349,7 +349,17 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
secretAccessKey: '',
region: '',
endpoint: '',
backupFoler: '',
backupFolder: '',
clearForm: function () {
$scope.configureBackup.bucket = '';
$scope.configureBackup.prefix = '';
$scope.configureBackup.accessKeyId = '';
$scope.configureBackup.secretAccessKey = '';
$scope.configureBackup.endpoint = '';
$scope.configureBackup.region = '';
$scope.configureBackup.backupFolder = '';
},
show: function () {
$scope.configureBackup.error = {};