From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 1A9FD1FF0BC for ; Mon, 16 Nov 2026 17:33:27 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 381822184D; Mon, 16 Nov 2026 17:31:49 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager v5 08/18] ui: qemu: introduce hardware disk grid Date: Mon, 16 Nov 2026 17:30:33 +0100 Message-ID: <20261116163138.343821-9-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.247 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) PROLO_LEO1 0.1 Meta Catches all Leo drug variations so far 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: MVTMDO7T3R5YNRRHU3QZ2FY2D5LKBYDL X-Message-ID-Hash: MVTMDO7T3R5YNRRHU3QZ2FY2D5LKBYDL 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: intended to be used inside the hardware view. not used yet. The toolbar buttons will be added directly in the hardware view since it requires accessing some data from there. Signed-off-by: Dominik Csapak --- www/manager6/Makefile | 1 + www/manager6/Utils.js | 7 + www/manager6/qemu/HardwareDiskGrid.js | 215 ++++++++++++++++++++++++++ 3 files changed, 223 insertions(+) create mode 100644 www/manager6/qemu/HardwareDiskGrid.js diff --git a/www/manager6/Makefile b/www/manager6/Makefile index 364f0883..dd33eb90 100644 --- a/www/manager6/Makefile +++ b/www/manager6/Makefile @@ -270,6 +270,7 @@ JSSRC= \ qemu/HDTPM.js \ qemu/HDMove.js \ qemu/HDResize.js \ + qemu/HardwareDiskGrid.js \ qemu/HardwareView.js \ qemu/IPConfigEdit.js \ qemu/KeyboardEdit.js \ diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index 42d3242a..49862c0f 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -2205,6 +2205,13 @@ Ext.define('PVE.Utils', { ); return Ext.htmlEncode(description); }, + + renderBooleanProperty: function (value) { + if (Ext.isString(value)) { + value = PVE.Parser.parseBoolean(value); + } + return Proxmox.Utils.format_boolean(value); + }, }, singleton: true, diff --git a/www/manager6/qemu/HardwareDiskGrid.js b/www/manager6/qemu/HardwareDiskGrid.js new file mode 100644 index 00000000..711b0b56 --- /dev/null +++ b/www/manager6/qemu/HardwareDiskGrid.js @@ -0,0 +1,215 @@ +Ext.define('PVE.qemu.HardwareDiskGrid', { + extend: 'PVE.grid.PendingGrid', + alias: 'widget.pveHardwareDiskGrid', + + title: gettext('Hard Disks'), + + stateful: true, + stateId: 'pve-qemu-hardware-disk', + + border: false, + expandable: false, + + minHeight: 100, + emptyText: gettext('No hard disks configured'), + + recordParser: PVE.Parser.parseQemuDrive, + // override to render the keys properly + renderKey: Ext.htmlEncode, + + columns: [ + { + header: gettext('Bus/Device'), + dataIndex: 'id', + width: 150, + renderer: 'renderKey', + }, + { + header: gettext('Volume/File'), + dataIndex: 'file', + flex: 1, + minWidth: 200, + }, + { + 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); + }, + }, + { + header: gettext('Secure Boot (EFI Disk only)'), + dataIndex: 'pre-enrolled-keys', + renderer: (v, _md, rec, rI, cI, store, view, pending) => { + let iface = pending ? rec.data.pending?.interface : rec.data.interface; + if (iface !== 'efidisk') { + return ''; + } + if (PVE.Parser.parseBoolean(v)) { + let msCerts = pending ? rec.data.pending?.['ms-cert'] : rec.data['ms-cert']; + if (msCerts) { + return `${gettext('Yes')} (MS Certificate: ${msCerts})`; + } else { + return gettext('Yes'); + } + } else { + return gettext('No'); + } + }, + }, + { + header: gettext('Cache'), + dataIndex: 'cache', + width: 140, + renderer: (v) => + Ext.htmlEncode(v) ?? `${Proxmox.Utils.defaultText} (${gettext('No cache')})`, + }, + { + header: gettext('Discard'), + dataIndex: 'discard', + width: 80, + renderer: PVE.Utils.renderBooleanProperty, + }, + { + header: gettext('IO thread'), + dataIndex: 'iothread', + width: 100, + renderer: PVE.Utils.renderBooleanProperty, + }, + { + header: gettext('SSD emulation'), + dataIndex: 'ssd', + width: 120, + renderer: PVE.Utils.renderBooleanProperty, + }, + { + header: gettext('Backup'), + dataIndex: 'backup', + width: 80, + renderer: (v) => PVE.Utils.renderBooleanProperty(v ?? true), + }, + { + header: gettext('Read-Only'), + dataIndex: 'ro', + width: 100, + renderer: PVE.Utils.renderBooleanProperty, + }, + { + header: gettext('Replicate'), + dataIndex: 'replicate', + width: 100, + renderer: (v) => PVE.Utils.renderBooleanProperty(v ?? true), + }, + { + header: gettext('Async I/O'), + dataIndex: 'aio', + width: 100, + renderer: (v) => Ext.htmlEncode(v) ?? `${Proxmox.Utils.defaultText} (io_uring)`, + }, + { + header: gettext('Bandwidth Limits'), + hidden: true, + columns: [ + { + header: gettext('Read limit (MiB/s)'), + dataIndex: 'mbps_rd', + width: 120, + }, + { + header: gettext('Write limit (MiB/s)'), + dataIndex: 'mbps_wr', + width: 120, + }, + { + header: gettext('Read limit (ops/s)'), + dataIndex: 'iops_rd', + width: 120, + }, + { + header: gettext('Write limit (ops/s)'), + dataIndex: 'iops_wr', + width: 120, + }, + { + header: gettext('Read Burst (MiB/s)'), + dataIndex: 'mbps_rd_max', + width: 120, + }, + { + header: gettext('Write Burst (MiB/s)'), + dataIndex: 'mbps_wr_max', + width: 120, + }, + { + header: gettext('Read Burst (ops/s)'), + dataIndex: 'iops_rd_max', + width: 120, + }, + { + header: gettext('Write Burst (ops/s)'), + dataIndex: 'iops_wr_max', + width: 120, + }, + ], + }, + { + header: gettext('Detect Zeroes'), + dataIndex: 'detect_zeroes', + hidden: true, + renderer: PVE.Utils.renderBooleanProperty, + }, + { + header: gettext('Vendor'), + dataIndex: 'vendor', + hidden: true, + }, + { + header: gettext('Product'), + dataIndex: 'product', + hidden: true, + }, + { + header: gettext('Serial'), + dataIndex: 'serial', + hidden: true, + }, + { + header: gettext('Queues'), + dataIndex: 'queues', + hidden: true, + }, + { + header: gettext('Shared'), + dataIndex: 'shared', + hidden: true, + renderer: PVE.Utils.renderBooleanProperty, + }, + { + header: gettext('Write Error Action'), + dataIndex: 'werror', + hidden: true, + }, + { + header: 'WWN', + dataIndex: 'wwn', + hidden: true, + }, + { + header: gettext('Raw Config'), + dataIndex: 'raw', + hidden: true, + flex: 1, + }, + ], +}); -- 2.47.3