Fix display of start/stop button
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user