fix #4001: FileBrowser: add a configurable prefix to downloaded files

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
This commit is contained in:
Stefan Sterz 2022-05-05 15:52:50 +02:00 committed by Thomas Lamprecht
parent f5be46bc99
commit 614b3cd488

View File

@ -93,6 +93,9 @@ Ext.define("Proxmox.window.FileBrowser", {
// "Download" button when the selection can be downloaded as // "Download" button when the selection can be downloaded as
// .tar files // .tar files
enableTar: false, enableTar: false,
// prefix to prepend to downloaded file names
downloadPrefix: '',
}, },
controller: { controller: {
@ -124,12 +127,11 @@ Ext.define("Proxmox.window.FileBrowser", {
let data = selection[0].data; let data = selection[0].data;
let atag = document.createElement('a');
atag.download = data.text;
let params = { ...view.extraParams }; let params = { ...view.extraParams };
params.filepath = data.filepath; params.filepath = data.filepath;
atag.download = data.text;
let atag = document.createElement('a');
atag.download = view.downloadPrefix + data.text;
if (data.type === 'd') { if (data.type === 'd') {
if (tar) { if (tar) {
params.tar = 1; params.tar = 1;