Build ErsatzTV Image / Docs update reminder (push) Has been skipped
Build ErsatzTV Image / decisions.md append-only (push) Has been skipped
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (push) Has been skipped
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (push) Has been skipped
Build ErsatzTV Image / Functional E2E (curl contracts) (push) Successful in 4m46s
Build ErsatzTV Image / Build & test (.NET) (push) Successful in 11m26s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (push) Successful in 13m34s
Build ErsatzTV Image / Build & push image (amd64) (push) Failing after 16s
Bulk mirror sweep (#388): author/rebuild a prototype mockup for every shipped SPA screen so the Claude Design project (eb3b6122 / local design-system/) faithfully reflects prod. - 40 screens authored (mockups: visual/layout parity, no logic) via a fan-out workflow; 8 stale prototypes rebuilt (Dashboard, ChannelBuilder, Guide, Schedules, Playouts, Settings, …), 32 net-new (media/sources/system/auth). Retired Epg/ScheduleEditor/ScheduleLibrary. - New screens.js = single source of truth for the inventory; Shell.jsx nav + app.html screen map both build from it (nav groups mirror web/src/app/routes.tsx). app.html is now hash-routed. - All 42 views verified rendering headlessly across the 3 themes (126/126, 0 real errors). - design-sync-reminder.sh hook (+ settings.json): mechanical, fail-open, once/session nudge to pull-first (PreToolUse Write|Edit on web/src/**.{tsx,css}) and mirror/push-back (Stop) — keeps the design system from drifting from prod going forward. - docs/design-sync.md: document the bulk-sweep structure + the reminder hook. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
128 lines
7.2 KiB
React
128 lines
7.2 KiB
React
// RemoteSource screen — shared Jellyfin/Emby connection screen: a connection
|
|
// card (connect / edit / disconnect) plus a server list with per-server
|
|
// refresh + library/path-replacement shortcuts. Mirrors RemoteSourceScreen.tsx.
|
|
(function () {
|
|
const NS = window.ChicoryTVDesignSystem_eb3b61;
|
|
const { Button, IconButton, StatusDot, Card, Spinner, Tooltip } = NS;
|
|
const Ico = window.Ico;
|
|
const mono = { fontFamily: "var(--font-mono)", fontVariantNumeric: "tabular-nums" };
|
|
|
|
const SERVERS = [
|
|
{ id: 1, name: "Living Room Jellyfin", address: "https://jellyfin.tblindustries.be:8920", locked: false, libraries: 6 },
|
|
{ id: 2, name: "Basement NAS", address: "http://192.168.1.44:8096", locked: true, libraries: 3 },
|
|
];
|
|
|
|
function Kicker({ children }) {
|
|
return <span style={{ display: "block", font: "var(--weight-semibold) var(--text-2xs)/1 var(--font-sans)", letterSpacing: "0.06em", textTransform: "uppercase", color: "var(--text-disabled)", marginBottom: 6 }}>{children}</span>;
|
|
}
|
|
|
|
function ServerRow({ server }) {
|
|
const [hover, setHover] = React.useState(false);
|
|
return (
|
|
<div
|
|
onMouseEnter={() => setHover(true)}
|
|
onMouseLeave={() => setHover(false)}
|
|
style={{ display: "flex", alignItems: "center", gap: 14, padding: "14px var(--pad-cell-x)", borderTop: "1px solid var(--border-hairline)", background: hover ? "var(--ctv-surface-2)" : "transparent", transition: "background var(--dur-fast)" }}
|
|
>
|
|
<span style={{ display: "inline-flex", alignItems: "center", justifyContent: "center", width: 34, height: 34, borderRadius: "var(--radius-sm)", background: "var(--ctv-surface-3)", flex: "0 0 auto" }}>
|
|
<Ico n="Server" s={16} color="var(--text-secondary)" />
|
|
</span>
|
|
<div style={{ minWidth: 0, flex: 1 }}>
|
|
<div style={{ display: "flex", alignItems: "center", gap: 8 }}>
|
|
<span style={{ font: "var(--weight-medium) var(--text-sm)/1.2 var(--font-sans)", color: "var(--text-primary)" }}>{server.name}</span>
|
|
<span style={{ ...mono, font: "var(--text-2xs)/1 var(--font-mono)", color: "var(--text-disabled)" }}>{server.libraries} libraries</span>
|
|
</div>
|
|
<div style={{ marginTop: 3, font: "var(--text-xs)/1.3 var(--font-sans)", color: "var(--text-faint)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{server.address}</div>
|
|
</div>
|
|
<div style={{ display: "flex", alignItems: "center", gap: 14, flex: "0 0 auto" }}>
|
|
<StatusDot status={server.locked ? "live" : "ok"} label={server.locked ? "Busy" : "Ready"} size={7} />
|
|
<Tooltip label={server.locked ? "Scan in progress" : "Refresh libraries"}>
|
|
<IconButton size="sm" title={`Refresh ${server.name}`} disabled={server.locked}>
|
|
{server.locked ? <Spinner size={14} tone="muted" /> : <Ico n="RefreshCw" s={15} />}
|
|
</IconButton>
|
|
</Tooltip>
|
|
<Button size="sm" variant="ghost">Edit Libraries</Button>
|
|
<Button size="sm" variant="ghost">Edit Path Replacements</Button>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
function RemoteSource() {
|
|
const [connected, setConnected] = React.useState(true);
|
|
|
|
return (
|
|
<div style={{ display: "flex", flexDirection: "column", height: "100%" }}>
|
|
{/* header */}
|
|
<div style={{ display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 16, padding: "16px 20px", borderBottom: "1px solid var(--border-hairline)", flex: "0 0 auto" }}>
|
|
<div>
|
|
<Kicker>Media source</Kicker>
|
|
<div style={{ display: "flex", alignItems: "center", gap: 10 }}>
|
|
<span style={{ display: "inline-flex", alignItems: "center", justifyContent: "center", width: 30, height: 30, borderRadius: "var(--radius-sm)", background: "var(--ctv-accent-soft)" }}>
|
|
<Ico n="Server" s={16} color="var(--ctv-accent)" />
|
|
</span>
|
|
<span style={{ font: "var(--weight-semibold) var(--text-xl)/1.1 var(--font-sans)", color: "var(--text-primary)" }}>Jellyfin</span>
|
|
</div>
|
|
<p style={{ margin: "8px 0 0", font: "var(--text-sm)/1.4 var(--font-sans)", color: "var(--text-secondary)", maxWidth: 480 }}>
|
|
Connect a Jellyfin server and choose which libraries to sync.
|
|
</p>
|
|
</div>
|
|
<div style={{ display: "flex", alignItems: "center", gap: 10 }}>
|
|
{/* demo-only toggle to preview connected / empty states, not part of the live screen */}
|
|
<div style={{ display: "inline-flex", gap: 2, padding: 2, borderRadius: "var(--radius-sm)", background: "var(--ctv-bg-sunken)", border: "1px solid var(--border-hairline)" }}>
|
|
{[{ v: true, l: "Connected" }, { v: false, l: "Not connected" }].map((o) => {
|
|
const on = o.v === connected;
|
|
return (
|
|
<button key={o.l} type="button" onClick={() => setConnected(o.v)}
|
|
style={{ height: 26, padding: "0 11px", border: "none", borderRadius: "var(--radius-xs)", cursor: "pointer", background: on ? "var(--ctv-surface-3)" : "transparent", color: on ? "var(--text-primary)" : "var(--text-secondary)", font: `${on ? "var(--weight-medium)" : "var(--weight-normal)"} var(--text-xs)/1 var(--font-sans)` }}>
|
|
{o.l}
|
|
</button>
|
|
);
|
|
})}
|
|
</div>
|
|
<Button variant="ghost" startIcon={<Ico n="ArrowLeft" s={14} />}>Back to libraries</Button>
|
|
</div>
|
|
</div>
|
|
|
|
<div style={{ flex: 1, overflow: "auto", padding: "16px 20px", display: "flex", flexDirection: "column", gap: 16 }}>
|
|
<Card
|
|
title={<h3 style={{ margin: 0, font: "var(--weight-semibold) var(--text-md)/1.2 var(--font-sans)" }}>Connection</h3>}
|
|
subtitle={connected ? "Connected to Jellyfin." : "No Jellyfin server connected."}
|
|
actions={
|
|
<div style={{ display: "flex", gap: 8 }}>
|
|
<Button startIcon={<Ico n="Plug" s={14} />} variant={connected ? "secondary" : "primary"}>
|
|
{connected ? "Edit connection" : "Connect"}
|
|
</Button>
|
|
{connected && (
|
|
<Button startIcon={<Ico n="Unplug" s={14} />} variant="secondary">Disconnect</Button>
|
|
)}
|
|
</div>
|
|
}
|
|
>
|
|
{!connected && (
|
|
<div style={{ padding: "18px 4px", display: "flex", alignItems: "center", gap: 10, color: "var(--text-faint)", font: "var(--text-sm)/1.4 var(--font-sans)" }}>
|
|
<Ico n="PlugZap" s={16} color="var(--text-disabled)" />
|
|
Connect a Jellyfin server to sync libraries.
|
|
</div>
|
|
)}
|
|
</Card>
|
|
|
|
{connected && (
|
|
<Card
|
|
title={<h3 style={{ margin: 0, font: "var(--weight-semibold) var(--text-md)/1.2 var(--font-sans)" }}>Servers</h3>}
|
|
subtitle={`${SERVERS.length} servers.`}
|
|
padded={false}
|
|
>
|
|
<div role="list" aria-label="Jellyfin servers">
|
|
{SERVERS.map((s) => <ServerRow key={s.id} server={s} />)}
|
|
</div>
|
|
</Card>
|
|
)}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
window.CTVRemoteSource = RemoteSource;
|
|
})();
|