Add status pages (a share link kind) and a downloadable Grafana dashboard

- Share links can open a status page: an admin picks servers, integrations and Uptime Kuma
  monitors and names them; the public sees only those names, Working / Not working /
  Being worked on / Can't tell, an optional message and the 30-day figure (share_links.kind/
  title/message and status_items, migration 0033). A status address doesn't open the wall and
  the other way round; Uptime Kuma is asked at most every 30 seconds
- Grafana dashboard built from code (download in Settings -> API and webhooks); a test checks
  it only uses series /metrics serves
- Tests and docs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-18 15:38:08 +02:00
1 parent 2744a84719
commit 5cc51c57de
24 files changed
+4880 -35

No files matched your search

+3 -1
View File
@@ -53,6 +53,7 @@ import AppShell from "./layout/AppShell";
import DialogHost from "./components/DialogHost";
import Wall from "./pages/Wall";
import SharedWall from "./pages/SharedWall";
import SharedStatus from "./pages/SharedStatus";
import MapPage from "./pages/Map";
import { setDateTimeSettings } from "./utils/date";
import { setPageSize } from "./utils/pageSize";
@@ -80,7 +81,7 @@ function RequireRole({
export default function App() {
const [user, setUser] = useState<CurrentUser | null | undefined>(undefined);
// A share link's page is for someone who isn't signed in: it asks nothing of the app's own session.
const shared = useLocation().pathname.startsWith("/share/wall/");
const shared = useLocation().pathname.startsWith("/share/wall/") || useLocation().pathname.startsWith("/share/status/");
useEffect(() => {
if (shared) return;
@@ -103,6 +104,7 @@ export default function App() {
return (
<Routes>
<Route path="/share/wall/:token" element={<SharedWall />} />
<Route path="/share/status/:token" element={<SharedStatus />} />
</Routes>
);
}
+52 -2
View File
@@ -14,11 +14,48 @@ export interface CurrentUser {
export type ShareLinkDetail = "summary" | "names";
/** A link that opens the wall display without signing in, as the settings list shows it (never the secret). */
export type ShareLinkKind = "wall" | "status";
export type StatusItemKind = "server" | "integration" | "monitor";
/** One thing on a status page, as the editor sees it. */
export interface StatusPageItem {
id: number;
label: string;
kind: StatusItemKind;
targetId: number;
monitorId: string | null;
/** What it points at (the server's, integration's or monitor's own name). */
targetName: string | null;
}
/** What somebody who opens a status page's address is given: names and states, nothing else. */
export interface PublicStatusItem {
id: number;
label: string;
state: "up" | "down" | "maintenance" | "unknown";
uptime30d: number | null;
}
export interface PublicStatus {
title: string;
message: string | null;
level: "ok" | "issue" | "maintenance" | "unknown";
counts: Record<PublicStatusItem["state"], number>;
items: PublicStatusItem[];
generatedAt: string;
display: { dateFormat: string; timeFormat: string };
}
/** A link that opens the wall display, or a status page, without signing in, as the settings list shows it (never the secret). */
export interface ShareLink {
id: number;
label: string;
tokenPrefix: string;
kind: ShareLinkKind;
/** A status page's own heading and message. */
title: string | null;
message: string | null;
/** How many things a status page shows. */
itemCount: number;
detail: ShareLinkDetail;
createdBy: string | null;
createdAt: string;
@@ -1632,10 +1669,23 @@ export const api = {
},
shareLinks: {
list: () => request<{ links: ShareLink[] }>("/api/share-links"),
create: (data: { label: string; detail: ShareLinkDetail; expiresInDays: number | null }) =>
create: (data: { label: string; detail?: ShareLinkDetail; kind?: ShareLinkKind; title?: string; message?: string; expiresInDays: number | null }) =>
request<{ link: ShareLink; token: string; path: string }>("/api/share-links", { method: "POST", body: JSON.stringify(data) }),
remove: (id: number) => request<void>(`/api/share-links/${id}`, { method: "DELETE" }),
},
statusPages: {
get: (linkId: number) => request<{ title: string; message: string; items: StatusPageItem[]; maxItems: number }>("/api/share-links/" + linkId + "/status"),
choices: () => request<{ servers: { id: number; name: string }[]; integrations: { id: number; name: string; type: string }[] }>("/api/share-links/status-choices"),
save: (linkId: number, data: { title: string; message: string; items: { label: string; kind: StatusItemKind; targetId: number; monitorId: string | null }[] }) =>
request<{ title: string; message: string; items: StatusPageItem[] }>("/api/share-links/" + linkId + "/status", { method: "PUT", body: JSON.stringify(data) }),
},
publicStatus: {
get: async (token: string): Promise<PublicStatus> => {
const res = await fetch("/api/public/status/" + encodeURIComponent(token), { credentials: "omit", cache: "no-store" });
if (!res.ok) throw Object.assign(new Error("Request failed (" + res.status + ")"), { status: res.status });
return (await res.json()) as PublicStatus;
},
},
// Opened by someone who isn't signed in: no cookies, and the status is kept so a link that has ended can say so.
publicWall: {
get: async (token: string): Promise<PublicWall> => {
+217
View File
@@ -0,0 +1,217 @@
import { useEffect, useState } from "react";
import { api, type IntegrationSummary, type StatusItemKind, type StatusPageItem } from "../api/client";
import { readableError } from "../utils/errors";
import { toast } from "../utils/toast";
import DetailDrawer from "./DetailDrawer";
import { ErrorNotice } from "./Notice";
import { BlockSkeleton } from "./Skeleton";
interface Choice {
key: string;
kind: StatusItemKind;
targetId: number;
monitorId: string | null;
name: string;
group: string;
}
const KIND_WORDS: Record<StatusItemKind, string> = { server: "Server", integration: "Integration", monitor: "Monitor" };
/**
* Choose what a status page shows and what each thing is called. Each is a server, an integration or an Uptime Kuma monitor; the name is
* whatever people at home will recognise ("Movies"), and is the only thing about it the page ever shows.
*/
export default function StatusPageEditor({ linkId, linkLabel, onClose, onSaved }: { linkId: number; linkLabel: string; onClose: () => void; onSaved: () => void }) {
const [loaded, setLoaded] = useState(false);
const [title, setTitle] = useState("");
const [message, setMessage] = useState("");
const [items, setItems] = useState<StatusPageItem[]>([]);
const [maxItems, setMaxItems] = useState(30);
const [choices, setChoices] = useState<Choice[]>([]);
const [kind, setKind] = useState<StatusItemKind>("server");
const [pick, setPick] = useState("");
const [label, setLabel] = useState("");
const [busy, setBusy] = useState(false);
const [error, setError] = useState<string | null>(null);
useEffect(() => {
let alive = true;
(async () => {
try {
const [page, options, all] = await Promise.all([api.statusPages.get(linkId), api.statusPages.choices(), api.integrations.list()]);
const list: Choice[] = [
...options.servers.map((s) => ({ key: `server:${s.id}`, kind: "server" as const, targetId: s.id, monitorId: null, name: s.name, group: "Servers" })),
...options.integrations.filter((i) => i.type !== "uptimekuma").map((i) => ({ key: `integration:${i.id}`, kind: "integration" as const, targetId: i.id, monitorId: null, name: i.name, group: "Integrations" })),
];
// Monitors are Uptime Kuma's own, read from each one that is switched on; one that can't be reached just has none to offer.
const kuma = all.integrations.filter((i: IntegrationSummary) => i.type === "uptimekuma" && i.enabled);
for (const k of kuma) {
try {
const res = await api.integrations.uptimekuma.monitors(k.id);
for (const m of res.monitors) list.push({ key: `monitor:${k.id}:${m.id}`, kind: "monitor", targetId: k.id, monitorId: m.id, name: m.name, group: `Monitors in ${k.name}` });
} catch {
// nothing to offer from this one
}
}
if (!alive) return;
setTitle(page.title);
setMessage(page.message);
setItems(page.items);
setMaxItems(page.maxItems);
setChoices(list);
setLoaded(true);
} catch (err) {
if (alive) setError(readableError(err));
}
})();
return () => {
alive = false;
};
}, [linkId]);
const candidates = choices.filter((c) => c.kind === kind);
const picked = choices.find((c) => c.key === pick);
function add() {
if (!picked || label.trim() === "") return;
setItems((prev) => [...prev, { id: -Date.now(), label: label.trim(), kind: picked.kind, targetId: picked.targetId, monitorId: picked.monitorId, targetName: picked.name }]);
setPick("");
setLabel("");
}
const move = (i: number, by: number) =>
setItems((prev) => {
const next = [...prev];
const j = i + by;
if (j < 0 || j >= next.length) return prev;
[next[i], next[j]] = [next[j], next[i]];
return next;
});
async function save() {
setBusy(true);
setError(null);
try {
await api.statusPages.save(linkId, { title: title.trim(), message: message.trim(), items: items.map((i) => ({ label: i.label.trim(), kind: i.kind, targetId: i.targetId, monitorId: i.monitorId })) });
toast.success("Saved. The page shows this at its next refresh.");
onSaved();
onClose();
} catch (err) {
setError(readableError(err));
} finally {
setBusy(false);
}
}
const groups = [...new Set(candidates.map((c) => c.group))];
return (
<DetailDrawer title="Status page" subtitle={linkLabel} onClose={onClose}>
{!loaded && !error ? (
<BlockSkeleton lines={5} />
) : (
<>
<p className="text-secondary small">Whoever has the address sees only the name you give each thing and whether it is working — nothing else about it.</p>
<div className="mb-3">
<label className="form-label" htmlFor="sp-title">
Heading <span className="text-secondary">(optional)</span>
</label>
<input id="sp-title" className="form-control" maxLength={60} placeholder={linkLabel} value={title} onChange={(e) => setTitle(e.target.value)} />
</div>
<div className="mb-3">
<label className="form-label" htmlFor="sp-message">
Message <span className="text-secondary">(optional)</span>
</label>
<textarea id="sp-message" className="form-control" rows={2} maxLength={300} placeholder="e.g. Movies are being updated tonight, back by 18:00" value={message} onChange={(e) => setMessage(e.target.value)} />
</div>
<div className="form-label">What it shows</div>
{items.length === 0 ? (
<div className="text-secondary mb-3">Nothing yet. Add the things people ask about.</div>
) : (
<ul className="list-group mb-3">
{items.map((it, i) => (
<li className="list-group-item" key={it.id}>
<div className="d-flex gap-2 align-items-center">
<div className="flex-fill">
<input className="form-control form-control-sm mb-1" aria-label={`Name for ${it.targetName ?? "this"}`} maxLength={60} value={it.label} onChange={(e) => setItems((prev) => prev.map((p, j) => (j === i ? { ...p, label: e.target.value } : p)))} />
<div className="text-secondary small">
{KIND_WORDS[it.kind]} · {it.targetName ?? "(removed)"}
</div>
</div>
<div className="btn-list flex-nowrap">
<button type="button" className="btn btn-sm btn-ghost-secondary" aria-label="Move up" disabled={i === 0} onClick={() => move(i, -1)}>
▲
</button>
<button type="button" className="btn btn-sm btn-ghost-secondary" aria-label="Move down" disabled={i === items.length - 1} onClick={() => move(i, 1)}>
▼
</button>
<button type="button" className="btn btn-sm btn-outline-danger" aria-label={`Remove ${it.label}`} onClick={() => setItems((prev) => prev.filter((_, j) => j !== i))}>
Remove
</button>
</div>
</div>
</li>
))}
</ul>
)}
{items.length < maxItems && (
<div className="border rounded p-3 mb-3">
<div className="form-label">Add something</div>
<div className="d-flex gap-2 mb-2">
<select
className="form-select w-auto"
aria-label="What kind of thing"
value={kind}
onChange={(e) => {
setKind(e.target.value as StatusItemKind);
setPick("");
}}
>
<option value="server">A server</option>
<option value="integration">An integration</option>
<option value="monitor">An Uptime Kuma monitor</option>
</select>
<select
className="form-select"
aria-label="Which one"
value={pick}
onChange={(e) => {
setPick(e.target.value);
const c = choices.find((x) => x.key === e.target.value);
if (c && label.trim() === "") setLabel(c.name);
}}
>
<option value="">{candidates.length === 0 ? "None to choose from" : "Choose…"}</option>
{groups.map((g) => (
<optgroup key={g} label={g}>
{candidates
.filter((c) => c.group === g)
.map((c) => (
<option key={c.key} value={c.key}>
{c.name}
</option>
))}
</optgroup>
))}
</select>
</div>
<div className="d-flex gap-2">
<input className="form-control" aria-label="What to call it on the page" maxLength={60} placeholder="What to call it, e.g. Movies" value={label} onChange={(e) => setLabel(e.target.value)} />
<button type="button" className="btn btn-outline-primary" disabled={!picked || label.trim() === ""} onClick={add}>
Add
</button>
</div>
</div>
)}
<ErrorNotice error={error} />
<button type="button" className="btn btn-primary" disabled={busy || items.some((i) => i.label.trim() === "")} onClick={() => void save()}>
{busy ? "Saving…" : "Save"}
</button>
</>
)}
</DetailDrawer>
);
}
+141
View File
@@ -0,0 +1,141 @@
import { useEffect, useState } from "react";
import { useParams } from "react-router-dom";
import { IconAlertTriangle, IconCircleCheck, IconHelpCircle, IconTool } from "@tabler/icons-react";
import { api, type PublicStatus, type PublicStatusItem } from "../api/client";
import { formatDateTime, setDateTimeSettings } from "../utils/date";
const REFRESH_MS = 30_000;
const STATE: Record<PublicStatusItem["state"], { label: string; badge: string }> = {
up: { label: "Working", badge: "bg-green-lt text-green" },
down: { label: "Not working", badge: "bg-red-lt text-red" },
maintenance: { label: "Being worked on", badge: "bg-blue-lt text-blue" },
unknown: { label: "Can't tell right now", badge: "bg-secondary-lt text-secondary" },
};
const BANNER: Record<PublicStatus["level"], { alert: string; icon: JSX.Element }> = {
ok: { alert: "alert-success", icon: <IconCircleCheck size={22} /> },
issue: { alert: "alert-danger", icon: <IconAlertTriangle size={22} /> },
maintenance: { alert: "alert-info", icon: <IconTool size={22} /> },
unknown: { alert: "alert-secondary", icon: <IconHelpCircle size={22} /> },
};
function headline(page: PublicStatus): string {
const { counts } = page;
if (page.items.length === 0) return "Nothing to show yet";
switch (page.level) {
case "issue":
return counts.down === 1 ? "One thing isn't working" : `${counts.down} things aren't working`;
case "maintenance":
return counts.maintenance === 1 ? "One thing is being worked on" : `${counts.maintenance} things are being worked on`;
case "unknown":
return "Can't tell right now";
default:
return counts.unknown > 0 ? "Everything we can see is working" : "Everything is working";
}
}
/**
* A status page behind a share link: is each of the things somebody chose working? For people at home who only want to know whether the movies
* are up. No sign-in, nothing to click. It follows the device's light or dark setting, and looks again every half minute. A link that doesn't
* work (never made, ended, taken back) says so and stops asking.
*/
export default function SharedStatus() {
const { token = "" } = useParams();
const [page, setPage] = useState<PublicStatus | null>(null);
const [state, setState] = useState<"loading" | "ok" | "dead" | "unreachable">("loading");
const [updatedAt, setUpdatedAt] = useState<Date | null>(null);
// Light or dark as the device likes it.
useEffect(() => {
const media = window.matchMedia?.("(prefers-color-scheme: dark)");
const apply = () => document.documentElement.setAttribute("data-bs-theme", media?.matches ? "dark" : "light");
apply();
media?.addEventListener?.("change", apply);
return () => media?.removeEventListener?.("change", apply);
}, []);
useEffect(() => {
let alive = true;
let timer: ReturnType<typeof setInterval> | undefined;
const load = () =>
api.publicStatus
.get(token)
.then((p) => {
if (!alive) return;
setDateTimeSettings({ dateFormat: p.display.dateFormat as "ymd" | "dmy" | "mdy", timeFormat: p.display.timeFormat as "24h" | "12h" });
setPage(p);
setUpdatedAt(new Date());
setState("ok");
})
.catch((err: unknown) => {
if (!alive) return;
const status = (err as { status?: number }).status;
if (status === 404) {
setState("dead");
if (timer) clearInterval(timer);
} else if (status !== 429) setState((s) => (s === "ok" ? "ok" : "unreachable"));
});
void load();
timer = setInterval(load, REFRESH_MS);
return () => {
alive = false;
if (timer) clearInterval(timer);
};
}, [token]);
useEffect(() => {
document.title = page?.title ?? "Status";
}, [page?.title]);
return (
<div className="page-wrapper" style={{ minHeight: "100vh" }}>
<div className="container-tight py-4" style={{ maxWidth: 640, margin: "0 auto", paddingLeft: 16, paddingRight: 16 }}>
{state === "dead" ? (
<div className="card">
<div className="card-body text-center py-5">
<div className="h3 mb-1">This link doesn't work any more</div>
<div className="text-secondary">It may have ended or been taken back. Ask whoever gave it to you for a new one.</div>
</div>
</div>
) : !page ? (
<div className="text-center text-secondary py-5">{state === "unreachable" ? "Can't reach the server right now. Trying again…" : "Loading…"}</div>
) : (
<>
<h1 className="h2 mb-3">{page.title}</h1>
<div className={`alert ${BANNER[page.level].alert} mb-3`} role="status">
<div className="d-flex gap-2 align-items-center">
{BANNER[page.level].icon}
<strong>{headline(page)}</strong>
</div>
</div>
{page.message && (
<div className="card mb-3">
<div className="card-body" style={{ whiteSpace: "pre-wrap" }}>
{page.message}
</div>
</div>
)}
{page.items.length > 0 && (
<div className="card">
<div className="list-group list-group-flush">
{page.items.map((it) => (
<div className="list-group-item d-flex flex-wrap align-items-center gap-2" key={it.id}>
<span className="fw-bold flex-fill">{it.label}</span>
{it.uptime30d !== null && <span className="text-secondary small">{it.uptime30d}% over 30 days</span>}
<span className={`badge ${STATE[it.state].badge}`}>{STATE[it.state].label}</span>
</div>
))}
</div>
</div>
)}
<div className="text-secondary small text-center mt-3">
{updatedAt ? `Checked ${formatDateTime(updatedAt)}` : ""} · looks again every 30 seconds
{state === "unreachable" ? " · can't reach the server right now" : ""}
</div>
</>
)}
</div>
</div>
);
}
+7
View File
@@ -149,6 +149,13 @@ export default function ApiSettings() {
<code>{origin}/metrics</code> answers in Prometheus's text format — whether each server is up, its load, memory, disks and waiting updates, the alert counts, which integrations work, maintenance, and things about to expire — so a
Grafana dashboard or Prometheus alert can use it. It is read-only and opens with a token sent as <code>Authorization: Bearer …</code>; a token in the address isn't accepted. It reads what the app already knows, so a scrape every 15 seconds is cheap.
</p>
<p className="text-secondary">
For Grafana there is a ready-made dashboard — what needs attention, servers, disks, backups and the quieter things — that asks only for these series.{" "}
<a href="/api/metrics-tokens/grafana-dashboard.json" download>
Download the dashboard
</a>
, then in Grafana choose Dashboards → New → Import and pick your Prometheus when asked.
</p>
{newSecret && (
<div className="border border-success rounded p-3 mb-3">
<div className="fw-bold mb-1">Token for {newSecret.label}</div>
+62 -14
View File
@@ -1,5 +1,6 @@
import { useEffect, useState } from "react";
import { api, type ShareLink, type ShareLinkDetail } from "../../api/client";
import { api, type ShareLink, type ShareLinkDetail, type ShareLinkKind } from "../../api/client";
import StatusPageEditor from "../../components/StatusPageEditor";
import CopyButton from "../../components/CopyButton";
import TimeAgo from "../../components/TimeAgo";
import { ErrorNotice } from "../../components/Notice";
@@ -27,6 +28,11 @@ export default function ShareSettings() {
const [error, setError] = useState<string | null>(null);
const [label, setLabel] = useState("");
const [detail, setDetail] = useState<ShareLinkDetail>("summary");
// What the link opens: the wall display, or a status page (heading and message are the page's own, and the things on it are chosen after).
const [kind, setKind] = useState<ShareLinkKind>("wall");
const [title, setTitle] = useState("");
const [message, setMessage] = useState("");
const [editing, setEditing] = useState<{ id: number; label: string } | null>(null);
const [days, setDays] = useState<number | null>(null);
const [busy, setBusy] = useState(false);
const [created, setCreated] = useState<{ label: string; url: string } | null>(null);
@@ -44,10 +50,14 @@ export default function ShareSettings() {
setError(null);
setBusy(true);
try {
const res = await api.shareLinks.create({ label: label.trim(), detail, expiresInDays: days });
setCreated({ label: res.link.label, url: `${window.location.origin}${res.path}` });
const res = await api.shareLinks.create(kind === "status" ? { label: label.trim(), kind, title: title.trim() || undefined, message: message.trim() || undefined, expiresInDays: days } : { label: label.trim(), kind, detail, expiresInDays: days });
setCreated({ label: res.link.label, url: window.location.origin + res.path });
setLabel("");
setTitle("");
setMessage("");
load();
// A status page with nothing on it isn't much use: go straight to choosing what it shows.
if (res.link.kind === "status") setEditing({ id: res.link.id, label: res.link.label });
} catch (err) {
setError(readableError(err));
} finally {
@@ -70,7 +80,7 @@ export default function ShareSettings() {
<>
<h3 className="mb-3">Share links</h3>
<p className="text-secondary">
A share link opens the wall display — how things are, on one screen — <strong>without signing in</strong>, for a TV in the hall or someone who only wants to know whether things are up. It can only look; it can't change anything.
A share link opens a page <strong>without signing in</strong>: the <strong>wall display</strong> — how things are, on one screen, for a TV in the hall — or a <strong>status page</strong> — whether each of the things you choose is working, with names people at home will recognise, for family or housemates who only want to know "is the movie server up?". It can only look; it can't change anything.
</p>
<div className="alert alert-warning">
Anyone who has the address can open it, so treat it like a password: give it only to people and screens you trust, and remove it when it isn't needed. The address is shown once, when you make it.
@@ -110,14 +120,41 @@ export default function ShareSettings() {
<input id="share-label" className="form-control" required maxLength={60} placeholder="e.g. Hall TV" value={label} onChange={(e) => setLabel(e.target.value)} />
</div>
<div className="col-md-4">
<label className="form-label" htmlFor="share-detail">
What it shows
<label className="form-label" htmlFor="share-kind">
What it opens
</label>
<select id="share-detail" className="form-select" value={detail} onChange={(e) => setDetail(e.target.value as ShareLinkDetail)}>
<option value="summary">Numbers only — servers online, alerts, maintenance</option>
<option value="names">With names — also what is wrong, and the integrations</option>
<select id="share-kind" className="form-select" value={kind} onChange={(e) => setKind(e.target.value as ShareLinkKind)}>
<option value="wall">The wall display — how things are</option>
<option value="status">A status page — is each thing I choose working</option>
</select>
</div>
{kind === "wall" && (
<div className="col-md-4">
<label className="form-label" htmlFor="share-detail">
How much it shows
</label>
<select id="share-detail" className="form-select" value={detail} onChange={(e) => setDetail(e.target.value as ShareLinkDetail)}>
<option value="summary">Numbers only — servers online, alerts, maintenance</option>
<option value="names">With names — also what is wrong, and the integrations</option>
</select>
</div>
)}
{kind === "status" && (
<>
<div className="col-md-6">
<label className="form-label" htmlFor="share-title">
Heading <span className="text-secondary">(optional)</span>
</label>
<input id="share-title" className="form-control" maxLength={60} placeholder="Defaults to the name above" value={title} onChange={(e) => setTitle(e.target.value)} />
</div>
<div className="col-md-6">
<label className="form-label" htmlFor="share-message">
Message <span className="text-secondary">(optional)</span>
</label>
<input id="share-message" className="form-control" maxLength={300} placeholder="e.g. Movies are being updated tonight" value={message} onChange={(e) => setMessage(e.target.value)} />
</div>
</>
)}
<div className="col-md-4">
<label className="form-label" htmlFor="share-lasts">
How long it works
@@ -131,7 +168,9 @@ export default function ShareSettings() {
</select>
</div>
<div className="col-12 text-secondary small">
“Numbers only” never shows a name. “With names” shows the text of the alerts (which can mention server names, disks and secrets), what is in maintenance, and the names of your integrations — never addresses, tokens or settings.
{kind === "wall"
? "“Numbers only” never shows a name. “With names” shows the text of the alerts (which can mention server names, disks and secrets), what is in maintenance, and the names of your integrations — never addresses, tokens or settings."
: "A status page shows only the name you give each thing and whether it is working, being worked on, or can't be told — and, where known, how it has done over 30 days. Never an address, an alert, or what the thing really is. You choose what is on it right after making it."}
</div>
</div>
<div className="card-footer">
@@ -167,16 +206,23 @@ export default function ShareSettings() {
<td>
{l.label} <span className="text-secondary small">{l.tokenPrefix}…</span>
</td>
<td>{DETAIL_WORDS[l.detail]}</td>
<td>{l.kind === "status" ? "Status page · " + l.itemCount + (l.itemCount === 1 ? " thing" : " things") : "Wall · " + DETAIL_WORDS[l.detail].toLowerCase()}</td>
<td className="text-secondary">
{l.createdBy ?? "—"}, <TimeAgo value={l.createdAt} fromDb />
</td>
<td>{l.expired ? <span className="badge bg-red-lt text-red">Ended</span> : l.expiresAt ? formatDateTime(new Date(l.expiresAt)) : "Until removed"}</td>
<td className="text-secondary">{l.lastUsedAt ? <TimeAgo value={l.lastUsedAt} /> : "Never"}</td>
<td>
<button className="btn btn-sm btn-outline-danger" onClick={() => remove(l)}>
Remove
</button>
<div className="btn-list flex-nowrap">
{l.kind === "status" && (
<button className="btn btn-sm btn-outline-secondary" onClick={() => setEditing({ id: l.id, label: l.label })}>
Choose what it shows…
</button>
)}
<button className="btn btn-sm btn-outline-danger" onClick={() => remove(l)}>
Remove
</button>
</div>
</td>
</tr>
))}
@@ -198,6 +244,8 @@ export default function ShareSettings() {
</table>
</div>
</div>
{editing && <StatusPageEditor linkId={editing.id} linkLabel={editing.label} onClose={() => setEditing(null)} onSaved={load} />}
</>
);
}