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 C43341FF0BC for ; Mon, 16 Nov 2026 17:33:02 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 1725D21806; Mon, 16 Nov 2026 17:31:48 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager v5 14/18] ui: utils: factor out volume size renderer Date: Mon, 16 Nov 2026 17:30:39 +0100 Message-ID: <20261116163138.343821-15-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261116163138.343821-1-d.csapak@proxmox.com> References: <20261116163138.343821-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.298 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_MED -2.3 Sender listed at https://www.dnswl.org/, medium 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: KL2EX4SRASXVZQ5KL67UQILHXSFGPXT2 X-Message-ID-Hash: KL2EX4SRASXVZQ5KL67UQILHXSFGPXT2 X-MailFrom: d.csapak@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: so it can be reused for the volumes of containers. No functional change intended. Signed-off-by: Dominik Csapak --- www/manager6/Utils.js | 15 +++++++++++++++ www/manager6/qemu/HardwareDiskGrid.js | 14 +------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index 49862c0f..92ed6861 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -2206,6 +2206,21 @@ Ext.define('PVE.Utils', { return Ext.htmlEncode(description); }, + // renders the size of a volume from a guest config + renderConfigVolumeSize: function (value) { + if (value === undefined || value === null) { + return ''; + } + + let size = value; + if (!size.toString().slice(-1).match(/[0-9]/)) { + // IEC unit is implicit in config, but parser expects it as 'i' suffix + size = `${value}i`; + } + + return Proxmox.Utils.autoscale_size_unit(size); + }, + renderBooleanProperty: function (value) { if (Ext.isString(value)) { value = PVE.Parser.parseBoolean(value); diff --git a/www/manager6/qemu/HardwareDiskGrid.js b/www/manager6/qemu/HardwareDiskGrid.js index 711b0b56..13842736 100644 --- a/www/manager6/qemu/HardwareDiskGrid.js +++ b/www/manager6/qemu/HardwareDiskGrid.js @@ -34,19 +34,7 @@ Ext.define('PVE.qemu.HardwareDiskGrid', { header: gettext('Size'), dataIndex: 'size', width: 100, - renderer: (value) => { - if (value === undefined || value === null) { - return ''; - } - - let size = value; - if (!size.toString().slice(-1).match(/[0-9]/)) { - // IEC unit is implicit in config, but parser expects it as 'i' suffix - size = `${value}i`; - } - - return Proxmox.Utils.autoscale_size_unit(size); - }, + renderer: PVE.Utils.renderConfigVolumeSize, }, { header: gettext('Secure Boot (EFI Disk only)'), -- 2.47.3