mirror of
https://github.com/warp-tech/warpgate.git
synced 2025-09-06 22:55:24 +08:00
add an empty state for target list
This commit is contained in:
parent
45334014b6
commit
cadccb932b
2 changed files with 12 additions and 6 deletions
|
@ -94,15 +94,16 @@
|
|||
})
|
||||
</script>
|
||||
|
||||
<div class="d-flex mb-2" hidden={!loaded}>
|
||||
{#if showSearch}
|
||||
<Input bind:value={filter} placeholder="Search..." class="flex-grow-1 border-0" />
|
||||
{/if}
|
||||
{@render header?.()}
|
||||
</div>
|
||||
{#await $items}
|
||||
<DelayedSpinner />
|
||||
{:then _items}
|
||||
<div class="d-flex mb-2" hidden={!loaded}>
|
||||
<!-- either filtering or not filtering and there are at least some items at all -->
|
||||
{#if showSearch && (filter || !!_items?.length)}
|
||||
<Input bind:value={filter} placeholder="Search..." class="flex-grow-1 border-0" />
|
||||
{/if}
|
||||
{@render header?.()}
|
||||
</div>
|
||||
{#if _items}
|
||||
<div class="list-group list-group-flush mb-3">
|
||||
{#each _items as _item}
|
||||
|
|
|
@ -10,6 +10,7 @@ import { serverInfo } from './lib/store'
|
|||
import { firstBy } from 'thenby'
|
||||
import ModalHeader from 'common/sveltestrap-s5-ports/ModalHeader.svelte'
|
||||
import GettingStarted from 'common/GettingStarted.svelte'
|
||||
import EmptyState from 'common/EmptyState.svelte';
|
||||
|
||||
let selectedTarget: TargetSnapshot|undefined = $state()
|
||||
|
||||
|
@ -51,6 +52,10 @@ function loadURL (url: string) {
|
|||
{/if}
|
||||
|
||||
<ItemList load={loadTargets} showSearch={true}>
|
||||
{#snippet empty()}
|
||||
<EmptyState
|
||||
title="You don't have access to any targets yet" />
|
||||
{/snippet}
|
||||
{#snippet item(target)}
|
||||
<a
|
||||
class="list-group-item list-group-item-action target-item"
|
||||
|
|
Loading…
Add table
Reference in a new issue