all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH manager v3 08/13] ui: qemu: introduce hardware disk grid
Date: Fri, 15 May 2026 10:44:26 +0200	[thread overview]
Message-ID: <20260515085349.1123127-9-d.csapak@proxmox.com> (raw)
In-Reply-To: <20260515085349.1123127-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 e4964b32..edef39eb 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -265,6 +265,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 f7eec0f7..7df16555 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -2120,6 +2120,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-05-15  8:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-15  8:44 [PATCH manager v3 00/13] ui: split out disks and nics into grids Dominik Csapak
2026-05-15  8:44 ` [PATCH manager v3 01/13] ui: utils: factor out 'media=cdrom' check Dominik Csapak
2026-05-15  8:44 ` [PATCH manager v3 02/13] ui: factor out the guest key nic regex check Dominik Csapak
2026-05-15  8:44 ` [PATCH manager v3 03/13] ui: parser: qemu drive: allow '-' in key names Dominik Csapak
2026-05-15  8:44 ` [PATCH manager v3 04/13] ui: add pending grid Dominik Csapak
2026-05-15  8:44 ` [PATCH manager v3 05/13] ui: revert button: add parentXType and reloadCallback Dominik Csapak
2026-05-15  8:44 ` [PATCH manager v3 06/13] ui: button: add config remove button Dominik Csapak
2026-05-15  8:44 ` [PATCH manager v3 07/13] ui: qemu: hardware: wrap in container Dominik Csapak
2026-05-15  8:44 ` Dominik Csapak [this message]
2026-05-15  8:44 ` [PATCH manager v3 09/13] ui: qemu: introduce hardware net grid Dominik Csapak
2026-05-15  8:44 ` [PATCH manager v3 10/13] ui: qemu: hardware view: separate disks into own grid Dominik Csapak
2026-05-15  8:44 ` [PATCH manager v3 11/13] ui: qemu: hardware view: separate nics " Dominik Csapak
2026-05-15  8:44 ` [PATCH manager v3 12/13] ui: qemu: hardware view: inline edit/remove/revert button in general grid Dominik Csapak
2026-05-15  8:44 ` [PATCH manager v3 13/13] ui: qemu: hardware view: inline 'add efi' menuitem Dominik Csapak
2026-05-15  9:18 ` [PATCH manager v3 00/13] ui: split out disks and nics into grids Dominik Csapak
2026-05-15  9:20   ` 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=20260515085349.1123127-9-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal