feat(redis): support per-database alias in the Redis viewer tree

This commit is contained in:
Matt Van Horn
2026-06-21 00:33:03 -07:00
parent e7b8e78f9c
commit 4408bce159
12 changed files with 373 additions and 11 deletions

View File

@@ -169,7 +169,13 @@ export const useSidebarV2ContextMenu = ({
return count > 0 ? count.toLocaleString() : '';
}
if (node.type === 'redis-db') {
const match = String(node.title || '').match(/\((\d+)\)/);
const keyCount = Number(node?.dataRef?.redisKeyCount);
if (Number.isFinite(keyCount) && keyCount > 0) {
return keyCount.toLocaleString();
}
// Fallback for nodes built before redisKeyCount was tracked; avoid
// matching an alias by only reading a trailing count suffix.
const match = String(node.title || '').match(/\((\d+)\)\s*$/);
return match?.[1] || '';
}
if (node.type === 'table') {