mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
Added events endpoint.
This commit is contained in:
parent
d6c524f960
commit
32a4703a53
9 changed files with 49 additions and 8 deletions
18
app/components/events/events.html
Normal file
18
app/components/events/events.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<h2>Events</h2>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Event</th>
|
||||
<th>From</th>
|
||||
<th>ID</th>
|
||||
<th>Time</th>
|
||||
</tr>
|
||||
<tr ng-repeat="event in dockerEvents">
|
||||
<td ng-bind="event.status"/>
|
||||
<td ng-bind="event.from"/>
|
||||
<td ng-bind="event.id"/>
|
||||
<td ng-bind="event.time"/>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
10
app/components/events/eventsController.js
Normal file
10
app/components/events/eventsController.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
angular.module('events', [])
|
||||
.controller('EventsController', ['Settings', '$scope', function(Settings, $scope) {
|
||||
var yesterday = Math.floor(Date.now() / 1000) - 86400; // Today's date minus 24 hours.
|
||||
$scope.dockerEvents = [];
|
||||
oboe(Settings.url + '/events' + '?since=' + yesterday)
|
||||
.done(function(node) {
|
||||
$scope.dockerEvents.push(node);
|
||||
$scope.$apply();
|
||||
});
|
||||
}]);
|
Loading…
Add table
Add a link
Reference in a new issue