* [pve-devel] [PATCH manager] ui: disk storage selector: fix check for disabling format selector
@ 2025-07-18 10:24 Friedrich Weber
2025-07-18 10:31 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Friedrich Weber @ 2025-07-18 10:24 UTC (permalink / raw)
To: pve-devel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-07-18 10:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-18 10:24 [pve-devel] [PATCH manager] ui: disk storage selector: fix check for disabling format selector Friedrich Weber
2025-07-18 10:31 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox