1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 07:49:41 +02:00

Switch to ngOboe, for DI and promise interface.

This commit is contained in:
Kevan Ahlquist 2015-04-18 23:06:58 -07:00
parent 2514672c35
commit 6012453d2d
4 changed files with 21 additions and 8 deletions

View file

@ -1,5 +1,5 @@
angular.module('events', [])
.controller('EventsController', ['Settings', '$scope', function(Settings, $scope) {
angular.module('events', ['ngOboe'])
.controller('EventsController', ['Settings', '$scope', 'Oboe', 'Messages', '$timeout', function(Settings, $scope, oboe, Messages, $timeout) {
$scope.updateEvents = function() {
$scope.dockerEvents = [];
@ -15,10 +15,21 @@ angular.module('events', [])
url += 'until=' + untilSecs;
}
oboe(url)
.done(function(node) {
oboe({
url: url,
pattern: '{id status time}'
})
.then(function(node) {
// finished loading
$timeout(function() {
$scope.$apply();
});
}, function(error) {
// handle errors
Messages.error("Failure", error.data);
}, function(node) {
// node received
$scope.dockerEvents.push(node);
$scope.$apply();
});
};