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

@@ -346,6 +346,14 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
}).error(defaultErrorHandler(callback));
};
Client.prototype.backupApp = function (appId, callback) {
var data = { };
post('/api/v1/apps/' + appId + '/backup', data).success(function (data, status) {
if (status !== 202) return callback(new ClientError(status, data));
callback(null);
}).error(defaultErrorHandler(callback));
};
Client.prototype.uninstallApp = function (appId, password, callback) {
var data = { password: password };
post('/api/v1/apps/' + appId + '/uninstall', data).success(function (data, status) {