Further reduce ui flickering on restore

This commit is contained in:
Johannes Zellner
2017-10-18 00:36:59 +02:00
parent 2ebe92fec3
commit e199293229
2 changed files with 6 additions and 6 deletions

View File

@@ -179,13 +179,13 @@
<div class="modal-header">
<h4 class="modal-title">Restore {{ appRestore.app.fqdn }}</h4>
</div>
<div class="modal-body" ng-show="appRestore.backups.length === 0 && appRestore.busy">
<div class="modal-body" ng-show="appRestore.busyFetching">
<h4 class="text-center"><i class="fa fa-circle-o-notch fa-spin"></i> Fetching backups</h4>
</div>
<div class="modal-body" ng-show="appRestore.backups.length === 0 && !appRestore.busy">
<div class="modal-body" ng-show="appRestore.backups.length === 0 && !appRestore.busyFetching">
<h4 class="text-danger">This app has no backups.</h4>
</div>
<div class="modal-body" ng-show="appRestore.backups.length !== 0 && !appRestore.busy">
<div class="modal-body" ng-show="appRestore.backups.length !== 0">
<p>Restoring the app will lose all content generated since the backup.</p>
<label class="control-label">Select backup</label>
<div class="dropdown">

View File

@@ -63,6 +63,7 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
$scope.appRestore = {
busy: false,
busyFetching: false,
error: {},
app: {},
password: '',
@@ -328,7 +329,7 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
$scope.reset();
$scope.appRestore.app = app;
$scope.appRestore.busy = true;
$scope.appRestore.busyFetching = true;
$('#appRestoreModal').modal('show');
@@ -338,7 +339,7 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
} else {
$scope.appRestore.backups = backups;
if (backups.length) $scope.appRestore.selectedBackup = backups[0]; // pre-select first backup
$scope.appRestore.busy = false;
$scope.appRestore.busyFetching = false;
}
});
@@ -359,7 +360,6 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
Client.error(error);
} else {
$('#appRestoreModal').modal('hide');
$scope.reset();
}
$scope.appRestore.busy = false;