all repos — weimar @ 5db53247ca8f51a93742f179a706db67e463b6b7

Unnamed repository; edit this file 'description' to name the repository.

web/src/routes/+page.svelte (view raw)

 1<script lang="ts">
 2	import { onMount } from 'svelte';
 3
 4	let status = $state('Checking...');
 5
 6	onMount(async () => {
 7		try {
 8			const res = await fetch('/api/health');
 9			const data = await res.json();
10			status = data.status === 'ok' ? 'Server is running' : `Status: ${data.status}`;
11		} catch {
12			status = 'Server unreachable';
13		}
14	});
15</script>
16
17<h1>weimar</h1>
18<p>{status}</p>
19
20<div class="actions">
21	<a href="/browse">Browse images</a>
22	<a href="/upload">Upload image</a>
23</div>
24
25<style>
26	h1 {
27		font-size: 3rem;
28		margin-bottom: 0.5rem;
29	}
30	.actions {
31		margin-top: 2rem;
32		display: flex;
33		gap: 1rem;
34	}
35	.actions a {
36		padding: 0.5rem 1.5rem;
37		background: #1a1a2e;
38		color: #eee;
39		text-decoration: none;
40		border-radius: 6px;
41	}
42	.actions a:hover {
43		background: #16213e;
44	}
45</style>