Compare commits

..
2 Commits
Author SHA1 Message Date
Gabriel20xxandClaude Sonnet 5 32104550cb Add wide-page layout toggle to Settings
Lint / Lint (push) Successful in 29s
Tests / Go backend (push) Successful in 51s
Tests / Dashboard checks (push) Successful in 56s
Docker / Docker Build & Push (push) Successful in 3m50s
Adds a persisted per-browser preference to widen page content to full
browser width, alongside the existing theme switcher and language
selector reachable from the header profile dropdown's Settings entry.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-06 22:56:25 +02:00
Gabriel20xx 81b62cdc26 Sync shared snapshot from 2e6baaa 2026-09-06 22:51:07 +02:00
37 changed files with 243 additions and 121 deletions

No files matched your search

+5
View File
@@ -95,3 +95,8 @@ body {
background-color: var(--color-primary); background-color: var(--color-primary);
color: var(--color-primary-fg); color: var(--color-primary-fg);
} }
/* Wide-page setting: lifts the shared shell's default max-width cap on the main content area. */
[data-wide-layout='true'] .sc-main {
width: calc(100% - 2rem);
}
@@ -4,6 +4,7 @@
import { SettingsDialog as SharedSettingsDialog } from '@gabriel20xx/web-ui'; import { SettingsDialog as SharedSettingsDialog } from '@gabriel20xx/web-ui';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '$lib/components/ui/select'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '$lib/components/ui/select';
import { currentLanguage, languages, setLanguage } from '$lib/language.svelte.js'; import { currentLanguage, languages, setLanguage } from '$lib/language.svelte.js';
import { layoutState } from '$lib/layout.svelte.js';
import { themeState } from '$lib/theme.svelte.js'; import { themeState } from '$lib/theme.svelte.js';
let { open = $bindable(false) } = $props(); let { open = $bindable(false) } = $props();
@@ -60,6 +61,15 @@
</SelectContent> </SelectContent>
</Select> </Select>
</div> </div>
<label class="mt-5 flex items-center justify-between gap-2">
<span class="text-sm font-medium">Wide page</span>
<input
type="checkbox"
checked={layoutState.wide}
onchange={(event) => layoutState.setWide(event.currentTarget.checked)}
class="size-4 rounded border-border accent-primary"
/>
</label>
<div class="sc-form-actions"> <div class="sc-form-actions">
<Button type="button" variant="secondary" onclick={() => (open = false)}>Dismiss</Button> <Button type="button" variant="secondary" onclick={() => (open = false)}>Dismiss</Button>
</div> </div>
+31
View File
@@ -0,0 +1,31 @@
import { browser } from '$app/environment';
const STORAGE_KEY = 'collabtable-wide-layout';
function loadInitialWide() {
if (!browser) return false;
return localStorage.getItem(STORAGE_KEY) === 'true';
}
let wide = $state(loadInitialWide());
export const layoutState = {
get wide() {
return wide;
},
setWide(next) {
wide = next;
if (browser) localStorage.setItem(STORAGE_KEY, String(next));
},
toggle() {
layoutState.setWide(!wide);
},
};
if (browser) {
$effect.root(() => {
$effect(() => {
document.documentElement.toggleAttribute('data-wide-layout', wide);
});
});
}
+1
View File
@@ -1,6 +1,7 @@
node_modules/ node_modules/
packages/*/dist/ packages/*/dist/
packages/*/.svelte-kit/ packages/*/.svelte-kit/
webui/.svelte-kit/
*.tgz *.tgz
.npm/ .npm/
__pycache__/ __pycache__/
+1 -1
View File
@@ -8,7 +8,7 @@ services, not application-specific SQL or HTTP handlers.
- `auth` — shared bcrypt policy, secure token generation/hashing, account/session schema, and account/session persistence. - `auth` — shared bcrypt policy, secure token generation/hashing, account/session schema, and account/session persistence.
- `authclient` — HTTP client and `net/http` middleware for services that adopt the centralized AuthServer instead of embedding `auth` against their own database. - `authclient` — HTTP client and `net/http` middleware for services that adopt the centralized AuthServer instead of embedding `auth` against their own database.
- `migrate` — embedded filesystem adapter for Goose migrations. - `migrate` — embedded filesystem adapter for Goose migrations.
- `logshipper` — client adapter for LoggingServer (Web/LoggingServer): batches and ships log entries centrally while mirroring the same human-readable output and Debug/Info/Warn/Error/Critical/Audit/*Ctx method surface as each project's local internal/logging package. - `logshipper` — client adapter for OmniLogger (Web/OmniLogger): batches and ships log entries centrally while mirroring the same human-readable output and Debug/Info/Warn/Error/Critical/Audit/*Ctx method surface as each project's local internal/logging package.
Run `go test ./...` and `go vet ./...` from this directory. The module path is Run `go test ./...` and `go vet ./...` from this directory. The module path is
`repos.gfranz.ch/Gabriel20xx/shared/backend`; change it if the shared folder is `repos.gfranz.ch/Gabriel20xx/shared/backend`; change it if the shared folder is
+19 -19
View File
@@ -1,5 +1,5 @@
// Package logshipper is the client-side adapter for LoggingServer // Package logshipper is the client-side adapter for OmniLogger
// (Web/LoggingServer), the workspace's centralized log sink. It is the // (Web/OmniLogger), the workspace's centralized log sink. It is the
// logging equivalent of the authclient package added alongside AuthServer: // logging equivalent of the authclient package added alongside AuthServer:
// each service currently owns its own local internal/logging package (see // each service currently owns its own local internal/logging package (see
// Original/OutdoorGames/OutdoorGamesServerGo/internal/logging/logging.go for // Original/OutdoorGames/OutdoorGamesServerGo/internal/logging/logging.go for
@@ -10,12 +10,12 @@
// logging.New(...) call for logshipper.New(...) with no call-site changes, // logging.New(...) call for logshipper.New(...) with no call-site changes,
// once the owner decides to migrate a given service. // once the owner decides to migrate a given service.
// //
// No project imports this yet — see LoggingServer/README.md's "Migration // No project imports this yet — see OmniLogger/README.md's "Migration
// notes" for the deliberate, per-project follow-up this requires. // notes" for the deliberate, per-project follow-up this requires.
// //
// Shipper always writes the same human-readable line to stdout/stderr that // Shipper always writes the same human-readable line to stdout/stderr that
// the local loggers write today, in addition to batching entries off to // the local loggers write today, in addition to batching entries off to
// LoggingServer. Nothing is lost if LoggingServer is never wired up, never // OmniLogger. Nothing is lost if OmniLogger is never wired up, never
// reachable, or removed later — this is a mirror, not a replacement, for the // reachable, or removed later — this is a mirror, not a replacement, for the
// container's own stdout/stderr logs. // container's own stdout/stderr logs.
package logshipper package logshipper
@@ -63,7 +63,7 @@ func levelOf(s string) Level {
} }
} }
// sevName is the canonical, lowercase level name LoggingServer's ingest API // sevName is the canonical, lowercase level name OmniLogger's ingest API
// expects (debug/info/warn/error/critical), independent of the uppercase // expects (debug/info/warn/error/critical), independent of the uppercase
// name used in the local stdout/stderr line. // name used in the local stdout/stderr line.
func sevName(sev Level) (upper, lower string) { func sevName(sev Level) (upper, lower string) {
@@ -92,13 +92,13 @@ const (
// Config configures a Shipper. Only BaseURL, IngestToken, and Service are // Config configures a Shipper. Only BaseURL, IngestToken, and Service are
// normally set by a caller; everything else has a workable default. // normally set by a caller; everything else has a workable default.
type Config struct { type Config struct {
// BaseURL is LoggingServer's base URL, e.g. "http://loggingserver:8090". // BaseURL is OmniLogger's base URL, e.g. "http://omnilogger:8090".
// Required. // Required.
BaseURL string BaseURL string
// IngestToken is the shared INGEST_TOKEN bearer secret LoggingServer // IngestToken is the shared INGEST_TOKEN bearer secret OmniLogger
// requires (see LoggingServer/README.md). Required. // requires (see OmniLogger/README.md). Required.
IngestToken string IngestToken string
// Service is this process's service name as reported to LoggingServer, // Service is this process's service name as reported to OmniLogger,
// e.g. "playhouse" or "outdoorgames-server-go". Required. // e.g. "playhouse" or "outdoorgames-server-go". Required.
Service string Service string
@@ -110,11 +110,11 @@ type Config struct {
// var (debug/info/warn/error/critical/silent). Defaults to "info". // var (debug/info/warn/error/critical/silent). Defaults to "info".
Level string Level string
// LogAll mirrors the LOG_ALL env var: when true, a verbose JSON context // LogAll mirrors the LOG_ALL env var: when true, a verbose JSON context
// dump is also printed locally (never sent to LoggingServer differently // dump is also printed locally (never sent to OmniLogger differently
// than normal — see Debug/InfoCtx doc comments). // than normal — see Debug/InfoCtx doc comments).
LogAll bool LogAll bool
// FlushInterval is how often buffered entries are sent to LoggingServer. // FlushInterval is how often buffered entries are sent to OmniLogger.
// Defaults to 2s. // Defaults to 2s.
FlushInterval time.Duration FlushInterval time.Duration
// MaxBatchSize triggers an out-of-band flush as soon as the buffer // MaxBatchSize triggers an out-of-band flush as soon as the buffer
@@ -127,13 +127,13 @@ type Config struct {
// Defaults to 2000. // Defaults to 2000.
BufferCapacity int BufferCapacity int
// HTTPClient overrides the client used to POST to LoggingServer. // HTTPClient overrides the client used to POST to OmniLogger.
// Defaults to a client with a 5s timeout. // Defaults to a client with a 5s timeout.
HTTPClient *http.Client HTTPClient *http.Client
} }
// wireEntry mirrors LoggingServer's POST /api/logs request shape // wireEntry mirrors OmniLogger's POST /api/logs request shape
// (LoggingServer/internal/httpapi.LogEntryInput) field-for-field. // (OmniLogger/internal/httpapi.LogEntryInput) field-for-field.
type wireEntry struct { type wireEntry struct {
Service string `json:"service"` Service string `json:"service"`
Level string `json:"level"` Level string `json:"level"`
@@ -142,7 +142,7 @@ type wireEntry struct {
OccurredAt time.Time `json:"occurred_at"` OccurredAt time.Time `json:"occurred_at"`
} }
// Shipper batches log entries in memory and flushes them to LoggingServer on // Shipper batches log entries in memory and flushes them to OmniLogger on
// a background goroutine, while also behaving like a local // a background goroutine, while also behaving like a local
// internal/logging.Logger (same method surface, same stdout/stderr output). // internal/logging.Logger (same method surface, same stdout/stderr output).
// A Shipper is safe for concurrent use. // A Shipper is safe for concurrent use.
@@ -263,7 +263,7 @@ func (s *Shipper) enqueue(entry wireEntry) {
} }
} }
// flush sends every currently buffered entry to LoggingServer in one // flush sends every currently buffered entry to OmniLogger in one
// request. Failures are swallowed (beyond a rate-limited local warning) by // request. Failures are swallowed (beyond a rate-limited local warning) by
// design: a host application must never fail, panic, or slow down because // design: a host application must never fail, panic, or slow down because
// its log sink is unreachable. // its log sink is unreachable.
@@ -302,12 +302,12 @@ func (s *Shipper) flush() {
defer resp.Body.Close() defer resp.Body.Close()
if resp.StatusCode < 200 || resp.StatusCode >= 300 { if resp.StatusCode < 200 || resp.StatusCode >= 300 {
s.warnOnce(fmt.Errorf("logshipper: LoggingServer rejected %d entries: HTTP %d", len(batch), resp.StatusCode)) s.warnOnce(fmt.Errorf("logshipper: OmniLogger rejected %d entries: HTTP %d", len(batch), resp.StatusCode))
} }
} }
// warnOnce prints a local stderr warning at most once per minute, no matter // warnOnce prints a local stderr warning at most once per minute, no matter
// how many sends fail in that window, so an unreachable LoggingServer cannot // how many sends fail in that window, so an unreachable OmniLogger cannot
// itself become a log-spam problem. // itself become a log-spam problem.
func (s *Shipper) warnOnce(err error) { func (s *Shipper) warnOnce(err error) {
s.warnMu.Lock() s.warnMu.Lock()
@@ -369,7 +369,7 @@ func (s *Shipper) emit(sev Level, ctx map[string]any, args ...any) {
} }
// Unlike the local-only verbose dump above (which scrubs IDs for // Unlike the local-only verbose dump above (which scrubs IDs for
// readability), the context shipped to LoggingServer is sent unscrubbed: // readability), the context shipped to OmniLogger is sent unscrubbed:
// the whole point of centralizing logs is cross-service correlation by // the whole point of centralizing logs is cross-service correlation by
// request/user/entity ID, so stripping IDs here would defeat that. // request/user/entity ID, so stripping IDs here would defeat that.
var rawCtx json.RawMessage var rawCtx json.RawMessage
+1 -1
View File
@@ -9,7 +9,7 @@ OUTPUT_DIR=../output
DOWNLOADS_DIR=../downloads DOWNLOADS_DIR=../downloads
THUMBNAIL_DIR=../thumbnails THUMBNAIL_DIR=../thumbnails
MODEL_CACHE_DIR=../models MODEL_CACHE_DIR=../models
WORKFLOWS_DIR=../MediaTools/public/workflows WORKFLOWS_DIR=../CraftStudio/public/workflows
FFMPEG_PATH=ffmpeg FFMPEG_PATH=ffmpeg
FFPROBE_PATH=ffprobe FFPROBE_PATH=ffprobe
YT_DLP_PATH=yt-dlp YT_DLP_PATH=yt-dlp
+1 -1
View File
@@ -1,6 +1,6 @@
# Shared media backend # Shared media backend
The backend is one Go module, shared across every `MEDIA_SERVICE` instance in the workspace. Set `MEDIA_SERVICE` to `viewer`, `tools`, `analyzer`, `config`, `moderator`, `kiosk`, or `carriernode` to select the route set while keeping the same auth, database, migration, file-safety, and worker implementation. The backend is one Go module, shared across every `MEDIA_SERVICE` instance in the workspace. Set `MEDIA_SERVICE` to `viewer`, `craftstudio`, `contentscanner`, `config`, `moderator`, `kiosk`, or `carriernode` to select the route set while keeping the same auth, database, migration, file-safety, and worker implementation.
From this directory: From this directory:
+16 -16
View File
@@ -11,13 +11,13 @@ import (
type Service string type Service string
const ( const (
Viewer Service = "viewer" Viewer Service = "viewer"
Tools Service = "tools" CraftStudio Service = "craftstudio"
Analyzer Service = "analyzer" ContentScanner Service = "contentscanner"
ConfigService Service = "config" ConfigService Service = "config"
Moderator Service = "moderator" Moderator Service = "moderator"
Kiosk Service = "kiosk" Kiosk Service = "kiosk"
CarrierNode Service = "carriernode" CarrierNode Service = "carriernode"
) )
type Config struct { type Config struct {
@@ -89,7 +89,7 @@ func Load() (*Config, error) {
MediaRoots: roots, MediaRoots: roots,
InputRoot: filepath.Clean(envOr("INPUT_DIR", "./input")), InputRoot: filepath.Clean(envOr("INPUT_DIR", "./input")),
CopyRoot: filepath.Clean(envOr("UPLOAD_COPY_DIR", "./copy")), CopyRoot: filepath.Clean(envOr("UPLOAD_COPY_DIR", "./copy")),
WorkflowsRoot: filepath.Clean(envOr("WORKFLOWS_DIR", filepath.Join("..", "MediaTools", "public", "workflows"))), WorkflowsRoot: filepath.Clean(envOr("WORKFLOWS_DIR", filepath.Join("..", "CraftStudio", "public", "workflows"))),
ThumbnailRoot: filepath.Clean(envOr("THUMBNAIL_DIR", "./thumbnails")), ThumbnailRoot: filepath.Clean(envOr("THUMBNAIL_DIR", "./thumbnails")),
OutputRoot: filepath.Clean(envOr("OUTPUT_DIR", "./output")), OutputRoot: filepath.Clean(envOr("OUTPUT_DIR", "./output")),
DownloadsRoot: filepath.Clean(envOr("DOWNLOADS_DIR", "./downloads")), DownloadsRoot: filepath.Clean(envOr("DOWNLOADS_DIR", "./downloads")),
@@ -124,10 +124,10 @@ func normalizeService(value string) Service {
switch strings.ToLower(strings.TrimSpace(value)) { switch strings.ToLower(strings.TrimSpace(value)) {
case "viewer", "mediaviewer": case "viewer", "mediaviewer":
return Viewer return Viewer
case "tools", "mediatools": case "craftstudio":
return Tools return CraftStudio
case "analyzer", "mediaanalyzer": case "contentscanner":
return Analyzer return ContentScanner
case "config", "mediaconfig", "projectconfigurator": case "config", "mediaconfig", "projectconfigurator":
return ConfigService return ConfigService
case "moderator", "mediamoderator": case "moderator", "mediamoderator":
@@ -145,10 +145,10 @@ func serviceName(service Service) string {
switch service { switch service {
case Viewer: case Viewer:
return "MediaViewer" return "MediaViewer"
case Tools: case CraftStudio:
return "MediaTools" return "CraftStudio"
case Analyzer: case ContentScanner:
return "MediaAnalyzer" return "ContentScanner"
case ConfigService: case ConfigService:
return "ProjectConfigurator" return "ProjectConfigurator"
case Moderator: case Moderator:
@@ -311,7 +311,7 @@ CREATE INDEX IF NOT EXISTS media_analysis_tasks_status_idx ON media_analysis_tas
-- to make repeated analysis runs idempotent instead of piling up duplicate tag rows. -- to make repeated analysis runs idempotent instead of piling up duplicate tag rows.
CREATE UNIQUE INDEX IF NOT EXISTS media_tags_ai_tag_unique ON media_tags (media_key, tag) WHERE user_id IS NULL; CREATE UNIQUE INDEX IF NOT EXISTS media_tags_ai_tag_unique ON media_tags (media_key, tag) WHERE user_id IS NULL;
-- Speeds up the MediaAnalyzer dashboard/pipelines/history/live-status queries: analyzerStats and -- Speeds up the ContentScanner dashboard/pipelines/history/live-status queries: analyzerStats and
-- analyzerPipelineBreakdown group active media by type (and join it against thumbnails), and -- analyzerPipelineBreakdown group active media by type (and join it against thumbnails), and
-- analyzerHistory sorts media_worker_jobs by queued_at with no status filter, none of which the -- analyzerHistory sorts media_worker_jobs by queued_at with no status filter, none of which the
-- existing media/media_worker_jobs indexes above actually cover. -- existing media/media_worker_jobs indexes above actually cover.
@@ -290,11 +290,11 @@ var serviceTabsByService = map[config.Service][]tabOption{
config.Viewer: { config.Viewer: {
{"Library", "/"}, {"Feed", "/feed"}, {"Tags", "/tags"}, {"Playlists", "/playlists"}, {"About", "/about"}, {"Library", "/"}, {"Feed", "/feed"}, {"Tags", "/tags"}, {"Playlists", "/playlists"}, {"About", "/about"},
}, },
config.Tools: { config.CraftStudio: {
{"Generator", "/"}, {"Downloader", "/downloader"}, {"Converter", "/converter"}, {"Generator", "/"}, {"Downloader", "/downloader"}, {"Converter", "/converter"},
{"Schedules", "/schedules"}, {"Library", "/library"}, {"About", "/about"}, {"Schedules", "/schedules"}, {"Library", "/library"}, {"About", "/about"},
}, },
config.Analyzer: { config.ContentScanner: {
{"Dashboard", "/"}, {"Discover", "/discover"}, {"Images", "/images"}, {"Videos", "/videos"}, {"Dashboard", "/"}, {"Discover", "/discover"}, {"Images", "/images"}, {"Videos", "/videos"},
{"Audios", "/audios"}, {"Funscripts", "/funscripts"}, {"Schedules", "/schedules"}, {"About", "/about"}, {"Audios", "/audios"}, {"Funscripts", "/funscripts"}, {"Schedules", "/schedules"}, {"About", "/about"},
}, },
@@ -310,8 +310,8 @@ var serviceTabsByService = map[config.Service][]tabOption{
// mount "type" values each service's own tab accepts when configuring its mounts. // mount "type" values each service's own tab accepts when configuring its mounts.
var serviceMountTypesByService = map[config.Service][]string{ var serviceMountTypesByService = map[config.Service][]string{
config.Viewer: {"media", "thumbnails", "funscripts"}, config.Viewer: {"media", "thumbnails", "funscripts"},
config.Tools: {"downloads", "generated", "converted", "converter input", "generator input", "generator copy"}, config.CraftStudio: {"downloads", "generated", "converted", "converter input", "generator input", "generator copy"},
config.Analyzer: {"images", "videos", "audios", "funscripts", "models", "thumbnails"}, config.ContentScanner: {"images", "videos", "audios", "funscripts", "models", "thumbnails"},
config.Moderator: {"media", "thumbnails"}, config.Moderator: {"media", "thumbnails"},
config.Kiosk: {"media"}, config.Kiosk: {"media"},
config.CarrierNode: {"media", "output"}, config.CarrierNode: {"media", "output"},
@@ -538,7 +538,7 @@ func (s *Server) mountMappings(ctx context.Context) map[string]any {
// opposed to a project-specific working directory like "downloads", "generated", // opposed to a project-specific working directory like "downloads", "generated",
// "thumbnails", or "models", which have their own dedicated Root config fields instead and // "thumbnails", or "models", which have their own dedicated Root config fields instead and
// are deliberately left out here. A path is entered under whichever project's tab happens to // are deliberately left out here. A path is entered under whichever project's tab happens to
// need it (MediaAnalyzer's "images"/"videos"/"audios", MediaViewer/MediaKiosk's "media", ...) // need it (ContentScanner's "images"/"videos"/"audios", MediaViewer/MediaKiosk's "media", ...)
// but they're all describing locations CarrierNode itself has to walk, since it's the only // but they're all describing locations CarrierNode itself has to walk, since it's the only
// service with the volume mounted - see effectiveMediaRoots. // service with the volume mounted - see effectiveMediaRoots.
var mediaLibraryMountTypes = map[string]bool{ var mediaLibraryMountTypes = map[string]bool{
@@ -964,7 +964,7 @@ func (s *Server) writeCarrierNodeFiles(w http.ResponseWriter, r *http.Request, r
if recent { if recent {
sort.Slice(files, func(i, j int) bool { return files[i].Mtime > files[j].Mtime }) sort.Slice(files, func(i, j int) bool { return files[i].Mtime > files[j].Mtime })
} }
// Internal callers (e.g. MediaAnalyzer discovery) need to list an entire real-sized library // Internal callers (e.g. ContentScanner discovery) need to list an entire real-sized library
// in one pass; the public 1000-item cap stays in place for anyone without the shared secret. // in one pass; the public 1000-item cap stays in place for anyone without the shared secret.
maxLimit := 1000 maxLimit := 1000
if s.cfg.InternalServiceSecret != "" && r.Header.Get("X-Internal-Auth") == s.cfg.InternalServiceSecret { if s.cfg.InternalServiceSecret != "" && r.Header.Get("X-Internal-Auth") == s.cfg.InternalServiceSecret {
@@ -1175,7 +1175,7 @@ func (s *Server) carrierNodeStore(w http.ResponseWriter, r *http.Request) {
} }
// resolveStoreFile is CarrierNode's own local-filesystem lookup for /api/store, which catalogs a // resolveStoreFile is CarrierNode's own local-filesystem lookup for /api/store, which catalogs a
// file MediaTools already pushed into one of CarrierNode's mounts (InputRoot, MediaRoots, // file CraftStudio already pushed into one of CarrierNode's mounts (InputRoot, MediaRoots,
// DownloadsRoot, OutputRoot) - unlike everything else in this file, it's called with a path that // DownloadsRoot, OutputRoot) - unlike everything else in this file, it's called with a path that
// isn't necessarily under MediaRoots, so it can't just use resolveMediaPath. // isn't necessarily under MediaRoots, so it can't just use resolveMediaPath.
func (s *Server) resolveStoreFile(value string) (string, error) { func (s *Server) resolveStoreFile(value string) (string, error) {
@@ -1501,7 +1501,7 @@ func hasFunscriptSidecar(filePath string) bool {
} }
// funscriptSidecarExists is hasFunscriptSidecar for callers without local filesystem access // funscriptSidecarExists is hasFunscriptSidecar for callers without local filesystem access
// (MediaAnalyzer) - it checks for the sidecar on CarrierNode instead of statting a local path. // (ContentScanner) - it checks for the sidecar on CarrierNode instead of statting a local path.
func (s *Server) funscriptSidecarExists(ctx context.Context, key string) bool { func (s *Server) funscriptSidecarExists(ctx context.Context, key string) bool {
base := strings.TrimSuffix(key, filepath.Ext(key)) base := strings.TrimSuffix(key, filepath.Ext(key))
for _, candidate := range []string{base + ".funscript", base + ".json"} { for _, candidate := range []string{base + ".funscript", base + ".json"} {
@@ -433,7 +433,7 @@ type analysisSidecarRequest struct {
} }
// callAnalyzerModelsService calls the AnalyzerModels sidecar (a separate process in the same // callAnalyzerModelsService calls the AnalyzerModels sidecar (a separate process in the same
// container, not baked into this binary - see ANALYZER_MODELS_URL and MediaAnalyzer/Dockerfile), // container, not baked into this binary - see ANALYZER_MODELS_URL and ContentScanner/Dockerfile),
// the same way executeGeneration already calls out to ComfyUI for image generation. Video frames // the same way executeGeneration already calls out to ComfyUI for image generation. Video frames
// are analyzed through the image endpoint since by the time this runs the video has already been // are analyzed through the image endpoint since by the time this runs the video has already been
// reduced to a still frame. // reduced to a still frame.
@@ -211,9 +211,9 @@ func (s *Server) mountServiceRoutes(r chi.Router) {
switch s.cfg.Service { switch s.cfg.Service {
case config.Viewer: case config.Viewer:
s.mountViewerRoutes(r) s.mountViewerRoutes(r)
case config.Tools: case config.CraftStudio:
s.mountToolsRoutes(r) s.mountToolsRoutes(r)
case config.Analyzer: case config.ContentScanner:
s.mountAnalyzerRoutes(r) s.mountAnalyzerRoutes(r)
case config.ConfigService: case config.ConfigService:
s.mountConfigRoutes(r) s.mountConfigRoutes(r)
@@ -337,7 +337,7 @@ func (s *Server) listenAndServe(ctx context.Context) error {
func (s *Server) Run(ctx context.Context) error { func (s *Server) Run(ctx context.Context) error {
go s.resumeWorkflowJobs(ctx) go s.resumeWorkflowJobs(ctx)
if s.cfg.Service == config.Analyzer { if s.cfg.Service == config.ContentScanner {
go s.runAnalyzerScheduler(ctx) go s.runAnalyzerScheduler(ctx)
} }
if s.cfg.Service == config.ConfigService { if s.cfg.Service == config.ConfigService {
@@ -441,7 +441,7 @@ func firstString(values map[string]any, keys ...string) string {
// workflowFileCarrierNodePaths mirrors the search order resolveWorkflowFile used to walk locally // workflowFileCarrierNodePaths mirrors the search order resolveWorkflowFile used to walk locally
// (InputRoot, MediaRoots, DownloadsRoot, OutputRoot) but as CarrierNode-side mount prefixes, since // (InputRoot, MediaRoots, DownloadsRoot, OutputRoot) but as CarrierNode-side mount prefixes, since
// MediaTools no longer has any of those roots mounted on its own filesystem. // CraftStudio no longer has any of those roots mounted on its own filesystem.
var workflowFileCarrierNodePaths = []string{"/mount/inputs/", "/media/", "/media/downloads/", "/mount/generated/"} var workflowFileCarrierNodePaths = []string{"/mount/inputs/", "/media/", "/media/downloads/", "/mount/generated/"}
// fetchWorkflowFileFromCarrierNode locates a converter input under any of CarrierNode's mounts and // fetchWorkflowFileFromCarrierNode locates a converter input under any of CarrierNode's mounts and
@@ -1165,7 +1165,7 @@ body.nc-content-scroll-shell:not(.is-feed-stage-active)
padding-top: var(--tab-content-top-gap, 0.75rem); padding-top: var(--tab-content-top-gap, 0.75rem);
} }
/* Semantic worker badges/pills used by MediaAnalyzer history rows. */ /* Semantic worker badges/pills used by ContentScanner history rows. */
.worker-badge-image, .worker-badge-image,
.worker-badge-video, .worker-badge-video,
.worker-badge-audio, .worker-badge-audio,
+1 -1
View File
@@ -7,7 +7,7 @@ import { join } from 'path';
// now separate repos: MediaModerator, MediaTools, MediaKiosk, MediaViewer). The existsSync guard // now separate repos: MediaModerator, MediaTools, MediaKiosk, MediaViewer). The existsSync guard
// below means this currently no-ops safely (nothing to audit) rather than erroring. Left as-is // below means this currently no-ops safely (nothing to audit) rather than erroring. Left as-is
// rather than guessing at a SvelteKit-equivalent audit — remove or repurpose if useful. // rather than guessing at a SvelteKit-equivalent audit — remove or repurpose if useful.
const projects = ['MediaModerator', 'MediaTools', 'MediaKiosk', 'MediaViewer']; const projects = ['MediaModerator', 'CraftStudio', 'MediaKiosk', 'MediaViewer'];
const scriptSrcRe = /<script[^>]+src="([^"]+)"[^>]*>/g; const scriptSrcRe = /<script[^>]+src="([^"]+)"[^>]*>/g;
projects.forEach(proj => { projects.forEach(proj => {
@@ -35,22 +35,22 @@ const sharedThemePath = path.join(
const bannedSelectorRules = [ const bannedSelectorRules = [
{ {
name: 'project-coupled service token', name: 'project-coupled service token',
regex: /\b(?:kiosk|viewer|moderator|generator|library|analyzer|downloader|carriernode)-page\b/i, regex: /\b(?:kiosk|viewer|moderator|generator|library|contentscanner|downloader|carriernode)-page\b/i,
}, },
{ {
name: 'project-coupled state class token', name: 'project-coupled state class token',
regex: regex:
/\b(?:viewer|kiosk|moderator|generator|library|analyzer|downloader|carriernode)-(?:home|page|stage|mode|active|panel)\b/i, /\b(?:viewer|kiosk|moderator|generator|library|contentscanner|downloader|carriernode)-(?:home|page|stage|mode|active|panel)\b/i,
}, },
{ {
name: 'project-prefixed keyframe name', name: 'project-prefixed keyframe name',
regex: regex:
/@keyframes\s+nc-(?:viewer|kiosk|moderator|generator|library|analyzer|downloader|carriernode)/i, /@keyframes\s+nc-(?:viewer|kiosk|moderator|generator|library|contentscanner|downloader|carriernode)/i,
}, },
{ {
name: 'project-coupled data attribute', name: 'project-coupled data attribute',
regex: regex:
/\[data-(?:kiosk|viewer|moderator|generator|library|analyzer|downloader|carriernode)[^\]]*\]/i, /\[data-(?:kiosk|viewer|moderator|generator|library|contentscanner|downloader|carriernode)[^\]]*\]/i,
}, },
{ {
name: 'route-coupled panel selector', name: 'route-coupled panel selector',
+5 -5
View File
@@ -84,13 +84,13 @@ function appendContent(targetPath, appendContent) {
log('\n── Verification ──'); log('\n── Verification ──');
const projects = [ const projects = [
{ name: 'MediaModerator', publicDir: 'MediaModerator/public' }, { name: 'MediaModerator', publicDir: 'MediaModerator/public' },
{ name: 'MediaTools', publicDir: 'MediaTools/public' }, { name: 'CraftStudio', publicDir: 'CraftStudio/public' },
{ name: 'MediaTools Converter', publicDir: 'MediaTools/public/converter' }, { name: 'CraftStudio Converter', publicDir: 'CraftStudio/public/converter' },
{ name: 'MediaTools Generator', publicDir: 'MediaTools/generator/public' }, { name: 'CraftStudio Generator', publicDir: 'CraftStudio/generator/public' },
{ name: 'MediaTools Downloader', publicDir: 'MediaTools/downloader/public' }, { name: 'CraftStudio Downloader', publicDir: 'CraftStudio/downloader/public' },
{ name: 'MediaKiosk', publicDir: 'MediaKiosk/public' }, { name: 'MediaKiosk', publicDir: 'MediaKiosk/public' },
{ name: 'MediaViewer', publicDir: 'MediaViewer/public' }, { name: 'MediaViewer', publicDir: 'MediaViewer/public' },
{ name: 'MediaAnalyzer', publicDir: 'MediaAnalyzer/public' }, { name: 'ContentScanner', publicDir: 'ContentScanner/public' },
{ name: 'MediaDesktop', publicDir: 'MediaDesktop/public' }, { name: 'MediaDesktop', publicDir: 'MediaDesktop/public' },
]; ];
let allOk = true; let allOk = true;
+2 -2
View File
@@ -44,10 +44,10 @@ $consumerProjects = @(
New-ConsumerProject 'Forks/HordeWorker' New-ConsumerProject 'Forks/HordeWorker'
New-ConsumerProject 'Original/OutdoorGames' New-ConsumerProject 'Original/OutdoorGames'
New-ConsumerProject 'Original/KioskDisplay' -Destination 'engine' New-ConsumerProject 'Original/KioskDisplay' -Destination 'engine'
New-ConsumerProject 'Original/MediaAnalyzer' -Destination 'engine' New-ConsumerProject 'Original/CraftStudio' -Destination 'engine'
New-ConsumerProject 'Original/MediaTools' -Destination 'engine'
New-ConsumerProject 'Original/MediaViewer' -Destination 'engine' New-ConsumerProject 'Original/MediaViewer' -Destination 'engine'
New-ConsumerProject 'Central/CarrierNode' -Destination 'engine' New-ConsumerProject 'Central/CarrierNode' -Destination 'engine'
New-ConsumerProject 'Central/ContentScanner' -Destination 'engine'
New-ConsumerProject 'Central/ModerationHub' -Destination 'engine' New-ConsumerProject 'Central/ModerationHub' -Destination 'engine'
New-ConsumerProject 'Central/ProjectConfigurator' -Destination 'engine' New-ConsumerProject 'Central/ProjectConfigurator' -Destination 'engine'
New-ConsumerProject 'Central/AuthGuard' New-ConsumerProject 'Central/AuthGuard'
+2 -2
View File
@@ -8,8 +8,8 @@
"build": "vite build", "build": "vite build",
"build:all": "node scripts/build-all.mjs", "build:all": "node scripts/build-all.mjs",
"build:viewer": "node scripts/build-all.mjs viewer", "build:viewer": "node scripts/build-all.mjs viewer",
"build:tools": "node scripts/build-all.mjs tools", "build:craftstudio": "node scripts/build-all.mjs craftstudio",
"build:analyzer": "node scripts/build-all.mjs analyzer", "build:contentscanner": "node scripts/build-all.mjs contentscanner",
"build:config": "node scripts/build-all.mjs config", "build:config": "node scripts/build-all.mjs config",
"build:moderator": "node scripts/build-all.mjs moderator", "build:moderator": "node scripts/build-all.mjs moderator",
"build:kiosk": "node scripts/build-all.mjs kiosk", "build:kiosk": "node scripts/build-all.mjs kiosk",
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"viewer": { "name": "MediaViewer", "icon": "play" }, "viewer": { "name": "MediaViewer", "icon": "play" },
"tools": { "name": "MediaTools", "icon": "wand-sparkles" }, "craftstudio": { "name": "CraftStudio", "icon": "wand-sparkles" },
"analyzer": { "name": "MediaAnalyzer", "icon": "scan-search" }, "contentscanner": { "name": "ContentScanner", "icon": "scan-search" },
"config": { "name": "ProjectConfigurator", "icon": "settings-2" }, "config": { "name": "ProjectConfigurator", "icon": "settings-2" },
"moderator": { "name": "MediaModerator", "icon": "shield-check" }, "moderator": { "name": "MediaModerator", "icon": "shield-check" },
"kiosk": { "name": "MediaKiosk", "icon": "image" }, "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 enginesDir = path.resolve(webUiDir, '..')
const targets = { const targets = {
viewer: 'MediaViewer', viewer: 'MediaViewer',
tools: 'MediaTools', craftstudio: 'CraftStudio',
analyzer: 'MediaAnalyzer', contentscanner: 'ContentScanner',
config: 'ProjectConfigurator', config: 'ProjectConfigurator',
moderator: 'MediaModerator', moderator: 'MediaModerator',
kiosk: 'MediaKiosk', kiosk: 'MediaKiosk',
+8 -8
View File
@@ -44,10 +44,10 @@ const configs: Record<AppId, AppConfig> = {
}, },
], ],
}, },
tools: { craftstudio: {
id: 'tools', id: 'craftstudio',
name: 'MediaTools', name: 'CraftStudio',
icon: projectIcon('tools'), icon: projectIcon('craftstudio'),
eyebrow: 'Media workflow studio', eyebrow: 'Media workflow studio',
description: 'Generate, download, convert, and schedule media jobs in one place.', description: 'Generate, download, convert, and schedule media jobs in one place.',
nav: [ nav: [
@@ -88,10 +88,10 @@ const configs: Record<AppId, AppConfig> = {
}, },
], ],
}, },
analyzer: { contentscanner: {
id: 'analyzer', id: 'contentscanner',
name: 'MediaAnalyzer', name: 'ContentScanner',
icon: projectIcon('analyzer'), icon: projectIcon('contentscanner'),
eyebrow: 'Processing operations', eyebrow: 'Processing operations',
description: 'Monitor discovery and define per-type processing pipelines and automation queues.', description: 'Monitor discovery and define per-type processing pipelines and automation queues.',
nav: [ nav: [
@@ -12,6 +12,7 @@
import { pageActions } from '$lib/stores/page-actions.svelte' import { pageActions } from '$lib/stores/page-actions.svelte'
import { get, post, put } from '$lib/api' import { get, post, put } from '$lib/api'
import '$lib/language.svelte' import '$lib/language.svelte'
import { layoutState } from '$lib/layout.svelte'
import type { AppConfig, AuthState, AuthUser } from '$lib/types' import type { AppConfig, AuthState, AuthUser } from '$lib/types'
import type { Snippet } from 'svelte' import type { Snippet } from 'svelte'
@@ -170,7 +171,7 @@
username={displayName} 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 <PageHeader
title={activeNavItem?.label || app.name} title={activeNavItem?.label || app.name}
description={activeNavItem?.description || app.description} description={activeNavItem?.description || app.description}
@@ -9,7 +9,7 @@
status = {}, status = {},
stats = {}, stats = {},
loading = false, loading = false,
description = 'Current analyzer worker state.', description = 'Current content-scanning worker state.',
}: { status?: Json; stats?: Json; loading?: boolean; description?: string } = $props() }: { status?: Json; stats?: Json; loading?: boolean; description?: string } = $props()
// discovering/extracting/cleaning all share one backend scan slot (see scanCancel on the Go // 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 { Moon, Sun, SunMoon } from '@lucide/svelte'
import { Button, SettingsDialog as SharedSettingsDialog } from '@gabriel20xx/web-ui' import { Button, SettingsDialog as SharedSettingsDialog } from '@gabriel20xx/web-ui'
import { currentLanguage, languages, setLanguage } from '$lib/language.svelte' import { currentLanguage, languages, setLanguage } from '$lib/language.svelte'
import { layoutState } from '$lib/layout.svelte'
import { themeState } from '$lib/theme.svelte' import { themeState } from '$lib/theme.svelte'
let { let {
@@ -67,6 +68,15 @@
{/each} {/each}
</select> </select>
</label> </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> </div>
</SharedSettingsDialog> </SharedSettingsDialog>
@@ -79,4 +89,17 @@
border: 1px solid var(--sc-border); border: 1px solid var(--sc-border);
border-radius: var(--sc-radius-md); 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> </style>
@@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { page } from '$app/state' import { page } from '$app/state'
import { getAppConfig, getPanelForPath, getPathForPanel } from '$lib/app-config' 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 ConfigWorkspace from '$lib/features/ConfigWorkspace.svelte'
import FeedWorkspace from '$lib/features/FeedWorkspace.svelte' import FeedWorkspace from '$lib/features/FeedWorkspace.svelte'
import KioskWorkspace from '$lib/features/KioskWorkspace.svelte' import KioskWorkspace from '$lib/features/KioskWorkspace.svelte'
@@ -10,10 +10,10 @@
import CarrierNodeWorkspace from '$lib/features/CarrierNodeWorkspace.svelte' import CarrierNodeWorkspace from '$lib/features/CarrierNodeWorkspace.svelte'
import TagsWorkspace from '$lib/features/TagsWorkspace.svelte' import TagsWorkspace from '$lib/features/TagsWorkspace.svelte'
import VideoPage from '$lib/features/VideoPage.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' import ViewerWorkspace from '$lib/features/ViewerWorkspace.svelte'
const analyzerMediaTypePanels: Record< const contentScannerMediaTypePanels: Record<
string, string,
{ mediaType: 'image' | 'video' | 'audio' | 'funscript'; label: string } { mediaType: 'image' | 'video' | 'audio' | 'funscript'; label: string }
> = { > = {
@@ -64,15 +64,15 @@
<TagsWorkspace /> <TagsWorkspace />
{:else if app.id === 'viewer'} {:else if app.id === 'viewer'}
<ViewerWorkspace {panel} /> <ViewerWorkspace {panel} />
{:else if app.id === 'analyzer' && panel in analyzerMediaTypePanels} {:else if app.id === 'contentscanner' && panel in contentScannerMediaTypePanels}
<MediaTypePipeline <MediaTypePipeline
mediaType={analyzerMediaTypePanels[panel].mediaType} mediaType={contentScannerMediaTypePanels[panel].mediaType}
label={analyzerMediaTypePanels[panel].label} label={contentScannerMediaTypePanels[panel].label}
/> />
{:else if app.id === 'tools'} {:else if app.id === 'craftstudio'}
<ToolsWorkspace {panel} /> <CraftStudioWorkspace {panel} />
{:else if app.id === 'analyzer'} {:else if app.id === 'contentscanner'}
<AnalyzerWorkspace {panel} /> <ContentScannerWorkspace {panel} />
{:else if app.id === 'config'} {:else if app.id === 'config'}
<ConfigWorkspace /> <ConfigWorkspace />
{:else if app.id === 'moderator'} {:else if app.id === 'moderator'}
@@ -36,14 +36,14 @@
'This instance, plus any peer instances for high availability - they sync settings with each other automatically.', '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: '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: 'ModerationHub', description: 'Admin console for user and media moderation.' },
{ base: 'CarrierNode', description: 'Storage and delivery: mounts, bandwidth, file activity.' }, { base: 'CarrierNode', description: 'Storage and delivery: mounts, bandwidth, file activity.' },
] ]
const CENTRAL_PORTS: Record<string, string> = { const CENTRAL_PORTS: Record<string, string> = {
projectconfigurator: '3005', projectconfigurator: '3005',
authguard: '8080', authguard: '8080',
loggingserver: '8090', omnilogger: '8090',
moderationhub: '8090', moderationhub: '8090',
carriernode: '3003', carriernode: '3003',
} }
@@ -52,7 +52,7 @@
const CENTRAL_MOUNT_TYPES: Record<string, string[]> = { const CENTRAL_MOUNT_TYPES: Record<string, string[]> = {
projectconfigurator: [], projectconfigurator: [],
authguard: [], authguard: [],
loggingserver: [], omnilogger: [],
moderationhub: ['media', 'thumbnails'], moderationhub: ['media', 'thumbnails'],
carriernode: [], carriernode: [],
} }
@@ -643,17 +643,25 @@
} }
} }
// Best-effort migration from the pre-rename settings shape: MediaConfig -> ProjectConfigurator, // Best-effort migration from each pre-rename settings shape: MediaConfig -> ProjectConfigurator,
// MediaServant -> CarrierNode, and the old flat configured_projects list (which mixed // MediaServant -> CarrierNode, MediaAnalyzer -> ContentScanner, MediaTools -> CraftStudio,
// MediaConfig/MediaServant in with every other project) split into configured_central / // LoggingServer -> OmniLogger, and the old flat configured_projects list (which mixed all of
// configured_main. // these in with every other project) split into configured_central / configured_main.
const LEGACY_RENAMES: [string, string][] = [ const LEGACY_RENAMES: [string, string][] = [
['mediaconfig', 'projectconfigurator'], ['mediaconfig', 'projectconfigurator'],
['mediaservant', 'carriernode'], ['mediaservant', 'carriernode'],
['analyzer', 'contentscanner'],
['mediaanalyzer', 'contentscanner'],
['tools', 'craftstudio'],
['mediatools', 'craftstudio'],
['loggingserver', 'omnilogger'],
] ]
const LEGACY_RENAME_LABELS: Record<string, string> = { const LEGACY_RENAME_LABELS: Record<string, string> = {
projectconfigurator: 'ProjectConfigurator', projectconfigurator: 'ProjectConfigurator',
carriernode: 'CarrierNode', carriernode: 'CarrierNode',
contentscanner: 'ContentScanner',
craftstudio: 'CraftStudio',
omnilogger: 'OmniLogger',
} }
// Renames a project name that may still carry a pre-rename base (e.g. "MediaServant" or // 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"> <div class="flex flex-wrap items-start justify-between gap-3">
<SectionTitle <SectionTitle
title="Central services" 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}> <Button variant="secondary" size="sm" onclick={() => void syncNow()} disabled={syncing}>
<RefreshCw class="size-4" />{syncing ? 'Syncing…' : 'Sync now'} <RefreshCw class="size-4" />{syncing ? 'Syncing…' : 'Sync now'}
@@ -1064,7 +1072,7 @@
<Card class="space-y-5"> <Card class="space-y-5">
<SectionTitle <SectionTitle
title="Main services" 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"> <div class="flex flex-col gap-2 sm:flex-row">
<input <input
@@ -4,9 +4,9 @@
import { SvelteSet } from 'svelte/reactivity' import { SvelteSet } from 'svelte/reactivity'
import { Badge, Button, Card, EmptyState, Metric, notify, SectionTitle } from '@gabriel20xx/web-ui' import { Badge, Button, Card, EmptyState, Metric, notify, SectionTitle } from '@gabriel20xx/web-ui'
import { del, get, post } from '$lib/api' import { del, get, post } from '$lib/api'
import AnalyzerHistory from '$lib/components/AnalyzerHistory.svelte' import ContentScannerHistory from '$lib/components/ContentScannerHistory.svelte'
import AnalyzerLiveStatus from '$lib/components/AnalyzerLiveStatus.svelte' import ContentScannerLiveStatus from '$lib/components/ContentScannerLiveStatus.svelte'
import AnalyzerPipelineBreakdown from '$lib/components/AnalyzerPipelineBreakdown.svelte' import ContentScannerPipelineBreakdown from '$lib/components/ContentScannerPipelineBreakdown.svelte'
import { cn } from '$lib/utils/cn' import { cn } from '$lib/utils/cn'
type Json = Record<string, unknown> type Json = Record<string, unknown>
@@ -49,7 +49,7 @@
for (const type of DISCOVER_TYPES) selectedPipelineTypes.add(type.key) 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 // 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. // 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 }[] = [ const PIPELINE_ACTIONS: { key: 'discover' | 'metadata' | 'thumbnails' | 'analyze'; label: string; endpoint: string }[] = [
@@ -190,7 +190,7 @@
schedules = Array.isArray(rawSchedules) ? (rawSchedules as Json[]) : [] schedules = Array.isArray(rawSchedules) ? (rawSchedules as Json[]) : []
} catch (reason) { } catch (reason) {
if (generation !== loadGeneration) return 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 { } finally {
if (!background) loading = false if (!background) loading = false
} }
@@ -414,7 +414,7 @@
variant="success" variant="success"
/><Metric label="Errors" value={numeric('errors', numeric('failed'))} detail="Needs attention" variant="danger" /> /><Metric label="Errors" value={numeric('errors', numeric('failed'))} detail="Needs attention" variant="danger" />
</div> </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)]"> <div class="grid gap-4 lg:grid-cols-[minmax(0,1.25fr)_minmax(280px,.75fr)]">
<Card class="space-y-5" <Card class="space-y-5"
><SectionTitle ><SectionTitle
@@ -458,9 +458,9 @@
> >
</div> </div>
</Card> </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> </div>
<AnalyzerHistory <ContentScannerHistory
title="Recent processing history" title="Recent processing history"
description="Every discovered, extracted, and analyzed element is recorded here." description="Every discovered, extracted, and analyzed element is recorded here."
/> />
@@ -483,7 +483,7 @@
variant="success" variant="success"
/><Metric label="Errors" value={numeric('errors', numeric('failed'))} detail="Needs attention" variant="danger" /> /><Metric label="Errors" value={numeric('errors', numeric('failed'))} detail="Needs attention" variant="danger" />
</div> </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" <Card class="space-y-5"
><SectionTitle ><SectionTitle
title="New schedule" title="New schedule"
@@ -539,7 +539,7 @@
<Card class="space-y-5" <Card class="space-y-5"
><SectionTitle ><SectionTitle
title="Schedules" title="Schedules"
description="Recurring analyzer jobs and their current state." description="Recurring content-scanning jobs and their current state."
/>{#if schedules.length === 0}<EmptyState />{#if schedules.length === 0}<EmptyState
title="No automation schedules" title="No automation schedules"
message="Create one above; it will appear here with its next run." message="Create one above; it will appear here with its next run."
@@ -549,7 +549,7 @@
> >
<div class="min-w-0"> <div class="min-w-0">
<p class="truncate text-sm font-medium text-fg"> <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>
<p class="mt-1 text-xs text-muted-fg"> <p class="mt-1 text-xs text-muted-fg">
{String(schedule.tool || '—')} · every {String(schedule.intervalMinutes ?? '?')}m · Next run: {String( {String(schedule.tool || '—')} · every {String(schedule.intervalMinutes ?? '?')}m · Next run: {String(
@@ -572,9 +572,9 @@
</div>{/each} </div>{/each}
</div>{/if}</Card </div>{/if}</Card
> >
<AnalyzerHistory <ContentScannerHistory
title="Processing history" title="Processing history"
description="Elements processed while scheduled analyzer work runs." description="Elements processed while scheduled content-scanning work runs."
/> />
{:else} {:else}
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-4"> <div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
@@ -610,9 +610,9 @@
</p> </p>
</div></Card </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> </div>
<AnalyzerHistory <ContentScannerHistory
title="Discovery history" title="Discovery history"
description="Discovered elements, statuses, and results." description="Discovered elements, statuses, and results."
/> />
@@ -4,7 +4,7 @@
import { SvelteSet } from 'svelte/reactivity' import { SvelteSet } from 'svelte/reactivity'
import { Button, Card, Metric, notify, SectionTitle } from '@gabriel20xx/web-ui' import { Button, Card, Metric, notify, SectionTitle } from '@gabriel20xx/web-ui'
import { get, post } from '$lib/api' 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 PipelineFlowDiagram from '$lib/components/PipelineFlowDiagram.svelte'
import { cn } from '$lib/utils/cn' 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 // 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 // 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 // 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 // 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 // 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. // 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 runDiscover = selectedStages.has('discover')
const stages = availableStageActions.filter( const stages = availableStageActions.filter(
(action) => selectedStages.has(action.key) && !(action.key === 'metadata' && runDiscover), (action) => selectedStages.has(action.key) && !(action.key === 'metadata' && runDiscover),
@@ -478,7 +478,7 @@
{/if} {/if}
</Card> </Card>
<AnalyzerHistory <ContentScannerHistory
{mediaType} {mediaType}
title={`Recent ${label.toLowerCase()} history`} title={`Recent ${label.toLowerCase()} history`}
description="Elements of this media type processed by the pipeline." description="Elements of this media type processed by the pipeline."
@@ -457,7 +457,7 @@
Loading media… Loading media…
</p>{:else if media.length === 0}<EmptyState </p>{:else if media.length === 0}<EmptyState
title="No catalog media found" 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"> />{:else}<div class="overflow-x-auto">
<table class="w-full min-w-[720px] text-left"> <table class="w-full min-w-[720px] text-left">
<thead <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 = export type ProjectIconName =
'image' | 'monitor-play' | 'play' | 'scan-search' | 'server' | 'settings-2' | 'shield-check' | 'wand-sparkles' 'image' | 'monitor-play' | 'play' | 'scan-search' | 'server' | 'settings-2' | 'shield-check' | 'wand-sparkles'