Add a restart button in recovery section

This commit is contained in:
Girish Ramakrishnan
2019-12-20 11:18:48 -08:00
parent 3f3ec9ef9a
commit adc078a5cb
5 changed files with 47 additions and 38 deletions

View File

@@ -801,7 +801,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
};
$scope.repair = {
busy: false,
retryBusy: false,
error: {},
location: null,
@@ -816,7 +816,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
// this prepares the repair dialog with whatever is required for repair action
confirm: function () {
$scope.repair.error = {};
$scope.repair.busy = false;
$scope.repair.retryBusy = false;
$scope.repair.location = null;
$scope.repair.domain = null;
$scope.repair.alternateDomains = [];
@@ -856,7 +856,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
submit: function () {
$scope.repair.error = {};
$scope.repair.busy = true;
$scope.repair.retryBusy = true;
var errorState = ($scope.app.error && $scope.app.error.installationState) || ISTATES.PENDING_CONFIGURE;
var data = {};
@@ -892,6 +892,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
case ISTATES.PENDING_START:
case ISTATES.PENDING_STOP:
case ISTATES.PENDING_RESTART:
case ISTATES.PENDING_RESIZE:
case ISTATES.PENDING_DEBUG:
case ISTATES.PENDING_RECREATE_CONTAINER:
@@ -906,7 +907,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
repairFunc(function (error) {
if (error) return Client.error(error);
$scope.repair.busy = false;
$scope.repair.retryBusy = false;
$('#repairModal').modal('hide');
});
},
@@ -918,6 +919,23 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
});
},
restartBusy: false,
restartApp: function () {
$scope.repair.restartBusy = true;
Client.restartApp($scope.app.id, function (error) {
if (error) return console.error(error);
refreshApp($scope.app.id, function () {
waitForAppTask(function (error) {
if (error) return Client.error(error);
$scope.repair.restartBusy = false;
});
});
});
},
pauseBusy: false,
pauseAppBegin: function () {