diff --git a/web/src/lib/components/PanelEditor.svelte b/web/src/lib/components/PanelEditor.svelte new file mode 100644 index 0000000..f64e6c9 --- /dev/null +++ b/web/src/lib/components/PanelEditor.svelte @@ -0,0 +1,310 @@ + + + +
+ + + + + + {#if vizType === 'line' || vizType === 'bar'} +
+ vizConfig.x_column ?? '', (v) => setConfig('x_column', v)} /> + vizConfig.value_column ?? '', (v) => setConfig('value_column', v)} + /> + vizConfig.series_column ?? '', (v) => setConfig('series_column', v)} + /> +
+ {#if vizType === 'bar'} + + {/if} + {:else if vizType === 'top_n'} +
+ vizConfig.label_column ?? '', (v) => setConfig('label_column', v)} /> + vizConfig.value_column ?? '', (v) => setConfig('value_column', v)} + /> +
+ {:else if vizType === 'heatmap'} +
+ vizConfig.x_column ?? '', (v) => setConfig('x_column', v)} /> + vizConfig.y_column ?? '', (v) => setConfig('y_column', v)} /> + vizConfig.value_column ?? '', (v) => setConfig('value_column', v)} + /> +
+ {:else if vizType === 'single_stat'} +
+ vizConfig.value_column ?? '', (v) => setConfig('value_column', v)} + /> + vizConfig.unit ?? '', (v) => setConfig('unit', v)} /> +
+ + {/if} + +
+ + +
+ + + + + + + + {#if saveError}

{saveError}

{/if} +
+ + {#snippet footer()} + + + {/snippet} +
+ + diff --git a/web/src/routes/dashboards/+page.svelte b/web/src/routes/dashboards/+page.svelte index e89f6b0..11cc83f 100644 --- a/web/src/routes/dashboards/+page.svelte +++ b/web/src/routes/dashboards/+page.svelte @@ -6,6 +6,7 @@ importDashboard, type Dashboard } from '$lib/api'; + import { Button, Input, EmptyState, Skeleton } from '$lib/components/ui'; let dashboards = $state([]); let loading = $state(true); @@ -65,12 +66,12 @@ {#if error}

Error: {error}

{/if}
- e.key === 'Enter' && create()} + onkeydown={(e: KeyboardEvent) => e.key === 'Enter' && create()} /> - +
{#if loading} -

Loading…

+
+ {#each Array(3) as _, i (i)} + + {/each} +
{:else if dashboards.length === 0} -

No dashboards yet.

+ {:else}