Use tabs instead of accordion for restore/clone ui

This commit is contained in:
Johannes Zellner
2018-05-29 22:05:18 +02:00
parent 11ae5d4832
commit c031253bd4
2 changed files with 103 additions and 131 deletions
+18 -7
View File
@@ -205,13 +205,22 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
createBackup: function () {
Client.backupApp($scope.appRestore.app.id, function (error) {
if (error) {
Client.error(error);
} else {
$('#appRestoreModal').modal('hide');
if (error) Client.error(error);
function waitForBackupFinish() {
if ($scope.appRestore.app.installationState === 'pending_backup') return $timeout(waitForBackupFinish, 1000);
// we are done, refresh the backup list
Client.getAppBackups($scope.appRestore.app.id, function (error, backups) {
if (error) return Client.error(error);
$scope.appRestore.backups = backups;
if (backups.length) $scope.appRestore.selectedBackup = backups[0]; // pre-select first backup
});
}
Client.refreshInstalledApps(); // reflect the new app state immediately
// reflect the new app state immediately
Client.refreshInstalledApps(waitForBackupFinish);
});
},
@@ -372,8 +381,10 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
$scope.appRestore.portBindingsEnabled = {};
$scope.appRestore.action = 'restore';
$scope.appRestoreForm.$setPristine();
$scope.appRestoreForm.$setUntouched();
if ($scope.appRestoreForm) {
$scope.appRestoreForm.$setPristine();
$scope.appRestoreForm.$setUntouched();
}
};
$scope.readCertificate = function (event) {