redis: reload keys

This commit is contained in:
Jan Prochazka
2022-03-24 18:32:17 +01:00
parent 613ac3f0e5
commit 735c48902f
4 changed files with 47 additions and 29 deletions

View File

@@ -1,5 +1,7 @@
<script lang="ts">
import AppObjectCore from '../appobj/AppObjectCore.svelte';
import LoadingInfo from '../elements/LoadingInfo.svelte';
import { apiCall } from '../utility/api';
const SHOW_INCREMENT = 500;
@@ -12,23 +14,29 @@
export let root;
export let indentLevel = 0;
export let reloadToken = 0;
let maxShowCount = SHOW_INCREMENT;
$: items = useDatabaseKeys({ conid, database, root });
// $: items = useDatabaseKeys({ conid, database, root, reloadToken });
</script>
{#each ($items || []).slice(0, maxShowCount) as item}
<DbKeysTreeNode {conid} {database} {root} {item} {indentLevel} />
{/each}
{#await apiCall('database-connections/load-keys', { conid, database, root, reloadToken })}
<LoadingInfo message="Loading key list" wrapper />
{:then items}
{#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}
{#if (items || []).length > maxShowCount}
<AppObjectCore
{indentLevel}
title="Show more..."
icon="icon dots-horizontal"
expandIcon="icon invisible-box"
on:click={() => {
maxShowCount += SHOW_INCREMENT;
}}
/>
{/if}
{/await}