From d938c9337a19b3721a77fcb3c4dde940283b077a Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Mon, 1 Mar 2021 14:10:31 +0100 Subject: [PATCH] ui: tape/BackupOverview: add sublevel for groups For tapes with many snapshots/group, a simple list of them is too big. Instead, add a level for just the groups, this makes searching for a specific backup much easier. Signed-off-by: Dominik Csapak --- www/tape/BackupOverview.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/www/tape/BackupOverview.js b/www/tape/BackupOverview.js index 4b4c02ff..c3f30b58 100644 --- a/www/tape/BackupOverview.js +++ b/www/tape/BackupOverview.js @@ -151,7 +151,20 @@ Ext.define('PBS.TapeManagement.BackupOverview', { children: [], }; } - tapes[tape].children.push(entry); + let [type, group, _id] = PBS.Utils.parse_snapshot_id(entry.snapshot); + + let children = tapes[tape].children; + let text = `${type}/${group}`; + if (children.length < 1 || children[children.length - 1].text !== text) { + children.push({ + text, + 'media-set-uuid': entry['media-set-uuid'], + leaf: false, + iconCls: `fa ${iconCls}`, + children: [], + }); + } + children[children.length - 1].children.push(entry); } for (const tape of Object.values(tapes)) {