diff --git a/src/views/app.html b/src/views/app.html index 0b418e176..57957b549 100644 --- a/src/views/app.html +++ b/src/views/app.html @@ -745,8 +745,10 @@

Apps can be stopped to conserve server resources. They will continue to be backed up but won't be updated.

-
diff --git a/src/views/app.js b/src/views/app.js index 120ce9302..394fb024d 100644 --- a/src/views/app.js +++ b/src/views/app.js @@ -657,15 +657,19 @@ angular.module('Application').controller('AppController', ['$scope', '$location' $scope.console = { show: function () {}, busyRunState: false, + startButton: false, toggleRunState: function () { var func = $scope.app.runState === RSTATES.STOPPED ? Client.startApp : Client.stopApp; $scope.console.busyRunState = true; func($scope.app.id, function (error) { - $scope.console.busyRunState = false; if (error) return Client.error(error); + $timeout(function () { + $scope.console.busyRunState = false; + }, 1000); + refreshApp($scope.app.id); }); } @@ -996,6 +1000,13 @@ angular.module('Application').controller('AppController', ['$scope', '$location' $scope.app = app; + // show 'Start App' if app is starting or is stopped + if (app.installationState === ISTATES.PENDING_START || app.installationState === ISTATES.PENDING_STOP) { + $scope.console.startButton = app.installationState === ISTATES.PENDING_START; + } else { + $scope.console.startButton = app.runState === RSTATES.STOPPED; + } + if (app.taskId) { Client.getTask(app.taskId, function (error, task) { if (error) return callback(error);