Hub 2.0 step 3: releases per product, with requirements
- Release.product and requires; unique (product, version); latest version per product (latest_version stays Cross Events' latest) - Release sources per product (Releases page): repository, tag prefix, notes file. Defaults: every product from crosscode-platform plus Cross Events' v1.2.3 tags from hope-events. A product's releases are only removed when all its sources were read and found tags - "— requires accounts 1.2.0" in a notes heading: Request update answers 409 REQUIREMENT_NOT_MET until the church's install of that product is new enough; install page and Releases page show it; v2 replies carry requires - @crosscode/contracts 1.1.0 vendored (optional requires on releases) - Alerts, dashboard and install lists compare against each product's latest Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,7 @@ import { ago, bytes, fmtDate, rand, randFine } from "@/lib/format";
|
||||
import { usePaged } from "@/lib/paging";
|
||||
import { tierForBand, tierPrice } from "@/lib/tiers";
|
||||
import { PRODUCT_NAMES } from "@/lib/products";
|
||||
import type { AiHelperUse, AiMonth, AiStatus, Health, InstallEvent, InstallSummary, Licence, Stats } from "@/lib/types";
|
||||
import type { AiHelperUse, AiMonth, AiStatus, Health, InstallEvent, InstallSummary, Licence, Stats, UnmetRequirement } from "@/lib/types";
|
||||
import { Badge, Loading, Message, PageTitle, Pager } from "@/components/ui";
|
||||
|
||||
type Detail = {
|
||||
@@ -23,6 +23,7 @@ type Detail = {
|
||||
events: InstallEvent[];
|
||||
heartbeats: { receivedAt: string; version: string | null; stats: Stats | null }[];
|
||||
ai: { status: AiStatus; months: AiMonth[]; helpers: AiHelperUse[] };
|
||||
update: { latestVersion: string | null; behind: boolean; unmetRequirements: UnmetRequirement[] };
|
||||
};
|
||||
|
||||
const NO_EVENTS: InstallEvent[] = [];
|
||||
@@ -74,12 +75,22 @@ export default function InstallPage() {
|
||||
{d.summary.problems.map(p => <div key={p.type} className="flex items-center gap-2 text-sm"><Badge value={p.level} /> {p.message}</div>)}
|
||||
</div>
|
||||
)}
|
||||
{d.update.unmetRequirements.length > 0 && (
|
||||
<div className="card mb-6 border-amber-200 bg-amber-50 text-sm text-amber-900">
|
||||
<p className="font-medium">Updating to {d.update.latestVersion} needs the church's other products first, so Request update is refused until then:</p>
|
||||
<ul className="mt-1 list-disc pl-5">
|
||||
{d.update.unmetRequirements.map(u => (
|
||||
<li key={u.product}>{PRODUCT_NAMES[u.product]} {u.version} or later{u.current ? ` (it runs ${u.current})` : " (not installed)"}</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="grid gap-6 md:grid-cols-2">
|
||||
<div className="card">
|
||||
<h2 className="mb-2 font-semibold">Health</h2>
|
||||
<Row k="Last heartbeat" v={`${ago(d.lastHeartbeatAt)} (${fmtDate(d.lastHeartbeatAt)})`} />
|
||||
<Row k="Version" v={`${d.version || "—"}${d.summary.behind ? " (behind)" : ""}`} />
|
||||
<Row k="Version" v={`${d.version || "—"}${d.summary.behind ? ` (latest ${d.update.latestVersion})` : ""}`} />
|
||||
<Row k="Database" v={h.db === false ? "Not OK" : h.db ? "OK" : "—"} />
|
||||
<Row k="Background jobs" v={h.jobs ? `${h.jobs.mode || "?"}, ${h.jobs.failedLast24h ?? 0} failed (24 h)` : "—"} />
|
||||
<Row k="Last backup" v={h.lastBackupAt ? `${ago(h.lastBackupAt)}` : "none reported"} />
|
||||
|
||||
Reference in New Issue
Block a user