terminal: repair -> pause

This commit is contained in:
Girish Ramakrishnan
2019-09-26 22:06:56 -07:00
parent 4d4c8638ca
commit 24888dfad5
2 changed files with 17 additions and 17 deletions

View File

@@ -146,32 +146,32 @@ app.controller('TerminalController', ['$scope', '$timeout', '$location', 'Client
});
};
$scope.repairApp = function () {
$('#repairAppModal').modal('show');
$scope.pauseApp = function () {
$('#pauseAppModal').modal('show');
};
$scope.repairAppBegin = function () {
$scope.pauseAppBegin = function () {
$scope.appBusy = true;
function waitUntilInRepairState() {
function waitUntilInPauseState() {
refreshApp($scope.selected.value, function (error, result) {
if (error) return console.error('Failed to get app status.', error);
if (result.installationState === 'installed') $scope.appBusy = false;
else setTimeout(waitUntilInRepairState, 2000);
else setTimeout(waitUntilInPauseState, 2000);
});
}
Client.debugApp($scope.selected.value, true, function (error) {
if (error) return console.error(error);
$('#repairAppModal').modal('hide');
$('#pauseAppModal').modal('hide');
waitUntilInRepairState();
waitUntilInPauseState();
});
};
$scope.repairAppDone = function () {
$scope.pauseAppDone = function () {
$scope.appBusy = true;
function waitUntilInNormalState() {