Add a since-you-last-looked summary, 30-day uptime ribbons, a maintenance timeline and hover timestamps

- Dashboard card on what changed since the user pressed Got it (users.last_looked_at,
  migration 0021), folding each problem and its recovery into one line.
- Uptime ribbons on servers and integrations, built from the audit log; integrations'
  failing/working-again moments are now recorded.
- Timeline of running and scheduled maintenance windows on the Maintenance page.
- TimeAgo component: relative times with the exact time in the chosen format on hover.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-16 21:55:04 +02:00
1 parent 3945c60681
commit 906220040e
32 files changed
+3380 -15

No files matched your search

+43
View File
@@ -10,6 +10,44 @@ export interface CurrentUser {
favorites?: string[];
}
/** One thing worth a line in "Since you last looked". */
export interface ChangeEvent {
at: string;
tone: "good" | "bad" | "info" | "neutral";
kind: "server" | "integration" | "maintenance";
title: string;
detail: string | null;
link: string | null;
}
export interface ChangesSummary {
since: string;
/** True the first time: the summary then covers the last day. */
firstTime: boolean;
events: ChangeEvent[];
moreEvents: number;
/** Entries other people wrote in the audit log in that time; null if this person can't see the audit log. */
changesByOthers: number | null;
}
/** Minutes known / minutes down in one 24-hour stretch. */
export interface UptimeBucket {
k: number;
d: number;
}
export interface UptimeSeries {
buckets: UptimeBucket[];
percent: number;
}
export interface UptimeReport {
days: number;
endsAt: string;
servers: Record<number, UptimeSeries>;
integrations: Record<number, UptimeSeries>;
}
export interface UserRecord {
id: number;
oidcSub: string;
@@ -1110,7 +1148,12 @@ async function request<T>(path: string, init?: RequestInit): Promise<T> {
export const api = {
me: Object.assign(() => request<{ user: CurrentUser }>("/api/me"), {
setFavorites: (paths: string[]) => request<{ favorites: string[] }>("/api/me/favorites", { method: "PUT", body: JSON.stringify({ paths }) }),
changes: () => request<ChangesSummary>("/api/me/changes"),
markChangesSeen: () => request<{ lastLookedAt: string }>("/api/me/changes/seen", { method: "POST" }),
}),
uptime: {
get: () => request<UptimeReport>("/api/uptime"),
},
search: {
query: (q: string) => request<SearchResponse>(`/api/search?q=${encodeURIComponent(q)}`),
},