diff --git a/src/views/app.html b/src/views/app.html index deccd89a7..aa954a0ae 100644 --- a/src/views/app.html +++ b/src/views/app.html @@ -790,7 +790,7 @@
If a configuration, update, restore or backup action resulted in an error, you can retry the task.
An error occurred during the {{ app.error.installationState | taskName }} operation: {{ app.error.reason + ': ' + app.error.message }}
- + diff --git a/src/views/app.js b/src/views/app.js index 8b9ef89b6..deb55ba6e 100644 --- a/src/views/app.js +++ b/src/views/app.js @@ -114,13 +114,16 @@ angular.module('Application').controller('AppController', ['$scope', '$location' function done(error) { if (error) Client.error(error); - refreshApp($scope.app.id, $scope.display.show); + $scope.displayForm.$setPristine(); + $scope.display.success = true; - $timeout(function () { - $scope.display.busy = false; - $scope.display.success = true; - $scope.displayForm.$setPristine(); - }, 1000); + refreshApp($scope.app.id, function (error) { + if (error) Client.error(error); + + $scope.display.show(); // "refresh" view with latest data + + $timeout(function () { $scope.display.busy = false; }, 1000); + }); } var NOOP = function (next) { return next(); }; @@ -281,10 +284,12 @@ angular.module('Application').controller('AppController', ['$scope', '$location' } if (error) return Client.error(error); - $scope.locationForm.$setPristine(); - $scope.location.busy = false; + refreshApp($scope.app.id, function (error) { + if (error) return Client.error(error); - refreshApp($scope.app.id); + $scope.locationForm.$setPristine(); + $timeout(function () { $scope.location.busy = false; }, 1000); + }); }); }); } @@ -390,9 +395,12 @@ angular.module('Application').controller('AppController', ['$scope', '$location' if (error) return Client.error(error); $scope.resources.currentMemoryLimit = $scope.resources.memoryLimit; - $scope.resources.busy = false; - refreshApp($scope.app.id); + refreshApp($scope.app.id, function (error) { + if (error) return Client.error(error); + + $timeout(function () { $scope.resources.busy = false; }, 1000); + }); }); }, @@ -409,9 +417,12 @@ angular.module('Application').controller('AppController', ['$scope', '$location' if (error) return Client.error(error); $scope.resourcesDataDirForm.$setPristine(); - $scope.resources.busyDataDir = false; - refreshApp($scope.app.id); + refreshApp($scope.app.id, function (error) { + if (error) return Client.error(error); + + $timeout(function () { $scope.resources.busyDataDir = false; }, 1000); + }); }); } }; @@ -447,13 +458,15 @@ angular.module('Application').controller('AppController', ['$scope', '$location' $scope.emailForm.$setPristine(); - $scope.email.busy = false; refreshApp($scope.app.id, function (error) { - if (error) return; + if (error) return Client.error(error); + // when the mailboxName is 'reset', this will fill it up with the default again $scope.email.mailboxName = $scope.app.mailboxName || ''; $scope.email.mailboxDomain = $scope.domains.filter(function (d) { return d.domain === $scope.app.mailboxDomain; })[0]; + + $timeout(function () { $scope.email.busy = false; }, 1000); }); }); } @@ -663,11 +676,11 @@ angular.module('Application').controller('AppController', ['$scope', '$location' func($scope.app.id, function (error) { if (error) return Client.error(error); - $timeout(function () { - $scope.console.busyRunState = false; - }, 1000); + refreshApp($scope.app.id, function (error) { + if (error) return Client.error(error); - refreshApp($scope.app.id); + $timeout(function () { $scope.console.busyRunState = false; }, 1000); + }); }); } }; @@ -923,12 +936,10 @@ angular.module('Application').controller('AppController', ['$scope', '$location' 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); + refreshApp($scope.app.id, function (error) { + if (error) return Client.error(error); - $scope.repair.restartBusy = false; - }); + $timeout(function () { $scope.repair.restartBusy = false; }, 1000); }); }); }, @@ -941,12 +952,10 @@ angular.module('Application').controller('AppController', ['$scope', '$location' Client.debugApp($scope.app.id, true, function (error) { if (error) return console.error(error); - refreshApp($scope.app.id, function () { - waitForAppTask(function (error) { - if (error) return Client.error(error); + refreshApp($scope.app.id, function (error) { + if (error) return Client.error(error); - $scope.repair.pauseBusy = false; - }); + $timeout(function () { $scope.repair.pauseBusy = false; }, 1000); }); }); }, @@ -957,12 +966,10 @@ angular.module('Application').controller('AppController', ['$scope', '$location' Client.debugApp($scope.app.id, false, function (error) { if (error) return console.error(error); - refreshApp($scope.app.id, function () { - waitForAppTask(function (error) { - if (error) return Client.error(error); + refreshApp($scope.app.id, function (error) { + if (error) return Client.error(error); - $scope.repair.pauseBusy = false; - }); + $timeout(function () { $scope.repair.pauseBusy = false; }, 1000); }); }); }