1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-04 13:25:26 +02:00

feat(ui): add events view (#86)

* feat(ui): add events view

* chore(grunt): use minified angular script
This commit is contained in:
Anthony Lapenna 2016-07-27 17:05:16 +12:00 committed by GitHub
parent ea596a8701
commit adf5184a5d
9 changed files with 241 additions and 21 deletions

View file

@ -98,6 +98,16 @@ angular.module('dockerui.services', ['ngResource', 'ngSanitize'])
inspect: {method: 'GET', params: {id: '@id', action: 'json'}}
});
}])
.factory('Events', ['$resource', 'Settings', function EventFactory($resource, Settings) {
'use strict';
// http://docs.docker.com/reference/api/docker_remote_api_<%= remoteApiVersion %>/#/monitor-docker-s-events
return $resource(Settings.url + '/events', {}, {
query: {method: 'GET', params: {since: '@since', until: '@until'}, isArray: true, transformResponse: [function f(data) {
var str = "[" + data.replace(/\n/g, " ").replace(/\}\s*\{/g, "}, {") + "]";
return angular.fromJson(str);
}]}
});
}])
.factory('Version', ['$resource', 'Settings', function VersionFactory($resource, Settings) {
'use strict';
// http://docs.docker.com/reference/api/docker_remote_api_<%= remoteApiVersion %>/#show-the-docker-version-information