From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 4FCCC1FF17A for ; Fri, 18 Jul 2025 12:25:11 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 274851A361; Fri, 18 Jul 2025 12:26:19 +0200 (CEST) From: Friedrich Weber To: pve-devel@lists.proxmox.com Date: Fri, 18 Jul 2025 12:24:14 +0200 Message-ID: <20250718102532.61149-1-f.weber@proxmox.com> X-Mailer: git-send-email 2.47.2 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1752834342984 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.012 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH manager] ui: disk storage selector: fix check for disabling format selector X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "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 --- 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