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>
111 lines
5.1 KiB
React
111 lines
5.1 KiB
React
// RemoteConnectionEdit screen — remote media source connection form with address & API key.
|
|
(function () {
|
|
const NS = window.ChicoryTVDesignSystem_eb3b61;
|
|
const { Button, Card, Input } = NS;
|
|
const Ico = window.Ico;
|
|
const mono = { fontFamily: "var(--font-mono)", fontVariantNumeric: "tabular-nums" };
|
|
|
|
function RemoteConnectionEdit() {
|
|
const [isDirty, setIsDirty] = React.useState(false);
|
|
const [address, setAddress] = React.useState("http://192.168.1.50:8096");
|
|
const [apiKey, setApiKey] = React.useState("");
|
|
const [isSaving, setIsSaving] = React.useState(false);
|
|
|
|
const hasApiKey = true; // Simulate loaded state where key is already set
|
|
const family = "jellyfin";
|
|
const familyLabel = "Jellyfin";
|
|
|
|
const trimmedAddress = address.trim();
|
|
const isValidAddress = trimmedAddress && (() => {
|
|
try {
|
|
const url = new URL(trimmedAddress);
|
|
return url.protocol === "http:" || url.protocol === "https:";
|
|
} catch {
|
|
return false;
|
|
}
|
|
})();
|
|
|
|
const apiKeyValid = hasApiKey || apiKey.trim().length > 0;
|
|
const isValid = isValidAddress && apiKeyValid;
|
|
const showAddressError = trimmedAddress && !isValidAddress;
|
|
|
|
const handleAddressChange = (e) => {
|
|
setAddress(e.target.value);
|
|
setIsDirty(true);
|
|
};
|
|
|
|
const handleApiKeyChange = (e) => {
|
|
setApiKey(e.target.value);
|
|
setIsDirty(true);
|
|
};
|
|
|
|
return (
|
|
<div style={{ display: "flex", flexDirection: "column", height: "100%" }}>
|
|
{/* Header section */}
|
|
<section style={{ display: "flex", alignItems: "flex-start", justifyContent: "space-between", padding: "24px 20px", borderBottom: "1px solid var(--border-hairline)", flex: "0 0 auto" }}>
|
|
<div>
|
|
<div style={{ font: "var(--weight-medium) var(--text-xs)/1.2 var(--font-sans)", textTransform: "uppercase", letterSpacing: "0.04em", color: "var(--text-secondary)", marginBottom: 8 }}>Media source</div>
|
|
<h2 style={{ margin: "0 0 8px 0", font: "var(--weight-semibold) var(--text-2xl)/1.2 var(--font-sans)", color: "var(--text-primary)" }}>Edit {familyLabel} connection</h2>
|
|
<p style={{ margin: 0, font: "var(--text-sm)/1.4 var(--font-sans)", color: "var(--text-secondary)", maxWidth: 600 }}>Point ErsatzTV at your {familyLabel} server and authenticate with an API key.</p>
|
|
</div>
|
|
<div style={{ flex: "0 0 auto", marginLeft: 20 }}>
|
|
<Button variant="ghost" startIcon={<Ico n="ArrowLeft" s={14} />}>Back to {familyLabel}</Button>
|
|
</div>
|
|
</section>
|
|
|
|
{/* Scrollable content */}
|
|
<div style={{ flex: 1, overflow: "auto", padding: "20px 20px" }}>
|
|
<div style={{ maxWidth: 600 }}>
|
|
{/* Connection Card */}
|
|
<Card
|
|
title={<h3 style={{ margin: 0, font: "var(--weight-semibold) var(--text-lg)/1.2 var(--font-sans)", color: "var(--text-primary)" }}>Connection</h3>}
|
|
subtitle={`${familyLabel} server address and API key.`}
|
|
padded
|
|
>
|
|
<div style={{ display: "flex", flexDirection: "column", gap: 16 }}>
|
|
<Input
|
|
label="Address"
|
|
value={address}
|
|
onChange={handleAddressChange}
|
|
placeholder="http://192.168.1.50:8096"
|
|
disabled={isSaving}
|
|
error={showAddressError ? "Enter a valid absolute http(s) URL" : null}
|
|
fullWidth
|
|
/>
|
|
|
|
<div>
|
|
<Input
|
|
label="API key"
|
|
type="password"
|
|
value={apiKey}
|
|
onChange={handleApiKeyChange}
|
|
placeholder={hasApiKey ? "Key is set — leave blank to keep, or enter a new key" : "Enter an API key"}
|
|
disabled={isSaving}
|
|
error={!apiKeyValid && apiKey.length === 0 && !hasApiKey ? "API key is required" : null}
|
|
fullWidth
|
|
/>
|
|
{hasApiKey && (
|
|
<div style={{ marginTop: 8, font: "var(--text-xs)/1.4 var(--font-sans)", color: "var(--text-secondary)", padding: "0 0 0 0" }}>
|
|
Key is set — leave blank to keep the existing key, or enter a new key to replace it.
|
|
</div>
|
|
)}
|
|
</div>
|
|
</div>
|
|
</Card>
|
|
</div>
|
|
</div>
|
|
|
|
{/* Footer toolbar */}
|
|
<div style={{ display: "flex", alignItems: "center", justifyContent: "flex-end", gap: 8, padding: "12px 20px", borderTop: "1px solid var(--border-hairline)", flex: "0 0 auto", minHeight: 58, background: "var(--surface-app)" }}>
|
|
<Button variant="ghost" disabled={!isDirty || isSaving} onClick={() => setIsDirty(false)}>Discard</Button>
|
|
<Button variant="primary" disabled={!isValid || !isDirty || isSaving} loading={isSaving} startIcon={<Ico n="Check" s={14} />} onClick={() => setIsSaving(true)}>
|
|
Save connection
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
window.CTVRemoteConnectionEdit = RemoteConnectionEdit;
|
|
})();
|