mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 05:19:39 +02:00
feat(app): toggle features based on agent API version (#2378)
* feat(agent): get agent's version from ping * feat(agent): add version to api url * feat(agent): query agent with api version * feat(agent): rename agent api version name on state * feat(agent): disable feature based on agent's api version * style(agent): rename ping rest service + remove whitespaces * style(state): remove whitespace * style(agent): add whitespace * fix(agent): remove check for error status 403 * refactor(agent): rename ping file name * refactor(agent): move old services to v1 folder * refactor(agent): turn ping service to usual pattern * refactor(agent): change version to a global variable * refactor(agent): move ping to version2 * refactor(agent): restore ping to use root ping * fix(volumes): add volumeID to browse api path * feat(volume): add upload button to volume browser
This commit is contained in:
parent
cca378b2e8
commit
9813099aa4
24 changed files with 224 additions and 41 deletions
|
@ -84,6 +84,16 @@ function (HttpRequestHelper, VolumeBrowserService, FileSaver, Blob, ModalService
|
|||
});
|
||||
}
|
||||
|
||||
this.onFileSelectedForUpload = function onFileSelectedForUpload(file) {
|
||||
VolumeBrowserService.upload(ctrl.state.path, file, ctrl.volumeId)
|
||||
.then(function onFileUpload() {
|
||||
onFileUploaded();
|
||||
})
|
||||
.catch(function onFileUpload(err) {
|
||||
Notifications.error('Failure', err, 'Unable to upload file');
|
||||
});
|
||||
};
|
||||
|
||||
function parentPath(path) {
|
||||
if (path.lastIndexOf('/') === 0) {
|
||||
return '/';
|
||||
|
@ -112,4 +122,14 @@ function (HttpRequestHelper, VolumeBrowserService, FileSaver, Blob, ModalService
|
|||
});
|
||||
};
|
||||
|
||||
function onFileUploaded() {
|
||||
refreshList();
|
||||
}
|
||||
|
||||
function refreshList() {
|
||||
browse(ctrl.state.path);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue