mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 04:15:28 +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
27
app/agent/services/volumeBrowserService.js
Normal file
27
app/agent/services/volumeBrowserService.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
angular.module('portainer.agent')
|
||||
.factory('VolumeBrowserService', ['$q', 'Browse', function VolumeBrowserServiceFactory($q, Browse) {
|
||||
'use strict';
|
||||
var service = {};
|
||||
|
||||
service.ls = function(volumeId, path) {
|
||||
return Browse.ls({ 'id': volumeId, 'path': path }).$promise;
|
||||
};
|
||||
|
||||
service.get = function(volumeId, path) {
|
||||
return Browse.get({ 'id': volumeId, 'path': path }).$promise;
|
||||
};
|
||||
|
||||
service.delete = function(volumeId, path) {
|
||||
return Browse.delete({ 'id': volumeId, 'path': path }).$promise;
|
||||
};
|
||||
|
||||
service.rename = function(volumeId, path, newPath) {
|
||||
var payload = {
|
||||
CurrentFilePath: path,
|
||||
NewFilePath: newPath
|
||||
};
|
||||
return Browse.rename({ 'id': volumeId }, payload).$promise;
|
||||
};
|
||||
|
||||
return service;
|
||||
}]);
|
Loading…
Add table
Add a link
Reference in a new issue