add an empty state for target list

This commit is contained in:
Eugene 2025-05-23 21:32:01 +02:00
parent 45334014b6
commit cadccb932b
No known key found for this signature in database
GPG key ID: 5896FCBBDD1CF4F4
2 changed files with 12 additions and 6 deletions

View file

@ -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}

View file

@ -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"