rework the repair view

This commit is contained in:
Girish Ramakrishnan
2019-12-16 18:18:22 -08:00
parent d175d06b35
commit f0730f595f
4 changed files with 50 additions and 73 deletions

View File

@@ -152,50 +152,6 @@ app.controller('TerminalController', ['$scope', '$timeout', '$location', 'Client
});
};
$scope.pauseApp = function () {
$('#pauseAppModal').modal('show');
};
$scope.pauseAppBegin = function () {
$scope.appBusy = true;
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(waitUntilInPauseState, 2000);
});
}
Client.debugApp($scope.selected.value, true, function (error) {
if (error) return console.error(error);
$('#pauseAppModal').modal('hide');
waitUntilInPauseState();
});
};
$scope.pauseAppDone = function () {
$scope.appBusy = true;
function waitUntilInNormalState() {
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(waitUntilInNormalState, 2000);
});
}
Client.debugApp($scope.selected.value, false, function (error) {
if (error) return console.error(error);
waitUntilInNormalState();
});
};
function createTerminalSocket() {
try {
// websocket cannot use relative urls