added a dismiss-all button to the notification area

This commit is contained in:
Rune Henriksen
2018-04-05 20:32:13 +02:00
parent e738d9286a
commit f209a5d38b
2 changed files with 21 additions and 1 deletions
@@ -16,6 +16,19 @@ backupApp.directive('notificationArea', function() {
);
};
$scope.doDismissAll = function() {
angular.forEach($scope.Notifications, function(value, key){
id = value['ID'];
AppService.delete('/notification/' + id).then(
function() { }, // Don't care, the message will be removed
function(resp) {
// Most likely there was a sync problem, so attempt to reload
NotificationService.refresh_notifications();
}
);
});
};
$scope.doShowLog = function(backupid) {
AppService.get('/backup/' + backupid + '/isactive').then(
function() {
@@ -33,7 +33,14 @@
<div class="clear"></div>
</div>
</div>
</div>
</li>
<li class="error" ng-if="Notifications.length > 0">
<div class="content">
<div class="buttons">
<a href ng-click="doDismissAll()" class="button dismiss" translate>Dismiss all</a>
<div class="clear"></div>
</div>
</div>
</li>
</ul>