Add checkbox to skip backup for app update

This commit is contained in:
Girish Ramakrishnan
2019-09-26 20:10:25 -07:00
parent a905e32cde
commit ee05e109c8
3 changed files with 9 additions and 3 deletions
+3 -2
View File
@@ -479,9 +479,10 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
});
};
Client.prototype.updateApp = function (id, manifest, callback) {
Client.prototype.updateApp = function (id, manifest, options, callback) {
var data = {
appStoreId: manifest.id + '@' + manifest.version
appStoreId: manifest.id + '@' + manifest.version,
skipBackup: !!options.skipBackup
};
post('/api/v1/apps/' + id + '/update', data, null, function (error, data, status) {
+4
View File
@@ -180,6 +180,10 @@
<div ng-bind-html="config.update.apps[app.id].manifest.changelog | markdown2html"></div>
</div>
<div class="modal-footer">
<label class="checkbox-inline pull-left">
<input type="checkbox" ng-model="updates.skipBackup"><b>Skip backup</b>
</label>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-success" ng-click="updates.confirmUpdate()" ng-disabled="updates.busyUpdate"><i class="fa fa-circle-notch fa-spin" ng-show="updates.busyUpdate"></i> Update</button>
</div>
+2 -1
View File
@@ -497,6 +497,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
busy: false,
busyCheck: false,
busyUpdate: false,
skipBackup: false,
enableAutomaticUpdate: false,
@@ -537,7 +538,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
confirmUpdate: function () {
$scope.updates.busyUpdate = true;
Client.updateApp($scope.app.id, $scope.config.update.apps[$scope.app.id].manifest, function (error) {
Client.updateApp($scope.app.id, $scope.config.update.apps[$scope.app.id].manifest, { skipBackup: $scope.updates.skipBackup }, function (error) {
$scope.updates.busyUpdate = false;
if (error) return Client.error(error);