public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-widget-toolkit 1/2] FileBrowser: allow downloading root folder and simplify code
@ 2021-04-12 15:32 Stefan Reiter
  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  7:02 ` [pbs-devel] applied: [pve-devel] [PATCH proxmox-widget-toolkit 1/2] FileBrowser: allow downloading root folder and simplify code Thomas Lamprecht
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Reiter @ 2021-04-12 15:32 UTC (permalink / raw)
  To: pve-devel, pbs-devel

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





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-04-13  7:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12 15:32 [pbs-devel] [PATCH proxmox-widget-toolkit 1/2] FileBrowser: allow downloading root folder and simplify code Stefan Reiter
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal