add initial repair dialog with domain/backup selection

This commit is contained in:
Johannes Zellner
2019-09-21 22:45:26 +02:00
parent 36c23227e5
commit 85be7acab2
3 changed files with 99 additions and 15 deletions
+43
View File
@@ -745,6 +745,49 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
}
}
$scope.repair = {
busy: false,
error: {},
optionalDomains: [],
backups: [],
backupId: '',
show: function () {
$scope.repair.error = {};
$scope.repair.busy = false;
$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');
});
},
submit: function () {
$scope.repair.error = {};
$scope.repair.busy = true;
// TODO pass disabled domain info or backupId
Client.repairApp($scope.app.id, {}, function (error) {
if (error) return Client.error(error);
$scope.repair.busy = false;
$('#repairModal').modal('hide');
});
}
}
$scope.postInstallConfirm = {
message: '',
confirmed: false,