mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
redis key tree
This commit is contained in:
parent
51942be0a6
commit
5eba93559d
@ -1,16 +1,15 @@
|
||||
<script lang="ts">
|
||||
import { useDatabaseKeys } from '../utility/metadataLoaders';
|
||||
import DbKeysTreeNode from './DbKeysTreeNode.svelte';
|
||||
|
||||
export let conid;
|
||||
export let database;
|
||||
|
||||
export let root;
|
||||
|
||||
$: keys = useDatabaseKeys({ conid, database, root });
|
||||
$: items = useDatabaseKeys({ conid, database, root });
|
||||
</script>
|
||||
|
||||
{#each $keys || [] as key}
|
||||
<div>
|
||||
{key.text}
|
||||
</div>
|
||||
{#each $items || [] as item}
|
||||
<DbKeysTreeNode {conid} {database} {root} {item} />
|
||||
{/each}
|
||||
|
20
packages/web/src/widgets/DbKeysTreeNode.svelte
Normal file
20
packages/web/src/widgets/DbKeysTreeNode.svelte
Normal file
@ -0,0 +1,20 @@
|
||||
<script lang="ts">
|
||||
import DbKeysSubTree from './DbKeysSubTree.svelte';
|
||||
|
||||
export let conid;
|
||||
export let database;
|
||||
|
||||
export let root;
|
||||
|
||||
export let item;
|
||||
|
||||
let isExpanded;
|
||||
</script>
|
||||
|
||||
<div on:click={() => (isExpanded = !isExpanded)}>
|
||||
{item.text}
|
||||
</div>
|
||||
|
||||
{#if isExpanded}
|
||||
<DbKeysSubTree {conid} {database} root={item.root} />
|
||||
{/if}
|
@ -102,6 +102,7 @@ const driver = {
|
||||
res[keySplit[rootSplit.length]] = {
|
||||
text: keySplit[rootSplit.length],
|
||||
type: 'dir',
|
||||
root: keySplit.slice(0, rootSplit.length + 1).join(':'),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user