public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH manager v4 07/12] ui: qemu: introduce hardware disk grid
Date: Mon, 31 Aug 2026 14:27:42 +0200	[thread overview]
Message-ID: <20260831122953.2980232-8-d.csapak@proxmox.com> (raw)
In-Reply-To: <20260831122953.2980232-1-d.csapak@proxmox.com>

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 <d.csapak@proxmox.com>
---
 www/manager6/Makefile                 |   1 +
 www/manager6/Utils.js                 |   7 +
 www/manager6/qemu/HardwareDiskGrid.js | 213 ++++++++++++++++++++++++++
 3 files changed, 221 insertions(+)
 create mode 100644 www/manager6/qemu/HardwareDiskGrid.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 79ec91bd..01715aa0 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 e9524b11..f48748db 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -2168,6 +2168,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..f64a38e8
--- /dev/null
+++ b/www/manager6/qemu/HardwareDiskGrid.js
@@ -0,0 +1,213 @@
+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 (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) => 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: PVE.Utils.renderBooleanProperty,
+        },
+        {
+            header: gettext('Async I/O'),
+            dataIndex: 'aio',
+            width: 100,
+        },
+        {
+            header: gettext('Bandwidth Limits'),
+            hidden: true,
+            columns: [
+                {
+                    header: gettext('Read limit (MiB/s)'),
+                    dataIndex: 'mbps_rd',
+                    width: 110,
+                },
+                {
+                    header: gettext('Write limit (MiB/s)'),
+                    dataIndex: 'mbps_wr',
+                    width: 110,
+                },
+                {
+                    header: gettext('Read limit (ops/s)'),
+                    dataIndex: 'iops_rd',
+                    width: 110,
+                },
+                {
+                    header: gettext('Write limit (ops/s)'),
+                    dataIndex: 'iops_wr',
+                    width: 110,
+                },
+                {
+                    header: gettext('Read Burst (MiB/s)'),
+                    dataIndex: 'mbps_rd_max',
+                    width: 110,
+                },
+                {
+                    header: gettext('Write Burst (MiB/s)'),
+                    dataIndex: 'mbps_wr_max',
+                    width: 110,
+                },
+                {
+                    header: gettext('Read Burst (ops/s)'),
+                    dataIndex: 'iops_rd_max',
+                    width: 110,
+                },
+                {
+                    header: gettext('Write Burst (ops/s)'),
+                    dataIndex: 'iops_wr_max',
+                    width: 110,
+                },
+            ],
+        },
+        {
+            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





  parent reply	other threads:[~2026-08-31 12:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 12:27 [PATCH manager v4 00/12] ui: split out disks and nics into grids Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 01/12] ui: utils: factor out 'media=cdrom' check Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 02/12] ui: factor out the guest key nic regex check Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 03/12] ui: add pending grid Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 04/12] ui: revert button: add parentXType and reloadCallback Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 05/12] ui: button: add config remove button Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 06/12] ui: qemu: hardware: wrap in container Dominik Csapak
2026-08-31 12:27 ` Dominik Csapak [this message]
2026-08-31 12:27 ` [PATCH manager v4 08/12] ui: qemu: introduce hardware net grid Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 09/12] ui: qemu: hardware view: separate disks into own grid Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 10/12] ui: qemu: hardware view: separate nics " Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 11/12] ui: qemu: hardware view: inline edit/remove/revert button in general grid Dominik Csapak
2026-08-31 12:27 ` [PATCH manager v4 12/12] ui: qemu: hardware view: inline 'add efi' menuitem Dominik Csapak
2026-08-31 13:20 ` [PATCH manager v4 00/12] ui: split out disks and nics into grids Jonas Theisen
2026-08-31 14:11   ` Aaron Lauterer
2026-08-31 14:38   ` Jonas Theisen

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=20260831122953.2980232-8-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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal