1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-01 20:05:23 +02:00

refactor(environments): remove endpoints cache [DTD-100] (#6408)

This commit is contained in:
Chaim Lev-Ari 2022-11-02 13:29:26 +02:00 committed by GitHub
parent 9ef2e27aae
commit 37d4a80769
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
51 changed files with 155 additions and 353 deletions

View file

@ -6,24 +6,24 @@ angular.module('portainer.agent').factory('HostBrowserService', HostBrowserServi
function HostBrowserServiceFactory(Browse, Upload, API_ENDPOINT_ENDPOINTS, StateManager) {
return { ls, get, delete: deletePath, rename, upload };
function ls(path) {
return Browse.ls({ path: path }).$promise;
function ls(endpointId, path) {
return Browse.ls({ endpointId, path: path }).$promise;
}
function get(path) {
return Browse.get({ path: path }).$promise;
function get(endpointId, path) {
return Browse.get({ endpointId, path: path }).$promise;
}
function deletePath(path) {
return Browse.delete({ path: path }).$promise;
function deletePath(endpointId, path) {
return Browse.delete({ endpointId, path: path }).$promise;
}
function rename(path, newPath) {
function rename(endpointId, path, newPath) {
const payload = {
CurrentFilePath: path,
NewFilePath: newPath,
};
return Browse.rename({}, payload).$promise;
return Browse.rename({ endpointId }, payload).$promise;
}
function upload(endpointId, Path, file, onProgress) {