Make stop/start work again
This commit is contained in:
@@ -667,7 +667,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
|
||||
$scope.debug = {
|
||||
show: function () {},
|
||||
appIsRestarting: false,
|
||||
busyRunState: false,
|
||||
|
||||
stopAppTask: function (taskId) {
|
||||
Client.stopTask(taskId, function (error) {
|
||||
@@ -676,16 +676,16 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
});
|
||||
},
|
||||
|
||||
restartApp: function () {
|
||||
$scope.debug.appIsRestarting = true;
|
||||
toggleRunState: function () {
|
||||
var func = $scope.app.runState === RSTATES.STOPPED ? Client.startApp : Client.stopApp;
|
||||
$scope.debug.busyRunState = true;
|
||||
|
||||
function done(error) {
|
||||
if (error) Client.error(error);
|
||||
$scope.debug.appIsRestarting = false;
|
||||
}
|
||||
func($scope.app.id, function (error) {
|
||||
$scope.debug.busyRunState = false;
|
||||
if (error) return Client.error(error);
|
||||
|
||||
if ($scope.app.runState === RSTATES.STOPPED) Client.startApp($scope.app.id, done);
|
||||
else Client.restartApp($scope.app.id, done);
|
||||
refreshApp();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user