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,14 +1,8 @@
|
||||
<script lang="ts">
|
||||
import { BarChart3, Check, Pencil, ShieldCheck, Trash2, UserCheck, Users } from '@lucide/svelte'
|
||||
import { onMount } from 'svelte'
|
||||
import { notify } from '@gabriel20xx/web-ui'
|
||||
import { Badge, Button, Card, EmptyState, Metric, notify, SectionTitle } from '@gabriel20xx/web-ui'
|
||||
import { get, post, put } from '$lib/api'
|
||||
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'
|
||||
|
||||
interface UserRow {
|
||||
id: string | number
|
||||
@@ -183,11 +177,11 @@
|
||||
<Metric label="Users" value={users.length} detail="Loaded from admin catalog" /><Metric
|
||||
label="Active users"
|
||||
value={users.filter((user) => !user.disabled).length}
|
||||
tone="success"
|
||||
variant="success"
|
||||
/><Metric label="Media records" value={media.length} detail="Catalog window" /><Metric
|
||||
label="Flagged / inactive"
|
||||
value={media.filter((item) => item.active === false).length}
|
||||
tone="warning"
|
||||
variant="warning"
|
||||
/>
|
||||
</div>
|
||||
<div class="grid gap-4 lg:grid-cols-2">
|
||||
@@ -231,7 +225,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2 border-y border-border py-3">
|
||||
<Badge tone="primary">{selectedUsers.length} selected</Badge><Button
|
||||
<Badge variant="primary">{selectedUsers.length} selected</Badge><Button
|
||||
size="sm"
|
||||
variant="secondary"
|
||||
disabled={!selectedUsers.length}
|
||||
@@ -329,11 +323,11 @@
|
||||
><p class="text-sm font-medium text-fg">{user.username || user.email || `User ${user.id}`}</p>
|
||||
<p class="mt-1 text-xs text-muted-fg">{user.email || 'No email'}</p></td
|
||||
><td class="py-3"
|
||||
><Badge tone={user.role === 'admin' || user.role === 'superadmin' ? 'primary' : 'neutral'}
|
||||
><Badge variant={user.role === 'admin' || user.role === 'superadmin' ? 'primary' : 'default'}
|
||||
>{user.role || 'user'}</Badge
|
||||
></td
|
||||
><td class="py-3"
|
||||
><Badge tone={user.disabled ? 'danger' : 'success'}>{user.disabled ? 'Disabled' : 'Active'}</Badge
|
||||
><Badge variant={user.disabled ? 'danger' : 'success'}>{user.disabled ? 'Disabled' : 'Active'}</Badge
|
||||
></td
|
||||
><td class="py-3 text-xs text-muted-fg">{user.mfaEnabled ? 'MFA enabled' : 'MFA not enabled'}</td><td
|
||||
class="py-3 text-right"
|
||||
@@ -445,7 +439,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2 border-y border-border py-3">
|
||||
<Badge tone="primary">{selectedMedia.length} selected</Badge><Button
|
||||
<Badge variant="primary">{selectedMedia.length} selected</Badge><Button
|
||||
size="sm"
|
||||
variant="secondary"
|
||||
disabled={!selectedMedia.length}
|
||||
@@ -489,7 +483,7 @@
|
||||
><td class="py-3 text-xs text-muted-fg">{item.source || '—'}</td><td
|
||||
class="py-3 text-xs text-muted-fg">{item.generatorUsername || '—'}</td
|
||||
><td class="py-3"
|
||||
><Badge tone={item.active === false ? 'danger' : 'success'}
|
||||
><Badge variant={item.active === false ? 'danger' : 'success'}
|
||||
>{item.active === false ? 'Hidden' : 'Visible'}</Badge
|
||||
></td
|
||||
></tr
|
||||
|
||||
Reference in new issue
Block a user