feat(web): SPA skeleton embedded in the binary (#60)
ci / web (push) Successful in 33s
ci / rust (push) Successful in 57s
e2e / e2e (push) Successful in 1m7s

This commit was merged in pull request #60.
This commit is contained in:
2026-08-22 21:07:40 +01:00
parent 94c334ffe9
commit 514628f089
22 changed files with 2277 additions and 2 deletions
+42
View File
@@ -0,0 +1,42 @@
// Hand-written mirror of arr-api's /api/health schema. `just gen-client`
// output (src/api/) is uncommitted, so CI's tsc cannot see it — this one
// endpoint stays hand-typed until the generated client is wired in.
export type CheckStatus = "ok" | "unreachable" | "unconfigured";
export interface Check {
status: CheckStatus;
detail?: string;
}
export interface HealthReport {
status: "ok" | "degraded";
version: string;
prowlarr: Check;
transmission: Check;
tmdb: Check;
}
export type Probe =
| { kind: "report"; report: HealthReport; roundtripMs: number }
| { kind: "unreachable"; detail: string };
/** One probe of the daemon. The endpoint always answers 200 with a verdict in
* the body; anything else means the daemon itself is the outage. */
export async function probeHealth(): Promise<Probe> {
const started = performance.now();
try {
const response = await fetch("/api/health");
if (!response.ok) {
return { kind: "unreachable", detail: `http ${response.status}` };
}
const report = (await response.json()) as HealthReport;
return {
kind: "report",
report,
roundtripMs: Math.round(performance.now() - started),
};
} catch {
return { kind: "unreachable", detail: "no response" };
}
}