From 493746b14c1251a45b061d2e3edd9160c929d2b9 Mon Sep 17 00:00:00 2001 From: benj Date: Fri, 10 Apr 2026 11:13:34 +0800 Subject: a basic ui and landing web interface for tidyindex.com --- web/ui/src/routes/dashboard/+layout.server.ts | 12 ++ web/ui/src/routes/dashboard/+layout.svelte | 90 ++++++++ web/ui/src/routes/dashboard/+page.server.ts | 7 + .../src/routes/dashboard/account/+page.server.ts | 107 +++++++++ web/ui/src/routes/dashboard/account/+page.svelte | 238 +++++++++++++++++++++ web/ui/src/routes/dashboard/keys/+page.server.ts | 68 ++++++ web/ui/src/routes/dashboard/keys/+page.svelte | 220 +++++++++++++++++++ web/ui/src/routes/dashboard/usage/+page.server.ts | 13 ++ web/ui/src/routes/dashboard/usage/+page.svelte | 152 +++++++++++++ 9 files changed, 907 insertions(+) create mode 100644 web/ui/src/routes/dashboard/+layout.server.ts create mode 100644 web/ui/src/routes/dashboard/+layout.svelte create mode 100644 web/ui/src/routes/dashboard/+page.server.ts create mode 100644 web/ui/src/routes/dashboard/account/+page.server.ts create mode 100644 web/ui/src/routes/dashboard/account/+page.svelte create mode 100644 web/ui/src/routes/dashboard/keys/+page.server.ts create mode 100644 web/ui/src/routes/dashboard/keys/+page.svelte create mode 100644 web/ui/src/routes/dashboard/usage/+page.server.ts create mode 100644 web/ui/src/routes/dashboard/usage/+page.svelte (limited to 'web/ui/src/routes/dashboard') diff --git a/web/ui/src/routes/dashboard/+layout.server.ts b/web/ui/src/routes/dashboard/+layout.server.ts new file mode 100644 index 0000000..8eebc76 --- /dev/null +++ b/web/ui/src/routes/dashboard/+layout.server.ts @@ -0,0 +1,12 @@ +import { redirect } from '@sveltejs/kit'; + +import type { LayoutServerLoad } from './$types'; + +export const load: LayoutServerLoad = async ({ locals }) => { + if (!locals.account) { + throw redirect(303, '/'); + } + return { + account: locals.account + }; +}; diff --git a/web/ui/src/routes/dashboard/+layout.svelte b/web/ui/src/routes/dashboard/+layout.svelte new file mode 100644 index 0000000..9137c75 --- /dev/null +++ b/web/ui/src/routes/dashboard/+layout.svelte @@ -0,0 +1,90 @@ + + + + Tidy Index — Dashboard + + +
+
+ + + Tidy Index + + +
+ + plan: {planInfo.name.toLowerCase()} + + {#if account?.email} + {account.email} + {:else if account?.pending_email} + + pending · {account.pending_email} + + {:else} + anonymous + {/if} +
+
+
+ +
+ {#if !account?.email && !account?.pending_email} + + {:else if account?.pending_email && !account?.email} + + {/if} + + +
+ +
+
+ {@render children()} +
+
+ +