all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH pve-manager v2 0/2] fix #7794: ui: dc summary: add per-node VM/CT count columns
@ 2026-07-28  7:51 Erik Fastermann
  2026-07-28  7:51 ` [PATCH pve-manager v2 1/2] ui: dc summary: update node grid fields in a single set() call Erik Fastermann
  2026-07-28  7:51 ` [PATCH pve-manager v2 2/2] fix #7794: ui: dc summary: add per-node VM/CT count columns Erik Fastermann
  0 siblings, 2 replies; 3+ messages in thread
From: Erik Fastermann @ 2026-07-28  7:51 UTC (permalink / raw)
  To: pve-devel; +Cc: Erik Fastermann

Add columns to the node list showing the number of running and total
VMs and CTs per node, so the workload distribution across the cluster
is visible at a glance.

Changes since v1:
* Using 'gridstore.beginUpdate()' and 'gridstore.endUpdate()' and
  passing an object to 'item.set()' as suggested by @David Riley,
  thank you!
* Passing 'dirty: false' to 'item.set()' which avoids 'item.commit()'
* Added an extra patch which cleans up this pattern in 'Summary.js'


Erik Fastermann (2):
  ui: dc summary: update node grid fields in a single set() call
  fix #7794: ui: dc summary: add per-node VM/CT count columns

 www/manager6/dc/NodeView.js | 26 ++++++++++++++++++
 www/manager6/dc/Summary.js  | 55 ++++++++++++++++++++++++++++++++++---
 2 files changed, 77 insertions(+), 4 deletions(-)

-- 
2.47.3




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH pve-manager v2 1/2] ui: dc summary: update node grid fields in a single set() call
  2026-07-28  7:51 [PATCH pve-manager v2 0/2] fix #7794: ui: dc summary: add per-node VM/CT count columns Erik Fastermann
@ 2026-07-28  7:51 ` Erik Fastermann
  2026-07-28  7:51 ` [PATCH pve-manager v2 2/2] fix #7794: ui: dc summary: add per-node VM/CT count columns Erik Fastermann
  1 sibling, 0 replies; 3+ messages in thread
From: Erik Fastermann @ 2026-07-28  7:51 UTC (permalink / raw)
  To: pve-devel; +Cc: Erik Fastermann

Each set() call fires its own update event, so the grid redrew the row
once per field. Passing all fields as an object fires a single event
instead.

The commit() call only served to clear the dirty flag, which the
documented dirty option does directly, without emitting another update
event per row.

This is a refactor and should have no user-visible effect.

Signed-off-by: Erik Fastermann <e.fastermann@proxmox.com>
---
 www/manager6/dc/Summary.js | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/www/manager6/dc/Summary.js b/www/manager6/dc/Summary.js
index bf7e99c6..cd4749be 100644
--- a/www/manager6/dc/Summary.js
+++ b/www/manager6/dc/Summary.js
@@ -164,12 +164,16 @@ Ext.define('PVE.dc.Summary', {
 
                         if (gridstore.getById(data.id)) {
                             let griditem = gridstore.getById(data.id);
-                            griditem.set('cpuusage', data.cpu);
                             let max = data.maxmem || 1;
                             let val = data.mem || 0;
-                            griditem.set('memoryusage', val / max);
-                            griditem.set('uptime', data.uptime);
-                            griditem.commit(); // else the store marks the field as dirty
+                            griditem.set(
+                                {
+                                    cpuusage: data.cpu,
+                                    memoryusage: val / max,
+                                    uptime: data.uptime,
+                                },
+                                { dirty: false },
+                            );
                         }
                         break;
                     case 'storage': {
-- 
2.47.3




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH pve-manager v2 2/2] fix #7794: ui: dc summary: add per-node VM/CT count columns
  2026-07-28  7:51 [PATCH pve-manager v2 0/2] fix #7794: ui: dc summary: add per-node VM/CT count columns Erik Fastermann
  2026-07-28  7:51 ` [PATCH pve-manager v2 1/2] ui: dc summary: update node grid fields in a single set() call Erik Fastermann
@ 2026-07-28  7:51 ` Erik Fastermann
  1 sibling, 0 replies; 3+ messages in thread
From: Erik Fastermann @ 2026-07-28  7:51 UTC (permalink / raw)
  To: pve-devel; +Cc: Erik Fastermann

The datacenter summary aggregates VM and CT counts cluster-wide but
gives no per-node breakdown. Add columns to the node list showing the
number of running and total VMs and CTs per node, so the workload
distribution across the cluster is visible at a glance.

The running columns are shown by default, the totals are hidden and can
be enabled per profile. Templates are excluded from the totals, matching
the guest status panel that accounts for them separately.

Combined guest columns (VMs plus CTs) were suggested but left out on
purpose, as one does not gain a lot of information from them and to
avoid column clutter.

Signed-off-by: Erik Fastermann <e.fastermann@proxmox.com>
---
 www/manager6/dc/NodeView.js | 26 ++++++++++++++++++++++
 www/manager6/dc/Summary.js  | 43 +++++++++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+)

diff --git a/www/manager6/dc/NodeView.js b/www/manager6/dc/NodeView.js
index 2c9574fb..4ea76bb7 100644
--- a/www/manager6/dc/NodeView.js
+++ b/www/manager6/dc/NodeView.js
@@ -68,6 +68,32 @@ Ext.define(
                     criticalThreshold: 0.975,
                 },
             },
+            {
+                header: gettext('VMs (running)'),
+                width: 100,
+                sortable: true,
+                dataIndex: 'qemurunning',
+            },
+            {
+                header: gettext('VMs (total)'),
+                width: 100,
+                sortable: true,
+                dataIndex: 'qemutotal',
+                hidden: true,
+            },
+            {
+                header: gettext('CTs (running)'),
+                width: 100,
+                sortable: true,
+                dataIndex: 'lxcrunning',
+            },
+            {
+                header: gettext('CTs (total)'),
+                width: 100,
+                sortable: true,
+                dataIndex: 'lxctotal',
+                hidden: true,
+            },
             {
                 header: gettext('Uptime'),
                 sortable: true,
diff --git a/www/manager6/dc/Summary.js b/www/manager6/dc/Summary.js
index cd4749be..e56f6e7e 100644
--- a/www/manager6/dc/Summary.js
+++ b/www/manager6/dc/Summary.js
@@ -146,12 +146,16 @@ Ext.define('PVE.dc.Summary', {
                 stopped: 0,
                 template: 0,
             };
+            const qemuPerNodeRunning = {};
+            const qemuPerNodeTotal = {};
             let lxc = {
                 running: 0,
                 paused: 0,
                 stopped: 0,
                 template: 0,
             };
+            const lxcPerNodeRunning = {};
+            const lxcPerNodeTotal = {};
             let error = 0;
 
             for (const { data } of results) {
@@ -198,12 +202,36 @@ Ext.define('PVE.dc.Summary', {
                     }
                     case 'qemu':
                         qemu[data.template ? 'template' : data.status]++;
+
+                        if (!(data.node in qemuPerNodeTotal)) {
+                            qemuPerNodeRunning[data.node] = 0;
+                            qemuPerNodeTotal[data.node] = 0;
+                        }
+                        if (data.status === 'running') {
+                            qemuPerNodeRunning[data.node] += 1;
+                        }
+                        if (!data.template) {
+                            qemuPerNodeTotal[data.node] += 1;
+                        }
+
                         if (data.hastate === 'error') {
                             error++;
                         }
                         break;
                     case 'lxc':
                         lxc[data.template ? 'template' : data.status]++;
+
+                        if (!(data.node in lxcPerNodeTotal)) {
+                            lxcPerNodeRunning[data.node] = 0;
+                            lxcPerNodeTotal[data.node] = 0;
+                        }
+                        if (data.status === 'running') {
+                            lxcPerNodeRunning[data.node] += 1;
+                        }
+                        if (!data.template) {
+                            lxcPerNodeTotal[data.node] += 1;
+                        }
+
                         if (data.hastate === 'error') {
                             error++;
                         }
@@ -232,6 +260,21 @@ Ext.define('PVE.dc.Summary', {
 
             gueststatus.updateValues(qemu, lxc, error);
 
+            gridstore.beginUpdate();
+            gridstore.each((item) => {
+                const node = item.getId().replace(/^node\//, '');
+                item.set(
+                    {
+                        qemurunning: qemuPerNodeRunning[node] ?? 0,
+                        qemutotal: qemuPerNodeTotal[node] ?? 0,
+                        lxcrunning: lxcPerNodeRunning[node] ?? 0,
+                        lxctotal: lxcPerNodeTotal[node] ?? 0,
+                    },
+                    { dirty: false },
+                );
+            });
+            gridstore.endUpdate();
+
             me.suspendLayout = false;
             me.updateLayout(true);
         });
-- 
2.47.3




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-28  7:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-28  7:51 [PATCH pve-manager v2 0/2] fix #7794: ui: dc summary: add per-node VM/CT count columns Erik Fastermann
2026-07-28  7:51 ` [PATCH pve-manager v2 1/2] ui: dc summary: update node grid fields in a single set() call Erik Fastermann
2026-07-28  7:51 ` [PATCH pve-manager v2 2/2] fix #7794: ui: dc summary: add per-node VM/CT count columns Erik Fastermann

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