app: add console section

This commit is contained in:
Girish Ramakrishnan
2019-12-16 13:30:51 -08:00
parent bcb6182be3
commit 580556cab6
2 changed files with 25 additions and 33 deletions
+14 -12
View File
@@ -661,23 +661,16 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
}
};
$scope.debug = {
$scope.console = {
show: function () {},
busyRunState: false,
stopAppTask: function (taskId) {
Client.stopTask(taskId, function (error) {
// we can ignore a call trying to cancel an already done task
if (error && error.statusCode !== 409) Client.error(error);
});
},
toggleRunState: function () {
var func = $scope.app.runState === RSTATES.STOPPED ? Client.startApp : Client.stopApp;
$scope.debug.busyRunState = true;
$scope.console.busyRunState = true;
func($scope.app.id, function (error) {
$scope.debug.busyRunState = false;
$scope.console.busyRunState = false;
if (error) return Client.error(error);
refreshApp();
@@ -821,8 +814,10 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
backupId: '',
show: function () {},
// this prepares the repair dialog with whatever is required for repair action
show: function () {
confirm: function () {
$scope.repair.error = {};
$scope.repair.busy = false;
$scope.repair.location = null;
@@ -917,7 +912,14 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.repair.busy = false;
$('#repairModal').modal('hide');
});
}
},
stopAppTask: function (taskId) {
Client.stopTask(taskId, function (error) {
// we can ignore a call trying to cancel an already done task
if (error && error.statusCode !== 409) Client.error(error);
});
},
};
$scope.postInstallConfirm = {