redis key navigation

This commit is contained in:
SPRINX0\prochazka
2025-01-22 17:13:33 +01:00
parent 41e5089ab3
commit 4ea718b662
5 changed files with 62 additions and 7 deletions

View File

@@ -175,3 +175,23 @@ export function dbKeys_reloadFolder(tree: DbKeysTreeModel, root: string): DbKeys
},
};
}
function addFlatItems(tree: DbKeysTreeModel, root: string, res: DbKeysNodeModel[]) {
const item = tree.dirsByKey[root];
if (!item.isExpanded) {
return false;
}
const children = tree.childrenByKey[root] || [];
for (const child of children) {
res.push(child);
if (child.type == 'dir') {
addFlatItems(tree, child.root, res);
}
}
}
export function dbKeys_getFlatList(tree: DbKeysTreeModel) {
const res: DbKeysNodeModel[] = [];
addFlatItems(tree, '', res);
return res;
}