Merge media-webui/media-backend into the general shared component/backend system

Extracts a new backend/authproxy package for the AuthGuard-proxy helper
functions (session cookie handling, input normalization, error
translation) that Bitmagnet/GameStream/media-backend/AutoCode/
CollabTable/PubliSafe/SimpleCollection/SyncServer/UnraidMonitor/
OutdoorGames were each independently reimplementing, and repoints all
of them onto it.

Extends packages/web-ui's Button/Badge with the variants media-webui
needed (outline, icon size, primary badge) and promotes EmptyState/
SectionTitle/Metric/StatusWidget/StatusDialog into the shared library,
then migrates media-webui off its own diverged ui/{button,card,badge,
metric} components and local duplicates of the promoted components
onto @gabriel20xx/web-ui, so media-webui is a proper consumer of the
same design system every other project already uses instead of a
parallel fork.

Also removes the dead `desktop`/MediaDesktop service variant from
media-backend and media-webui (MediaDesktop is an Electron client that
never actually runs this stack).
This commit is contained in:
Gabriel20xx committed 2026-09-03 00:14:01 +02:00
1 parent 9589d07baf
commit 7b5a4e6c2c
49 files changed
+872 -726

No files matched your search

@@ -2,17 +2,11 @@
import { AlertTriangle, Play, Plus, RefreshCw, Trash2 } from '@lucide/svelte'
import { onMount } from 'svelte'
import { SvelteSet } from 'svelte/reactivity'
import { notify } from '@gabriel20xx/web-ui'
import { Badge, Button, Card, EmptyState, Metric, notify, SectionTitle } from '@gabriel20xx/web-ui'
import { del, get, post } from '$lib/api'
import AnalyzerHistory from '$lib/components/AnalyzerHistory.svelte'
import AnalyzerLiveStatus from '$lib/components/AnalyzerLiveStatus.svelte'
import AnalyzerPipelineBreakdown from '$lib/components/AnalyzerPipelineBreakdown.svelte'
import SectionTitle from '$lib/components/SectionTitle.svelte'
import Card from '$lib/components/ui/card.svelte'
import Button from '$lib/components/ui/button.svelte'
import Badge from '$lib/components/ui/badge.svelte'
import Metric from '$lib/components/ui/metric.svelte'
import EmptyState from '$lib/components/EmptyState.svelte'
import { cn } from '$lib/utils/cn'
type Json = Record<string, unknown>
@@ -407,18 +401,18 @@
label="Pending"
value={numeric('queued', numeric('queueLength'))}
detail="Waiting for a worker"
tone="warning"
variant="warning"
/><Metric
label="Processing"
value={numeric('processing', numeric('activeJobs'))}
detail="Active jobs"
tone="primary"
variant="primary"
/><Metric
label="Completed"
value={numeric('completed', numeric('processed'))}
detail="Current history window"
tone="success"
/><Metric label="Errors" value={numeric('errors', numeric('failed'))} detail="Needs attention" tone="danger" />
variant="success"
/><Metric label="Errors" value={numeric('errors', numeric('failed'))} detail="Needs attention" variant="danger" />
</div>
<AnalyzerPipelineBreakdown pipeline={asRecord(stats.pipeline)} />
<div class="grid gap-4 lg:grid-cols-[minmax(0,1.25fr)_minmax(280px,.75fr)]">
@@ -476,18 +470,18 @@
label="Pending"
value={numeric('queued', numeric('queueLength'))}
detail="Waiting for a worker"
tone="warning"
variant="warning"
/><Metric
label="Processing"
value={numeric('processing', numeric('activeJobs'))}
detail="Active jobs"
tone="primary"
variant="primary"
/><Metric
label="Completed"
value={numeric('completed', numeric('processed'))}
detail="Current history window"
tone="success"
/><Metric label="Errors" value={numeric('errors', numeric('failed'))} detail="Needs attention" tone="danger" />
variant="success"
/><Metric label="Errors" value={numeric('errors', numeric('failed'))} detail="Needs attention" variant="danger" />
</div>
<AnalyzerLiveStatus {status} {stats} {loading} description="Current analyzer schedule and worker state." />
<Card class="space-y-5"
@@ -567,7 +561,7 @@
</p>{/if}
</div>
<div class="flex shrink-0 items-center gap-2">
<Badge tone={schedule.enabled === false ? 'neutral' : 'success'}
<Badge variant={schedule.enabled === false ? 'default' : 'success'}
>{schedule.enabled === false ? 'Paused' : 'Enabled'}</Badge
><Button variant="outline" size="sm" onclick={() => void runScheduleNow(String(schedule.id))}
>Run now</Button