Allow setting retentionSecs in backendConfig

Part of #310
This commit is contained in:
Girish Ramakrishnan
2017-04-22 21:46:53 -07:00
parent abe72442ae
commit 29ae2cf8ca
4 changed files with 22 additions and 5 deletions

View File

@@ -191,6 +191,11 @@
<input type="text" class="form-control" ng-model="configureBackup.secretAccessKey" id="inputConfigureBackupSecretAccessKey" name="secretAccessKey" ng-disabled="configureBackup.busy" ng-required="s3like(configureBackup.provider)">
</div>
<div class="form-group">
<label class="control-label" for="storageRetention">Retention Time</label>
<select class="form-control" id="storageRetention" ng-model="configureBackup.retentionSecs" ng-options="a.value as a.name for a in retentionTimes"></select>
</div>
<div class="form-group" ng-class="{ 'has-error': configureBackup.error.key }">
<label class="control-label" for="inputConfigureBackupKey">Encryption key (optional)</label>
<input type="text" class="form-control" ng-model="configureBackup.key" id="inputConfigureBackupKey" name="prefix" ng-disabled="configureBackup.busy" placeholder="Passphrase used to encrypt the backups">

View File

@@ -56,6 +56,13 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
{ name: 'Minio', value: 'minio' }
];
$scope.retentionTimes = [
{ name: '2 days', value: 2 * 24 * 60 * 60 },
{ name: '1 week', value: 7 * 24 * 60 * 60},
{ name: '1 month', value: 30 * 24 * 60 * 60},
{ name: 'Forever', value: -1 }
];
$scope.planChange = {
busy: false,
error: {},
@@ -350,6 +357,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
region: '',
endpoint: '',
backupFolder: '',
retentionSecs: -1,
clearForm: function () {
$scope.configureBackup.bucket = '';
@@ -359,6 +367,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
$scope.configureBackup.endpoint = '';
$scope.configureBackup.region = '';
$scope.configureBackup.backupFolder = '';
$scope.configureBackup.retentionSecs = -1;
},
show: function () {
@@ -374,6 +383,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
$scope.configureBackup.endpoint = $scope.backupConfig.endpoint;
$scope.configureBackup.key = $scope.backupConfig.key;
$scope.configureBackup.backupFolder = $scope.backupConfig.backupFolder;
$scope.configureBackup.retentionSecs = $scope.backupConfig.retentionSecs;
$('#configureBackupModal').modal('show');
},