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:
1 parent
9589d07baf
commit
7b5a4e6c2c
49 files changed
+872
-726
No files matched your search
@@ -1,11 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte'
|
||||
import { get } from '$lib/api'
|
||||
import EmptyState from '$lib/components/EmptyState.svelte'
|
||||
import SectionTitle from '$lib/components/SectionTitle.svelte'
|
||||
import Badge from '$lib/components/ui/badge.svelte'
|
||||
import Button from '$lib/components/ui/button.svelte'
|
||||
import Card from '$lib/components/ui/card.svelte'
|
||||
import { Badge, Button, Card, EmptyState, SectionTitle } from '@gabriel20xx/web-ui'
|
||||
|
||||
type Json = Record<string, unknown>
|
||||
type MediaType = 'image' | 'video' | 'audio' | 'funscript'
|
||||
@@ -63,14 +59,14 @@
|
||||
return fallback
|
||||
}
|
||||
|
||||
function statusTone(status: string): 'neutral' | 'primary' | 'success' | 'warning' | 'danger' {
|
||||
function statusTone(status: string): 'default' | 'primary' | 'success' | 'warning' | 'danger' {
|
||||
const normalized = status.toLowerCase()
|
||||
if (normalized.includes('error') || normalized.includes('fail')) return 'danger'
|
||||
if (normalized.includes('process') || normalized.includes('running')) return 'primary'
|
||||
if (normalized.includes('queue') || normalized.includes('pending')) return 'warning'
|
||||
if (normalized.includes('done') || normalized.includes('complete') || normalized.includes('success'))
|
||||
return 'success'
|
||||
return 'neutral'
|
||||
return 'default'
|
||||
}
|
||||
|
||||
async function load({ background = false } = {}) {
|
||||
@@ -183,7 +179,7 @@
|
||||
<p class="truncate text-sm font-medium text-fg">{name}</p>
|
||||
{#if path}<p class="mt-1 truncate text-xs text-muted-fg">{path}</p>{/if}
|
||||
</div>
|
||||
<Badge tone={statusTone(status)}>{status}</Badge>
|
||||
<Badge variant={statusTone(status)}>{status}</Badge>
|
||||
</div>
|
||||
<div class="mt-2 flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-fg">
|
||||
{#if entryMediaType}<span>{entryMediaType}</span>{/if}
|
||||
|
||||
Reference in new issue
Block a user