Ensure we can start a stopped app

This commit is contained in:
Johannes Zellner
2019-09-22 12:21:39 +02:00
parent c8ea649afc
commit b742dc51fb

View File

@@ -4,6 +4,8 @@
/* global $ */
/* global asyncSeries */
/* global asyncForEach */
/* global RSTATES */
/* global ISTATES */
// TODO use this once we enable custom SSL certificate ui again
@@ -669,11 +671,13 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
restartApp: function () {
$scope.debug.appIsRestarting = true;
Client.restartApp($scope.app.id, function (error) {
function done(error) {
if (error) Client.error(error);
$scope.debug.appIsRestarting = false;
});
}
if ($scope.app.runState === RSTATES.STOPPED) Client.startApp($scope.app.id, done);
else Client.restartApp($scope.app.id, done);
}
};
@@ -722,7 +726,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
backupId: $scope.clone.backup.id
};
Client.cloneApp($scope.app.id, data, function (error, clonedApp) {
Client.cloneApp($scope.app.id, data, function (error/*, clonedApp */) {
$scope.clone.busy = false;
if (error) {
@@ -892,8 +896,6 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.app = app;
console.log(app.installationState, app.error);
$scope.setView($routeParams.view || 'display');
// track on page load backup if active