diff --git a/dashboard/public/translation/en.json b/dashboard/public/translation/en.json index 8e8691fa0..e488f1c57 100644 --- a/dashboard/public/translation/en.json +++ b/dashboard/public/translation/en.json @@ -652,6 +652,13 @@ }, "archive": { "description": "Deleted archives are cleaned up based on the backup policy." + }, + "deleteArchiveDialog": { + "title": "Delete Archive of {{appTitle}} ({{fqdn}})", + "description": "After deletion, the archive will be cleaned up based on the backup policy." + }, + "deleteArchive": { + "deleteAction": "Delete" } }, "branding": { diff --git a/dashboard/public/views/backups.html b/dashboard/public/views/backups.html index be49a9ca5..1422aacb4 100644 --- a/dashboard/public/views/backups.html +++ b/dashboard/public/views/backups.html @@ -541,6 +541,24 @@ + + +

{{ 'backups.title' | tr }}

@@ -776,7 +794,7 @@ - + diff --git a/dashboard/public/views/backups.js b/dashboard/public/views/backups.js index 6821ad066..e9a4988a9 100644 --- a/dashboard/public/views/backups.js +++ b/dashboard/public/views/backups.js @@ -284,13 +284,31 @@ angular.module('Application').controller('BackupsController', ['$scope', '$locat }); }); }, + }; - delete: function (archive) { - Client.deleteArchive(archive.id, function (error) { - if (error) Client.error(error); - $scope.listArchives.fetch(); - }); + $scope.archiveDelete = { + busy: false, + error: {}, + archive: null, + + ask: function (archive) { + $scope.archiveDelete.busy = false; + $scope.archiveDelete.error = {}; + $scope.archiveDelete.archive = archive; + $('#archiveDeleteModal').modal('show'); }, + + submit: function () { + $scope.archiveDelete.busy = true; + $scope.archiveDelete.error = {}; + + Client.deleteArchive($scope.archiveDelete.archive.id, function (error) { + $scope.archiveDelete.busy = false; + if (error) return console.error('Unable to delete archive.', error.statusCode, error.message); + $scope.listArchives.fetch(); + $('#archiveDeleteModal').modal('hide'); + }); + } }; // keep in sync with app.js