Show error message in update dialog if a backup is currently happening

Fixes #89
This commit is contained in:
Johannes
2016-11-07 12:17:55 +01:00
parent 4668e3a771
commit eeb8cc10ae
2 changed files with 10 additions and 0 deletions
+2
View File
@@ -112,6 +112,7 @@
<br/>
<br/>
</div>
<div ng-show="installedApps | readyToUpdate">
<b ng-show="config.update.box.upgrade" class="text-danger">
This update upgrades the base system and will cause some application downtime.<br/>
@@ -122,6 +123,7 @@
<li ng-repeat="change in config.update.box.changelog">{{change}}</li>
</ul>
<br/>
<p ng-show="update.error.generic" class="text-danger">{{ update.error.generic }}</p>
<div ng-hide="config.provider !== 'caas' && config.update.box.upgrade">
<fieldset>
<form name="update_form" role="form" ng-submit="doUpdate()" autocomplete="off">
+8
View File
@@ -66,6 +66,7 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
};
$scope.showUpdateModal = function (form) {
$scope.update.error.generic = null;
$scope.update.error.password = null;
$scope.update.password = '';
@@ -76,6 +77,7 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
};
$scope.doUpdate = function () {
$scope.update.error.generic = null;
$scope.update.error.password = null;
$scope.update.busy = true;
@@ -86,7 +88,13 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
$scope.update.password = '';
$scope.update_form.password.$setPristine();
$('#inputUpdatePassword').focus();
} else if (error.statusCode === 409) {
$scope.update.error.generic = 'Please try again later. The Cloudron is creating a backup at the moment.';
$scope.update.password = '';
$scope.update_form.password.$setPristine();
$('#inputUpdatePassword').focus();
} else {
$scope.update.error.generic = error.message;
console.error('Unable to update.', error);
}
$scope.update.busy = false;