public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Friedrich Weber <f.weber@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] ui: disk storage selector: fix check for disabling format selector
Date: Fri, 18 Jul 2025 12:24:14 +0200	[thread overview]
Message-ID: <20250718102532.61149-1-f.weber@proxmox.com> (raw)

The API returns an object where a format can map to 0 (unsupported) or
1 (supported). However, when deciding whether to disable the format
selector by counting the number of valid formats, the GUI only took
the number of entries into account, not the actual values, so it would
show the format selector even though there is only one entry with
value 1. Fix this by taking the values into account when counting the
number of valid formats.

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
---
 www/manager6/form/DiskStorageSelector.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/www/manager6/form/DiskStorageSelector.js b/www/manager6/form/DiskStorageSelector.js
index 3e964315..7c0882a5 100644
--- a/www/manager6/form/DiskStorageSelector.js
+++ b/www/manager6/form/DiskStorageSelector.js
@@ -73,7 +73,9 @@ Ext.define('PVE.form.DiskStorageSelector', {
 
         var select = !!rec.data.select_existing && !me.hideSelection;
 
-        formatsel.setDisabled(me.hideFormat || Ext.Object.getSize(validFormats) <= 1);
+        let numberOfValidFormats = Ext.Object.getValues(validFormats)
+            .filter(valid => !!valid).length;
+        formatsel.setDisabled(me.hideFormat || numberOfValidFormats <= 1);
         formatsel.setValue(selectFormat);
 
         hdfilesel.setDisabled(!select);
-- 
2.47.2



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


             reply	other threads:[~2025-07-18 10:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-18 10:24 Friedrich Weber [this message]
2025-07-18 10:31 ` [pve-devel] applied: " 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=20250718102532.61149-1-f.weber@proxmox.com \
    --to=f.weber@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