- New POST /api/mods/update SSE route: per-file Modrinth lookup → snapshot → download latest → swap old jar → restart + verify (if server-side) → rebuild modpack, with automatic rollback on any failure. - ModManager: "Update" button next to each mod with an available update, plus "Update all (N)" in the installed list header. Reuses the existing install timeline UI (same event shape). SSE reader extracted as consumeSSE helper. - Error boundaries: app/error.tsx (scoped), app/admin/error.tsx (admin subtree retry), app/not-found.tsx, app/global-error.tsx (hard-fail fallback with inline styles, no app shell dependency). - A11y sweep: aria-pressed + aria-label on LogViewer level chips and ModManager side filter; aria-label on admin TabsList; skip-to-content link in Navbar targeting <main id="main"> on public + admin pages; role/aria-live on install/update timeline; global Esc in ModManager clears open confirm prompts and exits search/review wizard steps. - Command palette (cmdk): global Ctrl/⌘+K dialog mounted in Providers. Navigate admin tabs, toggle theme, start/stop/restart server, create backup, re-check mod updates, jump to any cached mod/player/snapshot/ backup. Auth-aware — public users see only Home / Log in / Theme. - AdminTabs listens to hashchange so palette navigation updates the active tab live. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
70 lines
1.7 KiB
TypeScript
70 lines
1.7 KiB
TypeScript
"use client";
|
|
|
|
export default function GlobalError({
|
|
error,
|
|
reset,
|
|
}: {
|
|
error: Error & { digest?: string };
|
|
reset: () => void;
|
|
}) {
|
|
return (
|
|
<html lang="en">
|
|
<body
|
|
style={{
|
|
fontFamily:
|
|
"system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",
|
|
background: "#0b0b10",
|
|
color: "#e5e5e7",
|
|
minHeight: "100vh",
|
|
margin: 0,
|
|
display: "flex",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
padding: 24,
|
|
}}
|
|
>
|
|
<div style={{ maxWidth: 480, textAlign: "center" }}>
|
|
<h1 style={{ fontSize: 22, fontWeight: 700, marginBottom: 8 }}>
|
|
The dashboard hit a fatal error
|
|
</h1>
|
|
<p
|
|
style={{
|
|
fontSize: 14,
|
|
color: "#9ca3af",
|
|
wordBreak: "break-word",
|
|
marginBottom: 16,
|
|
}}
|
|
>
|
|
{error.message || "Unexpected error"}
|
|
</p>
|
|
{error.digest && (
|
|
<p
|
|
style={{
|
|
fontSize: 11,
|
|
color: "#6b7280",
|
|
fontFamily: "ui-monospace, Menlo, monospace",
|
|
marginBottom: 16,
|
|
}}
|
|
>
|
|
ref: {error.digest}
|
|
</p>
|
|
)}
|
|
<button
|
|
onClick={reset}
|
|
style={{
|
|
background: "#f1f5f9",
|
|
color: "#0b0b10",
|
|
border: 0,
|
|
borderRadius: 6,
|
|
padding: "8px 16px",
|
|
fontWeight: 600,
|
|
cursor: "pointer",
|
|
}}
|
|
>
|
|
Try again
|
|
</button>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|