add app backup button

Fixes cloudron/box#497
This commit is contained in:
Girish Ramakrishnan
2018-05-23 20:36:54 -07:00
parent 63e16c9bb8
commit 44d32ea281
4 changed files with 74 additions and 32 deletions

View File

@@ -184,6 +184,18 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
$scope.appRestore.selectedBackup = backup;
},
createBackup: function () {
Client.backupApp($scope.appRestore.app.id, function (error) {
if (error) {
Client.error(error);
} else {
$('#appRestoreModal').modal('hide');
}
Client.refreshInstalledApps(); // reflect the new app state immediately
});
},
show: function (app) {
$scope.reset();
@@ -205,7 +217,7 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
return false; // prevent propagation and default
},
submit: function () {
restore: function () {
$scope.appRestore.busy = true;
$scope.appRestore.error.password = null;