From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id C41DF1FF129 for ; Fri, 17 Jul 2026 17:52:12 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id E13DF214F1; Fri, 17 Jul 2026 17:51:17 +0200 (CEST) From: "Max R. Carrara" To: pve-devel@lists.proxmox.com Subject: [RFC pve-manager v2 17/17] ui: storage: use property extension keywords for UI hints Date: Fri, 17 Jul 2026 17:49:24 +0200 Message-ID: <20260717154943.696411-18-m.carrara@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260717154943.696411-1-m.carrara@proxmox.com> References: <20260717154943.696411-1-m.carrara@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1784303397999 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.050 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 5DOY54QBOW5USVQYPPCBR7VHDSVRZWNR X-Message-ID-Hash: 5DOY54QBOW5USVQYPPCBR7VHDSVRZWNR X-MailFrom: m.carrara@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Use the newly added extension 'x-advanced' and 'x-hidden' extension keywords for storage plugin property schemas to avoid hard-coding whether a given field belongs in the "Advanced" section or is hidden, respectively. Signed-off-by: Max R. Carrara --- NOTE: This patch is experimental and thus marked as RFC. www/manager6/storage/CustomEdit.js | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/www/manager6/storage/CustomEdit.js b/www/manager6/storage/CustomEdit.js index 45fda7c8..cca66ffb 100644 --- a/www/manager6/storage/CustomEdit.js +++ b/www/manager6/storage/CustomEdit.js @@ -145,27 +145,11 @@ Ext.define('PVE.storage.CustomInputPanel', { // --> must not be added here 'enable', - // not exposed in the UI for any inbuilt storage types - // --> must not be added here (in order to remain consistent) - 'bwlimit', - 'content-dirs', - 'create-base-path', - 'create-subdirs', - 'format', - // handled separately for consistency 'content', 'shared', ]); - const advancedFields = new Set([ - 'preallocation', - - // note that the technology preview hint is automatically added - // further below if a plugin uses this property - 'snapshot-as-volume-chain', - ]); - // Added first for consistency's sake for (const propertyName of ['content', 'shared']) { let property = schema[propertyName]; @@ -175,18 +159,22 @@ Ext.define('PVE.storage.CustomInputPanel', { } } - for (const propertyName of Object.keys(schema).sort()) { + for (const [propertyName, propertySchema] of Object.entries(schema).sort()) { if (reservedFields.has(propertyName)) { continue; } + if (propertySchema['x-hidden']) { + continue; + } + let fieldDef = me.buildFormFieldFromProperty(propertyName); if (fieldDef === undefined) { continue; } - if (advancedFields.has(propertyName)) { + if (propertySchema['x-advanced']) { me.addAdvancedWidget(fieldDef); } else { me.addWidget(fieldDef); -- 2.47.3