mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
feat(volume-browser): add the ability to browse volume content (#2051)
This commit is contained in:
parent
cec878b01d
commit
48179b9e3d
22 changed files with 366 additions and 18 deletions
|
@ -5,6 +5,6 @@ angular.module('portainer.agent')
|
|||
endpointId: EndpointProvider.endpointID
|
||||
},
|
||||
{
|
||||
query: {method: 'GET', isArray: true}
|
||||
query: { method: 'GET', isArray: true }
|
||||
});
|
||||
}]);
|
||||
|
|
22
app/agent/rest/browse.js
Normal file
22
app/agent/rest/browse.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
angular.module('portainer.agent')
|
||||
.factory('Browse', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', function BrowseFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
|
||||
'use strict';
|
||||
return $resource(API_ENDPOINT_ENDPOINTS + '/:endpointId/docker/browse/:id/:action', {
|
||||
endpointId: EndpointProvider.endpointID
|
||||
},
|
||||
{
|
||||
ls: {
|
||||
method: 'GET', isArray: true, params: { id: '@id', action: 'ls' }
|
||||
},
|
||||
get: {
|
||||
method: 'GET', params: { id: '@id', action: 'get' },
|
||||
transformResponse: browseGetResponse
|
||||
},
|
||||
delete: {
|
||||
method: 'DELETE', params: { id: '@id', action: 'delete' }
|
||||
},
|
||||
rename: {
|
||||
method: 'PUT', params: { id: '@id', action: 'rename' }
|
||||
}
|
||||
});
|
||||
}]);
|
9
app/agent/rest/response/browse.js
Normal file
9
app/agent/rest/response/browse.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
// The get action of the Browse service returns a file.
|
||||
// ngResource will transform it as an array of chars.
|
||||
// This functions simply creates a response object and assign
|
||||
// the data to a field.
|
||||
function browseGetResponse(data) {
|
||||
var response = {};
|
||||
response.file = data;
|
||||
return response;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue