public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 2/3] ui: form: file selector: allow optional filter
Date: Thu, 13 Mar 2025 12:17:55 +0100	[thread overview]
Message-ID: <20250313111756.1560235-4-d.csapak@proxmox.com> (raw)
In-Reply-To: <20250313111756.1560235-1-d.csapak@proxmox.com>

this sometimes comes in handy when we only want to show specific files.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/manager6/form/FileSelector.js | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/www/manager6/form/FileSelector.js b/www/manager6/form/FileSelector.js
index ef2bedf9..9db20711 100644
--- a/www/manager6/form/FileSelector.js
+++ b/www/manager6/form/FileSelector.js
@@ -43,6 +43,13 @@ Ext.define('PVE.form.FileSelector', {
 	    url: url,
 	});
 
+	if (Ext.isFunction(me.filter)) {
+	    me.store.clearFilter();
+	    me.store.addFilter([me.filter]);
+	} else {
+	    me.store.clearFilter();
+	}
+
 	me.store.removeAll();
 	me.store.load();
     },
@@ -60,6 +67,9 @@ Ext.define('PVE.form.FileSelector', {
     valueField: 'volid',
     displayField: 'text',
 
+    // An optional filter function
+    filter: undefined,
+
     listConfig: {
 	width: 600,
 	columns: [
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  parent reply	other threads:[~2025-03-13 11:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-13 11:17 [pve-devel] [PATCH storage/manager] allow upload & import of qcow2 in the web UI Dominik Csapak
2025-03-13 11:17 ` [pve-devel] [PATCH storage 1/1] import: allow upload of qcow2 files into import storage Dominik Csapak
2025-03-13 11:17 ` [pve-devel] [PATCH manager 1/3] ui: storage content: allow upload of qcow2 for import type Dominik Csapak
2025-03-13 11:17 ` Dominik Csapak [this message]
2025-03-13 11:17 ` [pve-devel] [PATCH manager 3/3] ui: qemu hd edit: allow importing a disk from the import storage Dominik Csapak
2025-03-17 11:05   ` Filip Schauer

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=20250313111756.1560235-4-d.csapak@proxmox.com \
    --to=d.csapak@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal