1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00
portainer/app/components/events/eventsController.js
2017-12-06 12:04:02 +01:00

19 lines
503 B
JavaScript

angular.module('events', [])
.controller('EventsController', ['$scope', 'Notifications', 'SystemService',
function ($scope, Notifications, SystemService) {
function initView() {
var from = moment().subtract(24, 'hour').unix();
var to = moment().unix();
SystemService.events(from, to)
.then(function success(data) {
$scope.events = data;
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to load events');
});
}
initView();
}]);