portainer/app/docker/views/events/eventsController.js

20 lines
509 B
JavaScript
Raw Normal View History

angular.module('portainer.docker')
.controller('EventsController', ['$scope', 'Notifications', 'SystemService',
function ($scope, Notifications, SystemService) {
function initView() {
var from = moment().subtract(24, 'hour').unix();
var to = moment().unix();
2016-07-26 23:08:18 +00:00
SystemService.events(from, to)
.then(function success(data) {
$scope.events = data;
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to load events');
2016-07-26 23:08:18 +00:00
});
}
initView();
2016-07-26 23:08:18 +00:00
}]);