Update angular-ui-notification and show unread notifications

This commit is contained in:
Johannes Zellner
2019-01-07 17:23:26 +01:00
parent 4051e34e20
commit 48f63ec761
13 changed files with 402 additions and 32 deletions

View File

@@ -9,6 +9,7 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
$scope.client = Client;
$scope.appstoreConfig = {};
$scope.subscription = {};
$scope.notifications = [];
$scope.ready = false;
$scope.hideNavBarActions = $location.path() === '/logs';
@@ -105,6 +106,14 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
Client.notify('Reboot Required', 'To finish security updates, a reboot is necessary.', true /* persistent */, 'warning', actionScope);
});
Client.getNotifications(false, 1, 100, function (error, results) {
$scope.notifications = results;
results.forEach(function (n) {
Client.notify(n.title, n.message, true /* persistent */, 'info', n.action);
});
});
}
$scope.fetchAppstoreProfileAndSubscription = function (callback) {