From: Stefan Reiter <s.reiter@proxmox.com>
To: pve-devel@lists.proxmox.com, pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-widget-toolkit 1/2] FileBrowser: allow downloading root folder and simplify code
Date: Mon, 12 Apr 2021 17:32:51 +0200 [thread overview]
Message-ID: <20210412153252.22652-1-s.reiter@proxmox.com> (raw)
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
---
Smoke tested by downloading an entire container archive as zip, extracting and
checking the files. If there was a reason for this to be disabled let me know.
Based on my previous series to move the FileBrowser to the widget toolkit:
https://lists.proxmox.com/pipermail/pbs-devel/2021-April/002590.html
Depends on the proxmox-backup patch to work correctly.
src/window/FileBrowser.js | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)
diff --git a/src/window/FileBrowser.js b/src/window/FileBrowser.js
index d8e75f4..7d82b01 100644
--- a/src/window/FileBrowser.js
+++ b/src/window/FileBrowser.js
@@ -98,23 +98,7 @@ Ext.define("Proxmox.window.FileBrowser", {
if (!selection || selection.length < 1) return;
let data = selection[0].data;
-
- let canDownload = false;
- if (view.downloadUrl) {
- switch (data.type) {
- case 'h':
- case 'f':
- canDownload = true;
- break;
- case 'd':
- if (data.depth > 1) {
- canDownload = true;
- }
- break;
- default: break;
- }
- }
-
+ let canDownload = view.downloadUrl && ['h', 'f', 'd'].indexOf(data.type) !== -1;
me.lookup('downloadBtn').setDisabled(!canDownload);
},
--
2.20.1
next reply other threads:[~2021-04-12 15:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-12 15:32 Stefan Reiter [this message]
2021-04-12 15:32 ` [pbs-devel] [PATCH proxmox-backup 2/2] api/datastore: allow pxar file download of entire archive Stefan Reiter
2021-04-13 6:39 ` [pbs-devel] applied: " Thomas Lamprecht
2021-04-13 7:23 ` Dominik Csapak
2021-04-13 7:29 ` Thomas Lamprecht
2021-04-13 7:02 ` [pbs-devel] applied: [pve-devel] [PATCH proxmox-widget-toolkit 1/2] FileBrowser: allow downloading root folder and simplify code Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210412153252.22652-1-s.reiter@proxmox.com \
--to=s.reiter@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox