[pbs-devel] [PATCH proxmox-backup 1/2] ui: tape/BackupOverview: add sublevel for groups

Dominik Csapak d.csapak at proxmox.com
Mon Mar 1 14:10:31 CET 2021


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 <d.csapak at proxmox.com>
---
 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)) {
-- 
2.20.1






More information about the pbs-devel mailing list