public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH manager] fix #7684: ui: backup job detail: allow sorting guests by inclusion status
@ 2026-10-04 17:35 Michal Fox
  0 siblings, 0 replies; only message in thread
From: Michal Fox @ 2026-10-04 17:35 UTC (permalink / raw)
  To: pve-devel

The 'Backup Job' column of the job detail tree only has a value for the
volumes, not for the guests. So sorting by it only sorted the volumes
within each guest, while the guests themselves stayed in their order,
which made it look like sorting by that column did nothing.

Set the share of included volumes on the guests too, and show it as
'Yes' if all, 'No' if none and 'Mixed' if only some of the volumes of
a guest are included. This way, guests with excluded volumes end up at
the top or bottom of the list when sorting by that column.

Signed-off-by: Michal Fox <me@dualfroz.com>
---
Tested in the browser with the job detail tree and a mocked API
response: sorting by the column now orders the guests by No, Mixed and
Yes and back, and the volumes are still sorted within each guest.

 www/manager6/dc/BackupJobDetail.js | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/www/manager6/dc/BackupJobDetail.js b/www/manager6/dc/BackupJobDetail.js
index bdd39385..859064ae 100644
--- a/www/manager6/dc/BackupJobDetail.js
+++ b/www/manager6/dc/BackupJobDetail.js
@@ -50,7 +50,13 @@ Ext.define('PVE.dc.BackupDiskTree', {
         },
         {
             text: gettext('Backup Job'),
-            renderer: PVE.Utils.render_backup_status,
+            renderer: function (value, meta, record) {
+                if (value > 0 && value < 1) {
+                    // guest level with only some of its volumes included
+                    return `<i class="fa fa-adjust warning"></i> ${gettext('Mixed')}`;
+                }
+                return PVE.Utils.render_backup_status(value, meta, record);
+            },
             dataIndex: 'included',
             flex: 3,
         },
@@ -68,8 +74,16 @@ Ext.define('PVE.dc.BackupDiskTree', {
                 Proxmox.Utils.setErrorMask(me, response.htmlStatus);
             },
             success: function (response, opts) {
+                let root = response.result.data;
+                // set the share of included volumes on the guests too, so they can be sorted by it
+                for (const guest of root.children) {
+                    if (guest.children?.length) {
+                        let included = guest.children.filter((volume) => volume.included).length;
+                        guest.included = included / guest.children.length;
+                    }
+                }
                 sm.deselectAll();
-                me.setRootNode(response.result.data);
+                me.setRootNode(root);
                 me.expandAll();
             },
         });
-- 
2.43.0




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-04 17:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-04 17:35 [PATCH manager] fix #7684: ui: backup job detail: allow sorting guests by inclusion status Michal Fox

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