Attempt to cover most repair cases
This commit is contained in:
@@ -761,23 +761,59 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
|
||||
backupId: '',
|
||||
|
||||
// this prepares the repair dialog with whatever is required for repair action
|
||||
show: function () {
|
||||
$scope.repair.error = {};
|
||||
$scope.repair.busy = false;
|
||||
$scope.repair.optionalDomains = [];
|
||||
$scope.repair.backupId = '';
|
||||
|
||||
$scope.repair.optionalDomains = $scope.app.alternateDomains;
|
||||
$scope.repair.optionalDomains.forEach(function (d) {
|
||||
d.enabled = true;
|
||||
});
|
||||
var app = $scope.app;
|
||||
|
||||
Client.getAppBackups($scope.app.id, function (error, backups) {
|
||||
if (error) return Client.error(error);
|
||||
console.log(app)
|
||||
|
||||
$scope.repair.backups = backups;
|
||||
$scope.repair.backupId = '';
|
||||
// old versions may not have this set
|
||||
if (!app.error.task) {
|
||||
$('#repairModal').modal('show');
|
||||
} else if (app.error.task.installationState === ISTATES.PENDING_UPDATE) {
|
||||
$('#repairModal').modal('show');
|
||||
} else if (app.error.task.installationState === ISTATES.PENDING_DATA_DIR_MIGRATION) {
|
||||
$('#repairModal').modal('show');
|
||||
} else if (app.error.task.installationState === ISTATES.PENDING_UNINSTALL) {
|
||||
$('#repairModal').modal('show');
|
||||
} else if (app.error.task.installationState === ISTATES.PENDING_DEBUG) {
|
||||
$('#repairModal').modal('show');
|
||||
} else if (app.error.task.installationState === ISTATES.PENDING_RESIZE) {
|
||||
// memory
|
||||
$('#repairModal').modal('show');
|
||||
} else if (app.error.task.installationState === ISTATES.ISTATE_PENDING_RECREATE_CONTAINER) {
|
||||
// email, mailbox
|
||||
$('#repairModal').modal('show');
|
||||
} else if (app.error.task.installationState === ISTATES.PENDING_LOCATION_CHANGE || app.error.task.installationState === ISTATES.PENDING_INSTALL) {
|
||||
$scope.repair.optionalDomains = $scope.app.alternateDomains;
|
||||
$scope.repair.optionalDomains.forEach(function (d) {
|
||||
d.enabled = true;
|
||||
});
|
||||
|
||||
$('#repairModal').modal('show');
|
||||
});
|
||||
} else if (app.error.task.installationState === ISTATES.PENDING_RESTORE || app.error.task.installationState === ISTATES.PENDING_CLONE) {
|
||||
$scope.repair.optionalDomains = $scope.app.alternateDomains;
|
||||
$scope.repair.optionalDomains.forEach(function (d) {
|
||||
d.enabled = true;
|
||||
});
|
||||
|
||||
Client.getAppBackups($scope.app.id, function (error, backups) {
|
||||
if (error) return Client.error(error);
|
||||
|
||||
$scope.repair.backups = backups;
|
||||
$scope.repair.backupId = '';
|
||||
|
||||
$('#repairModal').modal('show');
|
||||
});
|
||||
} else {
|
||||
// unhandled case last resort to simply call repair
|
||||
$('#repairModal').modal('show');
|
||||
}
|
||||
},
|
||||
|
||||
submit: function () {
|
||||
|
||||
Reference in New Issue
Block a user