Add wide-page layout toggle; rename MediaAnalyzer/MediaTools/LoggingServer

Adds a new persisted "wide page" preference (theme/language-style store,
settings-dialog checkbox, main-content width override) alongside the
existing theme switcher and language selector.

Also completes three project renames throughout the shared source:
MediaAnalyzer -> ContentScanner, MediaTools -> CraftStudio, and
LoggingServer -> OmniLogger, across the Go media-backend service enum,
webui AppId/app-config/project-icons, renamed feature components, and
the sync-consumers.ps1 consumer list.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Gabriel20xxandClaude Sonnet 5 committed 2026-09-06 22:50:38 +02:00
1 parent 4cca0ddf72
commit 2e6baaa70c
33 files changed
+196 -121

No files matched your search

+2 -2
View File
@@ -8,8 +8,8 @@
"build": "vite build",
"build:all": "node scripts/build-all.mjs",
"build:viewer": "node scripts/build-all.mjs viewer",
"build:tools": "node scripts/build-all.mjs tools",
"build:analyzer": "node scripts/build-all.mjs analyzer",
"build:craftstudio": "node scripts/build-all.mjs craftstudio",
"build:contentscanner": "node scripts/build-all.mjs contentscanner",
"build:config": "node scripts/build-all.mjs config",
"build:moderator": "node scripts/build-all.mjs moderator",
"build:kiosk": "node scripts/build-all.mjs kiosk",
+2 -2
View File
@@ -1,7 +1,7 @@
{
"viewer": { "name": "MediaViewer", "icon": "play" },
"tools": { "name": "MediaTools", "icon": "wand-sparkles" },
"analyzer": { "name": "MediaAnalyzer", "icon": "scan-search" },
"craftstudio": { "name": "CraftStudio", "icon": "wand-sparkles" },
"contentscanner": { "name": "ContentScanner", "icon": "scan-search" },
"config": { "name": "ProjectConfigurator", "icon": "settings-2" },
"moderator": { "name": "MediaModerator", "icon": "shield-check" },
"kiosk": { "name": "MediaKiosk", "icon": "image" },
+2 -2
View File
@@ -6,8 +6,8 @@ const webUiDir = path.resolve(import.meta.dirname, '..')
const enginesDir = path.resolve(webUiDir, '..')
const targets = {
viewer: 'MediaViewer',
tools: 'MediaTools',
analyzer: 'MediaAnalyzer',
craftstudio: 'CraftStudio',
contentscanner: 'ContentScanner',
config: 'ProjectConfigurator',
moderator: 'MediaModerator',
kiosk: 'MediaKiosk',
+8 -8
View File
@@ -44,10 +44,10 @@ const configs: Record<AppId, AppConfig> = {
},
],
},
tools: {
id: 'tools',
name: 'MediaTools',
icon: projectIcon('tools'),
craftstudio: {
id: 'craftstudio',
name: 'CraftStudio',
icon: projectIcon('craftstudio'),
eyebrow: 'Media workflow studio',
description: 'Generate, download, convert, and schedule media jobs in one place.',
nav: [
@@ -88,10 +88,10 @@ const configs: Record<AppId, AppConfig> = {
},
],
},
analyzer: {
id: 'analyzer',
name: 'MediaAnalyzer',
icon: projectIcon('analyzer'),
contentscanner: {
id: 'contentscanner',
name: 'ContentScanner',
icon: projectIcon('contentscanner'),
eyebrow: 'Processing operations',
description: 'Monitor discovery and define per-type processing pipelines and automation queues.',
nav: [
+2 -1
View File
@@ -12,6 +12,7 @@
import { pageActions } from '$lib/stores/page-actions.svelte'
import { get, post, put } from '$lib/api'
import '$lib/language.svelte'
import { layoutState } from '$lib/layout.svelte'
import type { AppConfig, AuthState, AuthUser } from '$lib/types'
import type { Snippet } from 'svelte'
@@ -170,7 +171,7 @@
username={displayName}
/>
<main class="mx-auto w-full max-w-7xl px-4 pt-4 pb-8">
<main class={`mx-auto w-full px-4 pt-4 pb-8 ${layoutState.wide ? '' : 'max-w-7xl'}`}>
<PageHeader
title={activeNavItem?.label || app.name}
description={activeNavItem?.description || app.description}
@@ -9,7 +9,7 @@
status = {},
stats = {},
loading = false,
description = 'Current analyzer worker state.',
description = 'Current content-scanning worker state.',
}: { status?: Json; stats?: Json; loading?: boolean; description?: string } = $props()
// discovering/extracting/cleaning all share one backend scan slot (see scanCancel on the Go
@@ -2,6 +2,7 @@
import { Moon, Sun, SunMoon } from '@lucide/svelte'
import { Button, SettingsDialog as SharedSettingsDialog } from '@gabriel20xx/web-ui'
import { currentLanguage, languages, setLanguage } from '$lib/language.svelte'
import { layoutState } from '$lib/layout.svelte'
import { themeState } from '$lib/theme.svelte'
let {
@@ -67,6 +68,15 @@
{/each}
</select>
</label>
<label class="wide-row">
<span class="sc-label">Wide page</span>
<input
type="checkbox"
checked={layoutState.wide}
onchange={(event) => layoutState.setWide(event.currentTarget.checked)}
/>
</label>
</div>
</SharedSettingsDialog>
@@ -79,4 +89,17 @@
border: 1px solid var(--sc-border);
border-radius: var(--sc-radius-md);
}
.wide-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.75rem;
}
.wide-row input {
width: 1rem;
height: 1rem;
accent-color: var(--sc-primary);
}
</style>
+10 -10
View File
@@ -1,7 +1,7 @@
<script lang="ts">
import { page } from '$app/state'
import { getAppConfig, getPanelForPath, getPathForPanel } from '$lib/app-config'
import AnalyzerWorkspace from '$lib/features/AnalyzerWorkspace.svelte'
import ContentScannerWorkspace from '$lib/features/ContentScannerWorkspace.svelte'
import ConfigWorkspace from '$lib/features/ConfigWorkspace.svelte'
import FeedWorkspace from '$lib/features/FeedWorkspace.svelte'
import KioskWorkspace from '$lib/features/KioskWorkspace.svelte'
@@ -10,10 +10,10 @@
import CarrierNodeWorkspace from '$lib/features/CarrierNodeWorkspace.svelte'
import TagsWorkspace from '$lib/features/TagsWorkspace.svelte'
import VideoPage from '$lib/features/VideoPage.svelte'
import ToolsWorkspace from '$lib/features/ToolsWorkspace.svelte'
import CraftStudioWorkspace from '$lib/features/CraftStudioWorkspace.svelte'
import ViewerWorkspace from '$lib/features/ViewerWorkspace.svelte'
const analyzerMediaTypePanels: Record<
const contentScannerMediaTypePanels: Record<
string,
{ mediaType: 'image' | 'video' | 'audio' | 'funscript'; label: string }
> = {
@@ -64,15 +64,15 @@
<TagsWorkspace />
{:else if app.id === 'viewer'}
<ViewerWorkspace {panel} />
{:else if app.id === 'analyzer' && panel in analyzerMediaTypePanels}
{:else if app.id === 'contentscanner' && panel in contentScannerMediaTypePanels}
<MediaTypePipeline
mediaType={analyzerMediaTypePanels[panel].mediaType}
label={analyzerMediaTypePanels[panel].label}
mediaType={contentScannerMediaTypePanels[panel].mediaType}
label={contentScannerMediaTypePanels[panel].label}
/>
{:else if app.id === 'tools'}
<ToolsWorkspace {panel} />
{:else if app.id === 'analyzer'}
<AnalyzerWorkspace {panel} />
{:else if app.id === 'craftstudio'}
<CraftStudioWorkspace {panel} />
{:else if app.id === 'contentscanner'}
<ContentScannerWorkspace {panel} />
{:else if app.id === 'config'}
<ConfigWorkspace />
{:else if app.id === 'moderator'}
+17 -9
View File
@@ -36,14 +36,14 @@
'This instance, plus any peer instances for high availability - they sync settings with each other automatically.',
},
{ base: 'AuthGuard', description: 'Centralized identity: login, sessions, TOTP, admin users.' },
{ base: 'LoggingServer', description: 'Centralized log aggregation across every service.' },
{ base: 'OmniLogger', description: 'Centralized log aggregation across every service.' },
{ base: 'ModerationHub', description: 'Admin console for user and media moderation.' },
{ base: 'CarrierNode', description: 'Storage and delivery: mounts, bandwidth, file activity.' },
]
const CENTRAL_PORTS: Record<string, string> = {
projectconfigurator: '3005',
authguard: '8080',
loggingserver: '8090',
omnilogger: '8090',
moderationhub: '8090',
carriernode: '3003',
}
@@ -52,7 +52,7 @@
const CENTRAL_MOUNT_TYPES: Record<string, string[]> = {
projectconfigurator: [],
authguard: [],
loggingserver: [],
omnilogger: [],
moderationhub: ['media', 'thumbnails'],
carriernode: [],
}
@@ -643,17 +643,25 @@
}
}
// Best-effort migration from the pre-rename settings shape: MediaConfig -> ProjectConfigurator,
// MediaServant -> CarrierNode, and the old flat configured_projects list (which mixed
// MediaConfig/MediaServant in with every other project) split into configured_central /
// configured_main.
// Best-effort migration from each pre-rename settings shape: MediaConfig -> ProjectConfigurator,
// MediaServant -> CarrierNode, MediaAnalyzer -> ContentScanner, MediaTools -> CraftStudio,
// LoggingServer -> OmniLogger, and the old flat configured_projects list (which mixed all of
// these in with every other project) split into configured_central / configured_main.
const LEGACY_RENAMES: [string, string][] = [
['mediaconfig', 'projectconfigurator'],
['mediaservant', 'carriernode'],
['analyzer', 'contentscanner'],
['mediaanalyzer', 'contentscanner'],
['tools', 'craftstudio'],
['mediatools', 'craftstudio'],
['loggingserver', 'omnilogger'],
]
const LEGACY_RENAME_LABELS: Record<string, string> = {
projectconfigurator: 'ProjectConfigurator',
carriernode: 'CarrierNode',
contentscanner: 'ContentScanner',
craftstudio: 'CraftStudio',
omnilogger: 'OmniLogger',
}
// Renames a project name that may still carry a pre-rename base (e.g. "MediaServant" or
@@ -1029,7 +1037,7 @@
<div class="flex flex-wrap items-start justify-between gap-3">
<SectionTitle
title="Central services"
description="ProjectConfigurator (this instance), AuthGuard, LoggingServer, ModerationHub, and CarrierNode. Additional ProjectConfigurator instances sync settings with this one automatically."
description="ProjectConfigurator (this instance), AuthGuard, OmniLogger, ModerationHub, and CarrierNode. Additional ProjectConfigurator instances sync settings with this one automatically."
/>
<Button variant="secondary" size="sm" onclick={() => void syncNow()} disabled={syncing}>
<RefreshCw class="size-4" />{syncing ? 'Syncing…' : 'Sync now'}
@@ -1064,7 +1072,7 @@
<Card class="space-y-5">
<SectionTitle
title="Main services"
description="Product services such as MediaViewer, MediaTools, Bitmagnet, Heretic, and the rest. Enter just a URL - name, tabs, and mount types are detected automatically."
description="Product services such as MediaViewer, CraftStudio, Bitmagnet, Heretic, and the rest. Enter just a URL - name, tabs, and mount types are detected automatically."
/>
<div class="flex flex-col gap-2 sm:flex-row">
<input
@@ -4,9 +4,9 @@
import { SvelteSet } from 'svelte/reactivity'
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 ContentScannerHistory from '$lib/components/ContentScannerHistory.svelte'
import ContentScannerLiveStatus from '$lib/components/ContentScannerLiveStatus.svelte'
import ContentScannerPipelineBreakdown from '$lib/components/ContentScannerPipelineBreakdown.svelte'
import { cn } from '$lib/utils/cn'
type Json = Record<string, unknown>
@@ -49,7 +49,7 @@
for (const type of DISCOVER_TYPES) selectedPipelineTypes.add(type.key)
}
// Mirrors the pipeline stages modeled everywhere else (AnalyzerPipelineBreakdown, the per-type
// Mirrors the pipeline stages modeled everywhere else (ContentScannerPipelineBreakdown, the per-type
// Images/Videos/Audios/Funscripts tabs): discover, extract metadata, generate thumbnails, and
// run AI analysis. Each maps to its own backend action, scoped by the selected media types.
const PIPELINE_ACTIONS: { key: 'discover' | 'metadata' | 'thumbnails' | 'analyze'; label: string; endpoint: string }[] = [
@@ -190,7 +190,7 @@
schedules = Array.isArray(rawSchedules) ? (rawSchedules as Json[]) : []
} catch (reason) {
if (generation !== loadGeneration) return
error = reason instanceof Error ? reason.message : 'Unable to load analyzer state.'
error = reason instanceof Error ? reason.message : 'Unable to load content-scanning state.'
} finally {
if (!background) loading = false
}
@@ -414,7 +414,7 @@
variant="success"
/><Metric label="Errors" value={numeric('errors', numeric('failed'))} detail="Needs attention" variant="danger" />
</div>
<AnalyzerPipelineBreakdown pipeline={asRecord(stats.pipeline)} />
<ContentScannerPipelineBreakdown pipeline={asRecord(stats.pipeline)} />
<div class="grid gap-4 lg:grid-cols-[minmax(0,1.25fr)_minmax(280px,.75fr)]">
<Card class="space-y-5"
><SectionTitle
@@ -458,9 +458,9 @@
>
</div>
</Card>
<AnalyzerLiveStatus {status} {stats} {loading} description="Last response from the analyzer service." />
<ContentScannerLiveStatus {status} {stats} {loading} description="Last response from the content-scanning service." />
</div>
<AnalyzerHistory
<ContentScannerHistory
title="Recent processing history"
description="Every discovered, extracted, and analyzed element is recorded here."
/>
@@ -483,7 +483,7 @@
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." />
<ContentScannerLiveStatus {status} {stats} {loading} description="Current content-scanning schedule and worker state." />
<Card class="space-y-5"
><SectionTitle
title="New schedule"
@@ -539,7 +539,7 @@
<Card class="space-y-5"
><SectionTitle
title="Schedules"
description="Recurring analyzer jobs and their current state."
description="Recurring content-scanning jobs and their current state."
/>{#if schedules.length === 0}<EmptyState
title="No automation schedules"
message="Create one above; it will appear here with its next run."
@@ -549,7 +549,7 @@
>
<div class="min-w-0">
<p class="truncate text-sm font-medium text-fg">
{String(schedule.name || schedule.tool || 'Analyzer schedule')}
{String(schedule.name || schedule.tool || 'Content scan schedule')}
</p>
<p class="mt-1 text-xs text-muted-fg">
{String(schedule.tool || '—')} · every {String(schedule.intervalMinutes ?? '?')}m · Next run: {String(
@@ -572,9 +572,9 @@
</div>{/each}
</div>{/if}</Card
>
<AnalyzerHistory
<ContentScannerHistory
title="Processing history"
description="Elements processed while scheduled analyzer work runs."
description="Elements processed while scheduled content-scanning work runs."
/>
{:else}
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
@@ -610,9 +610,9 @@
</p>
</div></Card
>
<AnalyzerLiveStatus {status} {stats} {loading} description="Current discovery run, including the file it's on." />
<ContentScannerLiveStatus {status} {stats} {loading} description="Current discovery run, including the file it's on." />
</div>
<AnalyzerHistory
<ContentScannerHistory
title="Discovery history"
description="Discovered elements, statuses, and results."
/>
@@ -4,7 +4,7 @@
import { SvelteSet } from 'svelte/reactivity'
import { Button, Card, Metric, notify, SectionTitle } from '@gabriel20xx/web-ui'
import { get, post } from '$lib/api'
import AnalyzerHistory from '$lib/components/AnalyzerHistory.svelte'
import ContentScannerHistory from '$lib/components/ContentScannerHistory.svelte'
import PipelineFlowDiagram from '$lib/components/PipelineFlowDiagram.svelte'
import { cn } from '$lib/utils/cn'
@@ -103,7 +103,7 @@
})),
)
// Mirrors AnalyzerWorkspace.svelte's dashboard "Pipeline controls" panel, scoped to this one
// Mirrors ContentScannerWorkspace.svelte's dashboard "Pipeline controls" panel, scoped to this one
// page's fixed media type instead of a type selector. Selection is deliberately never reset on
// tab switch (same as the dashboard's own selection) - runSelectedStages filters by both
// selection and applicability, so a stage picked on one tab that doesn't apply to another
@@ -273,7 +273,7 @@
// walk/probe files synchronously) and can't run at once - discovery already re-probes
// metadata for the exact same files as a side effect, so when both are picked, discovery
// wins and the separate metadata call is skipped rather than failing with a conflict.
// Mirrors AnalyzerWorkspace.svelte's runSelectedPipeline.
// Mirrors ContentScannerWorkspace.svelte's runSelectedPipeline.
const runDiscover = selectedStages.has('discover')
const stages = availableStageActions.filter(
(action) => selectedStages.has(action.key) && !(action.key === 'metadata' && runDiscover),
@@ -478,7 +478,7 @@
{/if}
</Card>
<AnalyzerHistory
<ContentScannerHistory
{mediaType}
title={`Recent ${label.toLowerCase()} history`}
description="Elements of this media type processed by the pipeline."
@@ -457,7 +457,7 @@
Loading media…
</p>{:else if media.length === 0}<EmptyState
title="No catalog media found"
message="MediaAnalyzer outputs will appear once the catalog synchronization has data."
message="ContentScanner outputs will appear once the catalog synchronization has data."
/>{:else}<div class="overflow-x-auto">
<table class="w-full min-w-[720px] text-left">
<thead
+43
View File
@@ -0,0 +1,43 @@
import { browser } from '$app/environment'
const storageKey = 'shared-webui-wide-layout'
function getStoredWide(): boolean {
if (!browser) return false
try {
return localStorage.getItem(storageKey) === 'true'
} catch {
return false
}
}
let wide = $state<boolean>(getStoredWide())
function applyWide(next: boolean) {
if (browser) document.documentElement.toggleAttribute('data-wide-layout', next)
}
function setWide(next: boolean) {
wide = next
if (!browser) return
applyWide(wide)
try {
localStorage.setItem(storageKey, String(wide))
} catch {
// Ignore storage failures; the current page can still use the selected layout width.
}
}
if (browser) applyWide(wide)
export const layoutState = {
get wide() {
return wide
},
setWide,
toggle() {
setWide(!wide)
},
}
+1 -1
View File
@@ -1,4 +1,4 @@
export type AppId = 'viewer' | 'tools' | 'analyzer' | 'config' | 'moderator' | 'kiosk' | 'carriernode'
export type AppId = 'viewer' | 'craftstudio' | 'contentscanner' | 'config' | 'moderator' | 'kiosk' | 'carriernode'
export type ProjectIconName =
'image' | 'monitor-play' | 'play' | 'scan-search' | 'server' | 'settings-2' | 'shield-check' | 'wand-sparkles'