From: Dominik Csapak <d.csapak@proxmox.com>
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 [thread overview]
Message-ID: <20261116163138.343821-15-d.csapak@proxmox.com> (raw)
In-Reply-To: <20261116163138.343821-1-d.csapak@proxmox.com>
so it can be reused for the volumes of containers.
No functional change intended.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
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
next prev parent reply other threads:[~2026-11-16 16:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 16:30 [PATCH pve-manager v5 00/18] ui: split out disks and nics into grids Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 01/18] ui: utils: factor out 'media=cdrom' check Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 02/18] ui: parser: qemu drive: allow '-' in key name Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 03/18] ui: factor out the guest key nic regex check Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 04/18] ui: add pending grid Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 05/18] ui: revert button: add parentXType and reloadCallback Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 06/18] ui: button: add config remove button Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 07/18] ui: qemu: hardware: wrap in container Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 08/18] ui: qemu: introduce hardware disk grid Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 09/18] ui: qemu: introduce hardware net grid Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 10/18] ui: qemu: hardware view: separate disks into own grid Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 11/18] ui: qemu: hardware view: separate nics " Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 12/18] ui: qemu: hardware view: inline edit/remove/revert button in general grid Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 13/18] ui: qemu: hardware view: inline 'add efi' menuitem Dominik Csapak
2026-11-16 16:30 ` Dominik Csapak [this message]
2026-11-16 16:30 ` [PATCH pve-manager v5 15/18] ui: lxc: network view: convert to pending grid Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 16/18] ui: lxc: introduce resource volume grid Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 17/18] ui: lxc: resources: separate volumes into own grid Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 18/18] ui: lxc: resources: integrate network view Dominik Csapak
2026-11-19 10:01 ` superseded: [PATCH pve-manager v5 00/18] ui: split out disks and nics into grids Dominik Csapak
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=20261116163138.343821-15-d.csapak@proxmox.com \
--to=d.csapak@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