feat: port full CRUD API routes and frontend pages from Immich Watcher

Backend API (38 routes):
- providers: full CRUD + test connection + list collections + API key masking
- trackers: full CRUD + trigger + history + test-periodic/memory
- tracking-configs: full CRUD with Pydantic models, provider_type filter
- template-configs: full CRUD + preview + preview-raw with two-pass validation
- targets: full CRUD + test notification + config masking
- telegram-bots: full CRUD + chat discovery + token endpoint
- users: full admin CRUD + password reset + self-delete protection
- status: dashboard endpoint with providers/trackers/targets/events counts

Frontend pages updated:
- Dashboard with animated stat cards and event timeline
- Providers with proper components, delete confirm, snackbar
- Trackers/targets/tracking-configs/template-configs/telegram-bots/users
  all use PageHeader, Card, Loading, MdiIcon with correct i18n keys

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-20 00:49:40 +03:00
parent c9cab93d12
commit 9eec21a5b2
17 changed files with 1596 additions and 244 deletions
+45 -6
View File
@@ -1,8 +1,47 @@
<script>
import { t } from '$lib/i18n/index.svelte.ts';
<script lang="ts">
import { onMount } from 'svelte';
import { api } from '$lib/api';
import { t } from '$lib/i18n';
import PageHeader from '$lib/components/PageHeader.svelte';
import Card from '$lib/components/Card.svelte';
import Loading from '$lib/components/Loading.svelte';
import MdiIcon from '$lib/components/MdiIcon.svelte';
let users = $state<any[]>([]);
let loaded = $state(false);
onMount(async () => {
try { users = await api('/users'); } catch {}
loaded = true;
});
</script>
<div class="p-6 max-w-5xl mx-auto">
<h1 class="text-2xl font-bold mb-6">{t('nav.users')}</h1>
<p class="text-muted-foreground">User management — coming soon.</p>
</div>
<PageHeader title={t('users.title')} description={t('users.description')} />
{#if !loaded}
<Loading />
{:else if users.length === 0}
<Card>
<div class="flex flex-col items-center py-8 gap-3" style="color: var(--color-muted-foreground);">
<div style="opacity: 0.4;"><MdiIcon name="mdiAccountGroup" size={40} /></div>
<p class="text-sm">No users found.</p>
</div>
</Card>
{:else}
<div class="grid gap-4 sm:grid-cols-2 stagger-children">
{#each users as user}
<Card hover>
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-full flex items-center justify-center text-sm font-semibold"
style="background: var(--color-primary); color: var(--color-primary-foreground);">
{user.username[0].toUpperCase()}
</div>
<div>
<h3 class="font-medium text-sm">{user.username}</h3>
<p class="text-xs uppercase tracking-wide" style="color: var(--color-muted-foreground);">{user.role}</p>
</div>
</div>
</Card>
{/each}
</div>
{/if}