ui: tape/BackupOverview: show namespaces as their own level above groups

since the namespaces are in the snapshot path we get here, we must parse
them out, else we confuse the first namespace with the group.

for now, show all namespaces on the same level (so not nested), and
do not allow for preselecting a namespace for restoring

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak
2022-05-12 16:23:26 +02:00
parent e49bd1e98f
commit 1e37156a6b
2 changed files with 38 additions and 7 deletions

View File

@ -338,9 +338,13 @@ Ext.define('PBS.Utils', {
if (!snapshot) {
return [undefined, undefined, undefined];
}
let [_match, type, group, id] = /^([^/]+)\/([^/]+)\/(.+)$/.exec(snapshot);
let nsRegex = /(?:^|\/)(ns\/([^/]+))/g;
let namespaces = [];
let nsPaths = [];
snapshot = snapshot.replace(nsRegex, (_, nsPath, ns) => { nsPaths.push(nsPath); namespaces.push(ns); return ""; });
let [_match, type, group, id] = /^\/?([^/]+)\/([^/]+)\/(.+)$/.exec(snapshot);
return [type, group, id];
return [type, group, id, namespaces.join('/'), nsPaths.join('/')];
},
get_type_icon_cls: function(btype) {