Move app start/stop to uninstall
This commit is contained in:
@@ -1093,6 +1093,23 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
$scope.uninstall = {
|
||||
busy: false,
|
||||
error: {},
|
||||
busyRunState: false,
|
||||
startButton: false,
|
||||
|
||||
toggleRunState: function () {
|
||||
var func = $scope.app.runState === RSTATES.STOPPED ? Client.startApp : Client.stopApp;
|
||||
$scope.uninstall.busyRunState = true;
|
||||
|
||||
func($scope.app.id, function (error) {
|
||||
if (error) return Client.error(error);
|
||||
|
||||
refreshApp($scope.app.id, function (error) {
|
||||
if (error) return Client.error(error);
|
||||
|
||||
$timeout(function () { $scope.uninstall.busyRunState = false; }, 1000);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
show: function () {
|
||||
$scope.uninstall.error = {};
|
||||
@@ -1126,24 +1143,7 @@ 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) {
|
||||
if (error) return Client.error(error);
|
||||
|
||||
refreshApp($scope.app.id, function (error) {
|
||||
if (error) return Client.error(error);
|
||||
|
||||
$timeout(function () { $scope.console.busyRunState = false; }, 1000);
|
||||
});
|
||||
});
|
||||
}
|
||||
show: function () {}
|
||||
};
|
||||
|
||||
$scope.restore = {
|
||||
@@ -1518,9 +1518,9 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
|
||||
// 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;
|
||||
$scope.uninstall.startButton = app.installationState === ISTATES.PENDING_START;
|
||||
} else {
|
||||
$scope.console.startButton = app.runState === RSTATES.STOPPED;
|
||||
$scope.uninstall.startButton = app.runState === RSTATES.STOPPED;
|
||||
}
|
||||
|
||||
callback();
|
||||
|
||||
Reference in New Issue
Block a user