mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 10:46:00 +00:00
redis key navigation
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user