From eb9893f3785dff5fee077d2c68ceba81a6c21afe Mon Sep 17 00:00:00 2001 From: Michal Fox Date: Sat, 3 Oct 2026 01:18:09 +0200 Subject: [PATCH] fix #7684: ui: backup job detail: allow sorting guests by inclusion status 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 --- 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 bdd3938..859064a 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 ` ${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(); }, });