Releases with what's new, notices to churches, withdrawn update requests

- Releases page: each Cross Events version with notes and an urgent flag; the
  newest is the latest version (moved off Settings; the old setting becomes the
  first release). Installs get the notes for every newer version.
- Notices page: a banner for site admins and supervisors (with a time window),
  an email to the customer and admin contact, or both; for every install or
  chosen ones.
- POST /api/installs/update-request/cancel resolves the request and emails Joshua.
- Protocol doc: releases and notices in the heartbeat/register replies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-28 08:54:35 +02:00
co-authored by Claude Opus 5.5
parent 26e12a199a
commit 1449e5046e
18 changed files with 900 additions and 12 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ export default function AlertsPage() {
return (
<>
<PageTitle title="Alerts" subtitle="Checked every 5 minutes. New warnings and critical alerts are emailed once (Settings → Releases and alerts → Alert email)." />
<PageTitle title="Alerts" subtitle="Checked every 5 minutes. New warnings and critical alerts are emailed once (Settings → Alerts → Alert email)." />
<div className="mb-4 flex flex-wrap gap-2">
<button className={openOnly ? "btn-primary" : "btn-secondary"} onClick={() => setOpenOnly(true)}>Open</button>
<button className={!openOnly ? "btn-primary" : "btn-secondary"} onClick={() => setOpenOnly(false)}>Everything</button>
+3 -1
View File
@@ -3,7 +3,7 @@
import React, { useEffect, useState } from "react";
import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
import { LayoutDashboard, Building2, BellRing, Settings, LogOut } from "lucide-react";
import { LayoutDashboard, Building2, BellRing, Settings, LogOut, Rocket, Megaphone } from "lucide-react";
import { api, getToken, setToken } from "@/lib/api";
import { Logo } from "@/components/ui";
@@ -13,6 +13,8 @@ const NAV = [
{ href: "/", label: "Installs", icon: LayoutDashboard },
{ href: "/customers", label: "Customers", icon: Building2 },
{ href: "/alerts", label: "Alerts", icon: BellRing },
{ href: "/releases", label: "Releases", icon: Rocket },
{ href: "/notices", label: "Notices", icon: Megaphone },
{ href: "/settings", label: "Settings", icon: Settings },
];
+215
View File
@@ -0,0 +1,215 @@
"use client";
import React, { useCallback, useEffect, useMemo, useState } from "react";
import { Mail, Megaphone } from "lucide-react";
import { api, errorText } from "@/lib/api";
import { fmtDate } from "@/lib/format";
import { matches } from "@/lib/paging";
import type { InstallSummary, Notice, NoticeLevel } from "@/lib/types";
import { Badge, Loading, Message, PageTitle, SearchInput } from "@/components/ui";
type Msg = { type: "ok" | "err"; text: string } | null;
const LEVELS: { key: NoticeLevel; label: string; hint: string }[] = [
{ key: "info", label: "Information", hint: "Blue banner" },
{ key: "maintenance", label: "Planned maintenance", hint: "Amber banner" },
{ key: "warning", label: "Important", hint: "Red banner" },
];
const LEVEL_LABEL = Object.fromEntries(LEVELS.map(l => [l.key, l.label])) as Record<NoticeLevel, string>;
// <input type="datetime-local"> works in the browser's time; the API takes ISO.
const toInput = (d: string | null) => {
if (!d) return "";
const x = new Date(d);
return new Date(x.getTime() - x.getTimezoneOffset() * 60000).toISOString().slice(0, 16);
};
const fromInput = (v: string) => (v ? new Date(v).toISOString() : null);
type Form = { title: string; message: string; level: NoticeLevel; allInstalls: boolean; installIds: string[]; showBanner: boolean; sendEmail: boolean; startsAt: string; endsAt: string };
const empty = (): Form => ({ title: "", message: "", level: "info", allInstalls: true, installIds: [], showBanner: true, sendEmail: false, startsAt: "", endsAt: "" });
function state(n: Notice, now = Date.now()) {
if (!n.showBanner) return { label: "Email only", value: "info" as const };
if (n.endsAt && new Date(n.endsAt).getTime() <= now) return { label: "Ended", value: "info" as const };
if (n.startsAt && new Date(n.startsAt).getTime() > now) return { label: "Scheduled", value: "warning" as const };
return { label: "Showing", value: "ok" as const };
}
/** Pick every install or some of them. */
function Audience({ installs, form, setForm }: { installs: InstallSummary[]; form: Form; setForm: (f: Form) => void }) {
const [query, setQuery] = useState("");
const shown = useMemo(() => installs.filter(i => matches(query, i.name, i.url, i.customer?.name)), [installs, query]);
const toggle = (id: string) => setForm({ ...form, installIds: form.installIds.includes(id) ? form.installIds.filter(x => x !== id) : [...form.installIds, id] });
return (
<fieldset className="space-y-2">
<legend className="label">Who gets it</legend>
<div className="flex flex-wrap gap-4 text-sm">
<label className="flex items-center gap-2"><input type="radio" checked={form.allInstalls} onChange={() => setForm({ ...form, allInstalls: true })} /> Every install</label>
<label className="flex items-center gap-2"><input type="radio" checked={!form.allInstalls} onChange={() => setForm({ ...form, allInstalls: false })} /> Chosen installs ({form.installIds.length})</label>
</div>
{!form.allInstalls && (
<div className="rounded-lg border border-slate-200 p-3">
<SearchInput className="mb-2" value={query} onChange={setQuery} placeholder="Search installs" />
<div className="max-h-56 space-y-1 overflow-y-auto">
{shown.length === 0 && <p className="text-sm text-slate-500">No installs match.</p>}
{shown.map(i => (
<label key={i.id} className="flex items-center gap-2 text-sm">
<input type="checkbox" checked={form.installIds.includes(i.id)} onChange={() => toggle(i.id)} />
<span className="font-medium">{i.customer?.name || i.name}</span>
<span className="truncate text-xs text-slate-500">{i.url}</span>
</label>
))}
</div>
</div>
)}
</fieldset>
);
}
function NoticeForm({ initial, installs, editing, busy, onSave, onCancel }: { initial: Form; installs: InstallSummary[]; editing: boolean; busy: boolean; onSave: (f: Form) => void; onCancel: () => void }) {
const [form, setForm] = useState(initial);
return (
<form onSubmit={e => { e.preventDefault(); onSave(form); }} className="space-y-4">
<div className="grid gap-3 sm:grid-cols-3">
<div className="sm:col-span-2">
<label className="label" htmlFor="n_title">Title</label>
<input id="n_title" className="input" maxLength={120} placeholder="Planned maintenance on Saturday evening" value={form.title} onChange={e => setForm({ ...form, title: e.target.value })} required />
</div>
<div>
<label className="label" htmlFor="n_level">Kind</label>
<select id="n_level" className="input" value={form.level} onChange={e => setForm({ ...form, level: e.target.value as NoticeLevel })}>
{LEVELS.map(l => <option key={l.key} value={l.key}>{l.label} — {l.hint}</option>)}
</select>
</div>
</div>
<div>
<label className="label" htmlFor="n_message">Message</label>
<textarea id="n_message" className="input min-h-28" maxLength={2000} value={form.message} onChange={e => setForm({ ...form, message: e.target.value })} required placeholder="The site will be unavailable for about 30 minutes while we update the server." />
</div>
<Audience installs={installs} form={form} setForm={setForm} />
<fieldset className="space-y-2">
<legend className="label">How</legend>
<label className="flex items-center gap-2 text-sm"><input type="checkbox" checked={form.showBanner} onChange={e => setForm({ ...form, showBanner: e.target.checked })} /> <Megaphone className="h-4 w-4 text-slate-400" /> Banner on the site for site admins and supervisors</label>
{!editing && <label className="flex items-center gap-2 text-sm"><input type="checkbox" checked={form.sendEmail} onChange={e => setForm({ ...form, sendEmail: e.target.checked })} /> <Mail className="h-4 w-4 text-slate-400" /> Email the church now (customer email and the site&apos;s admin contact)</label>}
</fieldset>
{form.showBanner && (
<div className="grid gap-3 sm:grid-cols-2">
<div>
<label className="label" htmlFor="n_starts">Show from</label>
<input id="n_starts" type="datetime-local" className="input" value={form.startsAt} onChange={e => setForm({ ...form, startsAt: e.target.value })} />
<p className="mt-1 text-xs text-slate-500">Blank: straight away (within 15 minutes, at the site&apos;s next heartbeat).</p>
</div>
<div>
<label className="label" htmlFor="n_ends">Until</label>
<input id="n_ends" type="datetime-local" className="input" value={form.endsAt} onChange={e => setForm({ ...form, endsAt: e.target.value })} />
<p className="mt-1 text-xs text-slate-500">Blank: until you end it.</p>
</div>
</div>
)}
<div className="flex flex-wrap gap-2">
<button className="btn-primary" disabled={busy}>{busy ? "Saving…" : editing ? "Save notice" : form.sendEmail ? "Create and email" : "Create notice"}</button>
<button type="button" className="btn-secondary" onClick={onCancel}>Cancel</button>
</div>
</form>
);
}
/** Messages to churches: a banner on their site and/or an email. */
export default function NoticesPage() {
const [notices, setNotices] = useState<Notice[] | null>(null);
const [installs, setInstalls] = useState<InstallSummary[]>([]);
const [msg, setMsg] = useState<Msg>(null);
const [adding, setAdding] = useState(false);
const [editing, setEditing] = useState<string | null>(null);
const [busy, setBusy] = useState(false);
const load = useCallback(() => api<Notice[]>("/api/admin/notices").then(setNotices).catch(e => setMsg({ type: "err", text: errorText(e) })), []);
useEffect(() => {
load();
api<InstallSummary[]>("/api/admin/installs").then(rows => setInstalls(rows.filter(i => !i.releasedAt))).catch(() => {});
}, [load]);
const installName = (id: string) => { const i = installs.find(x => x.id === id); return i ? i.customer?.name || i.name : "(removed install)"; };
const save = async (f: Form, id?: string) => {
if (!id && f.sendEmail && !confirm(`Email "${f.title}" to ${f.allInstalls ? "every church" : `${f.installIds.length} church${f.installIds.length === 1 ? "" : "es"}`} now?`)) return;
setBusy(true);
setMsg(null);
try {
const body = { title: f.title, message: f.message, level: f.level, allInstalls: f.allInstalls, installIds: f.allInstalls ? [] : f.installIds, showBanner: f.showBanner, startsAt: fromInput(f.startsAt), endsAt: fromInput(f.endsAt), ...(id ? {} : { sendEmail: f.sendEmail }) };
const n = await api<Notice>(id ? `/api/admin/notices/${id}` : "/api/admin/notices", { method: id ? "PUT" : "POST", body });
const parts = [id ? "Saved." : "Created."];
if (!id && f.sendEmail) parts.push(`Emailed ${n.emailedTo} address${n.emailedTo === 1 ? "" : "es"}.`);
if (n.showBanner) parts.push("Sites show the banner after their next heartbeat (within 15 minutes).");
setMsg({ type: "ok", text: parts.join(" ") });
setAdding(false);
setEditing(null);
load();
} catch (e) { setMsg({ type: "err", text: errorText(e) }); } finally { setBusy(false); }
};
const endNow = async (n: Notice) => {
try {
await api(`/api/admin/notices/${n.id}`, { method: "PUT", body: { endsAt: new Date().toISOString() } });
setMsg({ type: "ok", text: "Ended. Sites take the banner down after their next heartbeat (within 15 minutes)." });
load();
} catch (e) { setMsg({ type: "err", text: errorText(e) }); }
};
const remove = async (n: Notice) => {
if (!confirm(`Delete "${n.title}"?`)) return;
try {
await api(`/api/admin/notices/${n.id}`, { method: "DELETE" });
load();
} catch (e) { setMsg({ type: "err", text: errorText(e) }); }
};
return (
<>
<PageTitle
title="Notices"
subtitle="Tell churches about maintenance or anything else: a banner on their site for site admins and supervisors, an email, or both."
actions={!adding && <button className="btn-primary" onClick={() => { setAdding(true); setEditing(null); }}>New notice</button>}
/>
{msg && <div className="mb-4"><Message msg={msg} /></div>}
{adding && <div className="card mb-6"><h2 className="mb-3 font-semibold">New notice</h2><NoticeForm initial={empty()} installs={installs} editing={false} busy={busy} onSave={f => save(f)} onCancel={() => setAdding(false)} /></div>}
{!notices ? <Loading /> : notices.length === 0 ? <p className="text-sm text-slate-500">No notices yet.</p> : (
<div className="space-y-4">
{notices.map(n => {
const st = state(n);
return (
<div key={n.id} className="card">
{editing === n.id ? (
<NoticeForm
initial={{ title: n.title, message: n.message, level: n.level, allInstalls: n.allInstalls, installIds: n.installIds, showBanner: n.showBanner, sendEmail: false, startsAt: toInput(n.startsAt), endsAt: toInput(n.endsAt) }}
installs={installs} editing busy={busy} onSave={f => save(f, n.id)} onCancel={() => setEditing(null)}
/>
) : (
<>
<div className="mb-1 flex flex-wrap items-center gap-2">
<h2 className="font-semibold">{n.title}</h2>
<Badge value={st.value} label={st.label} />
<span className="text-xs text-slate-500">{LEVEL_LABEL[n.level]}</span>
<span className="ml-auto flex gap-2">
{st.label === "Showing" || st.label === "Scheduled" ? <button className="btn-secondary px-2 py-1 text-xs" onClick={() => endNow(n)}>End now</button> : null}
<button className="btn-secondary px-2 py-1 text-xs" onClick={() => { setEditing(n.id); setAdding(false); }}>Edit</button>
<button className="btn-danger px-2 py-1 text-xs" onClick={() => remove(n)}>Delete</button>
</span>
</div>
<p className="whitespace-pre-line text-sm text-slate-700">{n.message}</p>
<div className="mt-2 flex flex-wrap gap-x-4 gap-y-1 text-xs text-slate-500">
<span>To: {n.allInstalls ? "every install" : n.installIds.map(installName).join(", ")}</span>
{n.showBanner && <span>Banner: {n.startsAt ? fmtDate(n.startsAt) : "from creation"} → {n.endsAt ? fmtDate(n.endsAt) : "until ended"}</span>}
{n.emailedAt && <span>Emailed {fmtDate(n.emailedAt)} to {n.emailedTo} address{n.emailedTo === 1 ? "" : "es"}</span>}
</div>
</>
)}
</div>
);
})}
</div>
)}
</>
);
}
+1 -1
View File
@@ -49,7 +49,7 @@ export default function OverviewPage() {
return (
<>
<PageTitle title="Installs" subtitle={data.latestVersion ? `Latest release: ${data.latestVersion}` : "Set the latest release in Settings to see who is behind."} />
<PageTitle title="Installs" subtitle={data.latestVersion ? `Latest release: ${data.latestVersion}` : "Add the latest release on the Releases page to see who is behind."} />
<div className="mb-6 grid grid-cols-2 gap-3 md:grid-cols-5">
<Stat label="Installs" value={c.installs} />
<Stat label="Healthy" value={c.healthy} tone="green" />
+119
View File
@@ -0,0 +1,119 @@
"use client";
import React, { useCallback, useEffect, useState } from "react";
import { ShieldAlert } from "lucide-react";
import { api, errorText } from "@/lib/api";
import { fmtDate } from "@/lib/format";
import type { Release } from "@/lib/types";
import { Badge, Loading, Message, PageTitle, ReleaseNotes } from "@/components/ui";
type Msg = { type: "ok" | "err"; text: string } | null;
type Form = { version: string; notes: string; urgent: boolean; releasedAt: string };
const today = () => new Date().toISOString().slice(0, 10);
const empty = (): Form => ({ version: "", notes: "", urgent: false, releasedAt: today() });
/** Add or edit one release. */
function ReleaseForm({ initial, onSave, onCancel, busy }: { initial: Form; onSave: (f: Form) => void; onCancel?: () => void; busy: boolean }) {
const [form, setForm] = useState(initial);
return (
<form onSubmit={e => { e.preventDefault(); onSave(form); }} className="space-y-3">
<div className="grid gap-3 sm:grid-cols-3">
<div>
<label className="label" htmlFor="rel_version">Version</label>
<input id="rel_version" className="input" placeholder="1.47.0" value={form.version} onChange={e => setForm({ ...form, version: e.target.value })} required />
</div>
<div>
<label className="label" htmlFor="rel_date">Released</label>
<input id="rel_date" type="date" className="input" value={form.releasedAt} onChange={e => setForm({ ...form, releasedAt: e.target.value })} />
</div>
<label className="flex items-center gap-2 self-end pb-2 text-sm">
<input type="checkbox" checked={form.urgent} onChange={e => setForm({ ...form, urgent: e.target.checked })} />
Urgent (security or serious bug fix)
</label>
</div>
<div>
<label className="label" htmlFor="rel_notes">What&apos;s new</label>
<textarea id="rel_notes" className="input min-h-40 font-mono" value={form.notes} onChange={e => setForm({ ...form, notes: e.target.value })} placeholder={"Written for the church, not for developers.\n- Volunteer rosters: plan who serves where\n- Fixed: kids tickets were offered publicly"} />
<p className="mt-1 text-xs text-slate-500">Lines starting with &quot;- &quot; show as a list. Churches see this on Site settings → Licence before they ask for the update.{form.urgent && " Urgent releases can't be put off with \"Not now\"."}</p>
</div>
<div className="flex flex-wrap gap-2">
<button className="btn-primary" disabled={busy}>{busy ? "Saving…" : "Save release"}</button>
{onCancel && <button type="button" className="btn-secondary" onClick={onCancel}>Cancel</button>}
</div>
</form>
);
}
/** Cross Events versions and what's new in each. The newest is the latest version installs are offered. */
export default function ReleasesPage() {
const [releases, setReleases] = useState<Release[] | null>(null);
const [msg, setMsg] = useState<Msg>(null);
const [adding, setAdding] = useState(false);
const [editing, setEditing] = useState<string | null>(null);
const [busy, setBusy] = useState(false);
const load = useCallback(() => api<Release[]>("/api/admin/releases").then(setReleases).catch(e => setMsg({ type: "err", text: errorText(e) })), []);
useEffect(() => { load(); }, [load]);
const body = (f: Form) => ({ version: f.version, notes: f.notes, urgent: f.urgent, releasedAt: f.releasedAt ? `${f.releasedAt}T12:00:00+02:00` : null });
const save = async (f: Form, id?: string) => {
setBusy(true);
setMsg(null);
try {
const r = await api<{ latestVersion: string | null }>(id ? `/api/admin/releases/${id}` : "/api/admin/releases", { method: id ? "PUT" : "POST", body: body(f) });
setMsg({ type: "ok", text: `Saved. The latest version is ${r.latestVersion || "not set"}; installs see it with their next heartbeat (within 15 minutes).` });
setAdding(false);
setEditing(null);
load();
} catch (e) { setMsg({ type: "err", text: errorText(e) }); } finally { setBusy(false); }
};
const remove = async (r: Release) => {
if (!confirm(`Delete release ${r.version}? Installs stop being offered it${releases?.[0]?.id === r.id ? ", and the version before it becomes the latest" : ""}.`)) return;
try {
const res = await api<{ latestVersion: string | null }>(`/api/admin/releases/${r.id}`, { method: "DELETE" });
setMsg({ type: "ok", text: `Deleted. The latest version is ${res.latestVersion || "not set"}.` });
load();
} catch (e) { setMsg({ type: "err", text: errorText(e) }); }
};
return (
<>
<PageTitle
title="Releases"
subtitle="Each Cross Events version and what's new in it. The newest is the latest version: installs on an older one see “Update available” with the notes for every version they'd get."
actions={!adding && <button className="btn-primary" onClick={() => { setAdding(true); setEditing(null); }}>Add release</button>}
/>
{msg && <div className="mb-4"><Message msg={msg} /></div>}
{adding && <div className="card mb-6"><h2 className="mb-3 font-semibold">New release</h2><ReleaseForm initial={empty()} busy={busy} onSave={f => save(f)} onCancel={() => setAdding(false)} /></div>}
{!releases ? <Loading /> : releases.length === 0 ? <p className="text-sm text-slate-500">No releases yet. Add the version installs should be on.</p> : (
<div className="space-y-4">
{releases.map((r, i) => (
<div key={r.id} className="card">
{editing === r.id ? (
<ReleaseForm initial={{ version: r.version, notes: r.notes, urgent: r.urgent, releasedAt: r.releasedAt.slice(0, 10) }} busy={busy} onSave={f => save(f, r.id)} onCancel={() => setEditing(null)} />
) : (
<>
<div className="mb-2 flex flex-wrap items-center gap-2">
<h2 className="text-lg font-semibold">{r.version}</h2>
{i === 0 && <Badge value="ok" label="Latest" />}
{r.urgent && <span className="inline-flex items-center gap-1 rounded-full bg-red-50 px-2 py-0.5 text-xs font-medium text-red-700 ring-1 ring-inset ring-red-200"><ShieldAlert className="h-3 w-3" /> Urgent</span>}
<span className="text-xs text-slate-500">{fmtDate(r.releasedAt, false)} · {r.installs} install{r.installs === 1 ? "" : "s"} on it</span>
<span className="ml-auto flex gap-2">
<button className="btn-secondary px-2 py-1 text-xs" onClick={() => { setEditing(r.id); setAdding(false); }}>Edit</button>
<button className="btn-danger px-2 py-1 text-xs" onClick={() => remove(r)}>Delete</button>
</span>
</div>
<ReleaseNotes notes={r.notes} />
</>
)}
</div>
))}
</div>
)}
</>
);
}
+3 -2
View File
@@ -1,6 +1,7 @@
"use client";
import React, { useEffect, useMemo, useState } from "react";
import Link from "next/link";
import { api, errorText, setToken } from "@/lib/api";
import { fmtDate } from "@/lib/format";
import { matches, usePaged } from "@/lib/paging";
@@ -11,7 +12,6 @@ type AuditRow = { id: string; action: string; target: string | null; metadata: u
type Msg = { type: "ok" | "err"; text: string } | null;
const FIELDS: { key: string; label: string; hint: string; type?: string }[] = [
{ key: "latest_version", label: "Latest Cross Events release", hint: "e.g. 1.41.0 — installs on an older version show as behind, and see \"Update available\"." },
{ key: "alert_email", label: "Alert email", hint: "Where new alerts are sent.", type: "email" },
{ key: "offline_minutes", label: "Offline after (minutes without a heartbeat)", hint: "Default 60.", type: "number" },
{ key: "backup_max_age_hours", label: "Backup too old after (hours)", hint: "Default 48.", type: "number" },
@@ -22,7 +22,7 @@ const FIELDS: { key: string; label: string; hint: string; type?: string }[] = [
type Tab = "alerts" | "email" | "security" | "audit";
const TABS: { key: Tab; label: string }[] = [
{ key: "alerts", label: "Releases and alerts" },
{ key: "alerts", label: "Alerts" },
{ key: "email", label: "Email" },
{ key: "security", label: "Login and security" },
{ key: "audit", label: "Audit log" },
@@ -122,6 +122,7 @@ export default function SettingsPage() {
<div role="tabpanel" id={`panel-${tab}`} aria-labelledby={`tab-${tab}`}>
{tab === "alerts" && (
<form onSubmit={save} className="card max-w-2xl space-y-4">
<p className="text-sm text-slate-600">The latest Cross Events version is the newest one on the <Link href="/releases" className="text-indigo-700 hover:underline">Releases</Link> page{settings.latest_version ? ` (now ${settings.latest_version})` : ""}.</p>
{FIELDS.map(f => (
<div key={f.key}>
<label className="label" htmlFor={f.key}>{f.label}</label>
+23
View File
@@ -119,3 +119,26 @@ export function Tabs<K extends string>({ tabs, active, onChange }: { tabs: { key
</div>
);
}
/** Release notes as the installs show them: lines starting with "- " are a list, the rest paragraphs. */
export function ReleaseNotes({ notes, className = "" }: { notes: string; className?: string }) {
const blocks: ({ list: false; text: string } | { list: true; items: string[] })[] = [];
for (const raw of notes.split(/\r?\n/)) {
const line = raw.trim();
if (!line) continue;
const item = /^[-*•]\s+(.*)$/.exec(line);
const last = blocks[blocks.length - 1];
if (item) {
if (last?.list) last.items.push(item[1]);
else blocks.push({ list: true, items: [item[1]] });
} else blocks.push({ list: false, text: line });
}
if (!blocks.length) return <p className={`text-sm italic text-slate-400 ${className}`}>No notes.</p>;
return (
<div className={`space-y-2 text-sm text-slate-700 ${className}`}>
{blocks.map((b, i) => (b.list
? <ul key={i} className="list-disc space-y-0.5 pl-5">{b.items.map((t, j) => <li key={j}>{t}</li>)}</ul>
: <p key={i}>{b.text}</p>))}
</div>
);
}
+18
View File
@@ -64,3 +64,21 @@ export type Stats = {
};
export type InstallEvent = { id: string; type: string; level: Problem["level"]; message: string; createdAt: string; resolvedAt: string | null; install?: { id: string; name: string; url: string } };
export type Release = { id: string; version: string; notes: string; urgent: boolean; releasedAt: string; installs: number };
export type NoticeLevel = "info" | "maintenance" | "warning";
export type Notice = {
id: string;
title: string;
message: string;
level: NoticeLevel;
allInstalls: boolean;
installIds: string[];
showBanner: boolean;
startsAt: string | null;
endsAt: string | null;
emailedAt: string | null;
emailedTo: number;
createdAt: string;
};