Add basic eventlog for apps in app view

This commit is contained in:
Johannes Zellner
2021-09-14 12:17:38 +02:00
parent 82ede09908
commit bdd26c7d17
4 changed files with 64 additions and 2 deletions

View File

@@ -811,6 +811,39 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
}
};
$scope.eventlog = {
busy: false,
eventlogs: [],
activeEventLog: null,
show: function () {
$scope.eventlog.busy = true;
// TODO if needed make those interactive
var page = 1;
var perPage = 100;
var actions = null;
var search = $scope.app.id;
Client.getEventLogs(actions, search, page, perPage, function (error, result) {
if (error) return console.error('Failed to get events:', error);
$scope.eventlog.eventLogs = [];
result.forEach(function (e) {
$scope.eventlog.eventLogs.push({ raw: e, details: Client.eventLogDetails(e), source: Client.eventLogSource(e) });
});
$scope.eventlog.busy = false;
});
},
showDetails: function (eventLog) {
if ($scope.eventlog.activeEventLog === eventLog) $scope.eventlog.activeEventLog = null;
else $scope.eventlog.activeEventLog = eventLog;
}
};
$scope.security = {
busy: false,
error: {},