Show any last backup error

part of cloudron/box#797
This commit is contained in:
Girish Ramakrishnan
2021-09-30 13:50:42 -07:00
parent b27d439834
commit e9b24f7313
2 changed files with 20 additions and 4 deletions
+12 -4
View File
@@ -201,7 +201,7 @@
<p class="text-info">{{ 'app.importBackupDialog.description' | tr }}</p>
<form name="importBackupForm" role="form" novalidate ng-submit="importBackup.submit()" autocomplete="off">
<p class="has-error text-center" ng-show="backups.error">{{ importBackup.error.generic }}</p>
<p class="has-error text-center" ng-show="importBackup.error">{{ importBackup.error.generic }}</p>
<div class="form-group">
<label class="control-label" for="storageProvider">{{ 'backups.configureBackupStorage.provider' | tr }} <sup><a ng-href="https://docs.cloudron.io/backups/#storage-providers" class="help" target="_blank"><i class="fa fa-question-circle"></i></a></sup></label>
@@ -1198,9 +1198,17 @@
</table>
<br/>
<button type="button" class="btn btn-primary pull-right" ng-click="backups.createBackup()" ng-disabled="app.taskId || backups.busyCreate || app.error || app.runState === 'stopped'" tooltip-enable="app.error || app.taskId || app.runState === 'stopped'" uib-tooltip="{{ app.error ? 'App is in error state' : 'App is not running' }}">
<i class="fa fa-circle-notch fa-spin" ng-show="app.installationState === 'pending_backup' || backups.busyCreate"></i> {{ 'app.backups.backups.createBackupAction' | tr }}
</button>
<div class="row">
<div class="col-md-6">
<p class="has-error" ng-show="backups.error.message">{{ backups.error.message }}</p>
</div>
<div class="col-md-6 text-right">
<button type="button" class="btn btn-primary pull-right" ng-click="backups.createBackup()" ng-disabled="app.taskId || backups.busyCreate || app.error || app.runState === 'stopped'" tooltip-enable="app.error || app.taskId || app.runState === 'stopped'" uib-tooltip="{{ app.error ? 'App is in error state' : 'App is not running' }}">
<i class="fa fa-circle-notch fa-spin" ng-show="app.installationState === 'pending_backup' || backups.busyCreate"></i> {{ 'app.backups.backups.createBackupAction' | tr }}
</button>
</div>
</div>
</div>
</div>
+8
View File
@@ -1082,6 +1082,14 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
if (error) return Client.error(error);
$scope.backups.backups = backups;
Client.getAppEventLog(app.id, 1, 1, function (error, result) {
if (error) return console.error('Failed to get events:', error);
if (result.length !== 0 && result[0].action == 'app.backup.finish') {
$scope.backups.error.message = result[0].data.errorMessage;
}
});
});
},