Add basic eventlog for apps in app view
This commit is contained in:
@@ -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: {},
|
||||
|
||||
Reference in New Issue
Block a user