Set busy indicator to false in refresh callbacks
This commit is contained in:
+1
-1
@@ -790,7 +790,7 @@
|
||||
<label class="control-label">Task Error</label>
|
||||
<p>If a configuration, update, restore or backup action resulted in an error, you can retry the task.</p>
|
||||
<p ng-show="app.error">An error occurred during the <b>{{ app.error.installationState | taskName }}</b> operation: <span class="text-danger"><b>{{ app.error.reason + ': ' + app.error.message }}</b></span></p>
|
||||
<button class="btn btn-primary pull-right" ng-click="repair.confirm()" ng-disabled="app.taskId">Retry {{ app.error.installationState | taskName }}</button>
|
||||
<button class="btn btn-primary pull-right" ng-click="repair.confirm()" ng-disabled="app.taskId || !app.error">Retry {{ app.error.installationState | taskName }}</button>
|
||||
|
||||
<!-- this is hidden for now, use the CLI instead -->
|
||||
<button class="btn btn-danger pull-right" ng-click="repair.stopAppTask(app.taskId)" ng-show="false && app.taskId">Cancel Current Task</button>
|
||||
|
||||
+41
-34
@@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user