Attempt to parse the notification message as json and show accordingly

This commit is contained in:
Johannes Zellner
2019-02-08 14:05:15 +01:00
parent 2cf0b528f0
commit bb0443b967
2 changed files with 9 additions and 1 deletions
+7
View File
@@ -20,6 +20,13 @@ angular.module('Application').controller('NotificationsController', ['$scope', '
// collapse by default
result.forEach(function (r) { r.isCollapsed = true; });
// attempt to parse the message as json
result.forEach(function (r) {
try {
r.messageJson = JSON.parse(r.message);
} catch (e) {}
});
$scope.notifications.notifications = result;
$scope.notifications.busy = false;