mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 07:16:01 +00:00
redis: dont show all keys in tree (show more...)
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
<script lang="ts">
|
||||
import AppObjectCore from '../appobj/AppObjectCore.svelte';
|
||||
|
||||
const SHOW_INCREMENT = 500;
|
||||
|
||||
import { useDatabaseKeys } from '../utility/metadataLoaders';
|
||||
import DbKeysTreeNode from './DbKeysTreeNode.svelte';
|
||||
|
||||
@@ -8,9 +12,23 @@
|
||||
export let root;
|
||||
export let indentLevel = 0;
|
||||
|
||||
let maxShowCount = SHOW_INCREMENT;
|
||||
|
||||
$: items = useDatabaseKeys({ conid, database, root });
|
||||
</script>
|
||||
|
||||
{#each $items || [] as item}
|
||||
{#each ($items || []).slice(0, maxShowCount) as item}
|
||||
<DbKeysTreeNode {conid} {database} {root} {item} {indentLevel} />
|
||||
{/each}
|
||||
|
||||
{#if ($items || []).length > maxShowCount}
|
||||
<AppObjectCore
|
||||
{indentLevel}
|
||||
title="Show more..."
|
||||
icon="icon dots-horizontal"
|
||||
expandIcon="icon invisible-box"
|
||||
on:click={() => {
|
||||
maxShowCount += SHOW_INCREMENT;
|
||||
}}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user