mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-29 15:33:08 +00:00
fix #4001: FileBrowser: add a configurable prefix to downloaded files
Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
This commit is contained in:
parent
f5be46bc99
commit
614b3cd488
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user