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

feat(container-stats): overhaul (#1183)

This commit is contained in:
Anthony Lapenna 2017-09-09 18:49:21 +02:00 committed by GitHub
parent b9b32f0526
commit c0d282e85b
13 changed files with 607 additions and 361 deletions

View file

@ -13,7 +13,14 @@ angular.module('portainer.rest')
kill: {method: 'POST', params: {id: '@id', action: 'kill'}},
pause: {method: 'POST', params: {id: '@id', action: 'pause'}},
unpause: {method: 'POST', params: {id: '@id', action: 'unpause'}},
stats: {method: 'GET', params: {id: '@id', stream: false, action: 'stats'}, timeout: 5000},
stats: {
method: 'GET', params: { id: '@id', stream: false, action: 'stats' },
timeout: 4500
},
top: {
method: 'GET', params: { id: '@id', action: 'top' },
timeout: 4500
},
start: {
method: 'POST', params: {id: '@id', action: 'start'},
transformResponse: genericHandler

View file

@ -1,17 +0,0 @@
angular.module('portainer.rest')
.factory('ContainerTop', ['$http', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', function ($http, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
'use strict';
return {
get: function (id, params, callback, errorCallback) {
$http({
method: 'GET',
url: API_ENDPOINT_ENDPOINTS + '/' + EndpointProvider.endpointID() + '/docker/containers/' + id + '/top',
params: {
ps_args: params.ps_args
}
}).success(callback).error(function (data, status, headers, config) {
console.log(data);
});
}
};
}]);