Add modal to edit backup label and preserveSecs
This commit is contained in:
@@ -368,6 +368,39 @@ angular.module('Application').controller('BackupsController', ['$scope', '$locat
|
||||
download(filename, JSON.stringify(tmp, null, 4));
|
||||
};
|
||||
|
||||
$scope.editBackup = {
|
||||
busy: false,
|
||||
error: null,
|
||||
backup: null,
|
||||
|
||||
label: '',
|
||||
preserveSecs: 0,
|
||||
|
||||
show: function (backup) {
|
||||
$scope.editBackup.backup = backup;
|
||||
$scope.editBackup.label = backup.label;
|
||||
$scope.editBackup.preserveSecs = backup.preserveSecs || 0;
|
||||
$scope.editBackup.error = null;
|
||||
$scope.editBackup.busy = false;
|
||||
|
||||
$('#editBackupModal').modal('show');
|
||||
},
|
||||
|
||||
submit: function () {
|
||||
$scope.editBackup.error = null;
|
||||
$scope.editBackup.busy = true;
|
||||
|
||||
Client.editBackup($scope.editBackup.backup.id, $scope.editBackup.label, $scope.editBackup.preserveSecs, function (error) {
|
||||
$scope.editBackup.busy = false;
|
||||
if (error) return $scope.editBackup.error = error.message;
|
||||
|
||||
fetchBackups();
|
||||
|
||||
$('#editBackupModal').modal('hide');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.backupDetails = {
|
||||
backup: null,
|
||||
|
||||
@@ -824,7 +857,7 @@ angular.module('Application').controller('BackupsController', ['$scope', '$locat
|
||||
document.getElementById('gcsKeyFileInput').onchange = readFileLocally($scope.configureBackup.gcsKey, 'content', 'keyFileName');
|
||||
|
||||
// setup all the dialog focus handling
|
||||
['configureBackupModal'].forEach(function (id) {
|
||||
['configureBackupModal', 'editBackupModal'].forEach(function (id) {
|
||||
$('#' + id).on('shown.bs.modal', function () {
|
||||
$(this).find("[autofocus]:first").focus();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user