Add update check and apply buttons in app view

This commit is contained in:
Johannes Zellner
2019-09-17 17:14:40 +02:00
parent 752f653f82
commit eb3232e049
2 changed files with 39 additions and 2 deletions

View File

@@ -407,6 +407,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.updates = {
busy: false,
busyCheck: false,
busyUpdate: false,
enableAutomaticUpdate: false,
@@ -437,6 +438,23 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.updates.busyCheck = false;
});
},
askUpdate: function () {
$scope.updates.busyUpdate = false;
$('#updateModal').modal('show');
},
confirmUpdate: function () {
$scope.updates.busyUpdate = true;
Client.updateApp($scope.app.id, $scope.config.update.apps[$scope.app.id].manifest, function (error) {
$scope.updates.busyUpdate = false;
if (error) return Client.error(error);
$('#updateModal').modal('hide');
trackAppTask();
});
}
};