mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
* refactor(agent): replace v1 browse with es6 module * refactor(agent): refactor agentv1 to es6 * refactor(agent): replace agent factory with es6 * refactor(agent): refactor browse response to es6 * refactor(agent): refactor browse to es6 * refactor(agent): import angular * refactor(agent): refactor host to es6 * refactor(agent): refactor ping to es6
36 lines
912 B
JavaScript
36 lines
912 B
JavaScript
import angular from 'angular';
|
|
|
|
import { browseGetResponse } from './response/browse';
|
|
|
|
angular.module('portainer.agent').factory('Browse', BrowseFactory);
|
|
|
|
function BrowseFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider, StateManager) {
|
|
return $resource(
|
|
`${API_ENDPOINT_ENDPOINTS}/:endpointId/docker/v:version/browse/:action`,
|
|
{
|
|
endpointId: EndpointProvider.endpointID,
|
|
version: StateManager.getAgentApiVersion,
|
|
},
|
|
{
|
|
ls: {
|
|
method: 'GET',
|
|
isArray: true,
|
|
params: { action: 'ls' },
|
|
},
|
|
get: {
|
|
method: 'GET',
|
|
params: { action: 'get' },
|
|
transformResponse: browseGetResponse,
|
|
responseType: 'arraybuffer',
|
|
},
|
|
delete: {
|
|
method: 'DELETE',
|
|
params: { action: 'delete' },
|
|
},
|
|
rename: {
|
|
method: 'PUT',
|
|
params: { action: 'rename' },
|
|
},
|
|
}
|
|
);
|
|
}
|