Heartbeats, Coming up and suggested checks; Operations menu tidied

Heartbeats: a cron job or script calls /api/heartbeat/<token> (and /start, /fail); the app
alerts when the call is late or the job says it failed. Coming up: one agenda of everything
dated (expiries, warranties, end of support, planned and recurring maintenance, restore tests,
waiting updates), with a dashboard card and an iCalendar feed behind a share link. Suggested
checks: web ports and certificates the app already knows about, added with a click.

Menu: Incidents become Alerts -> History (old /incidents links redirect); new Monitoring group
(Endpoints, Heartbeats, Uptime Kuma); osTicket under Automation, Admin Links under
Infrastructure, Generator under Administration. Also makes the restore-test metrics test follow
the real clock.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-19 21:42:34 +02:00
1 parent c05c847d17
commit 4e0c6927b2
44 files changed
+7092 -75

No files matched your search

+15 -4
View File
@@ -1,5 +1,5 @@
import { useEffect, useState, type ReactNode } from "react";
import { Routes, Route, Navigate, useLocation } from "react-router-dom";
import { Routes, Route, Navigate, useLocation, useParams } from "react-router-dom";
import { api, type CurrentUser, type UserRole, UnauthorizedError } from "./api/client";
import Login from "./pages/Login";
import Dashboard from "./pages/Dashboard";
@@ -29,13 +29,14 @@ import Alerts from "./pages/Alerts";
import Generator from "./pages/Generator";
import Maintenance from "./pages/Maintenance";
import Updates from "./pages/Updates";
import Incidents from "./pages/Incidents";
import IncidentDetail from "./pages/IncidentDetail";
import Inventory from "./pages/Inventory";
import InventoryLabels from "./pages/InventoryLabels";
import InventoryLifecycle from "./pages/InventoryLifecycle";
import Dependencies from "./pages/Dependencies";
import Endpoints from "./pages/Endpoints";
import Heartbeats from "./pages/Heartbeats";
import ComingUp from "./pages/ComingUp";
import ChangeLog from "./pages/ChangeLog";
import Backups from "./pages/Backups";
import Domains from "./pages/Domains";
@@ -83,6 +84,12 @@ function RequireRole({
return <>{children}</>;
}
/** An old /incidents/<id> link, sent to the same incident under Alerts. */
function OldIncidentLink() {
const { id } = useParams();
return <Navigate to={/^\d+$/.test(id ?? "") ? `/alerts/incidents/${id}` : "/alerts?view=history"} replace />;
}
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.
@@ -156,6 +163,8 @@ function Shelled({ user }: { user: CurrentUser }) {
<Route path="/inventory/lifecycle" element={<InventoryLifecycle />} />
<Route path="/dependencies" element={<Dependencies user={user} />} />
<Route path="/endpoints" element={<Endpoints user={user} />} />
<Route path="/heartbeats" element={<Heartbeats user={user} />} />
<Route path="/coming-up" element={<ComingUp user={user} />} />
<Route path="/changes" element={user.role === "viewer" ? <Navigate to="/" replace /> : <ChangeLog />} />
<Route path="/backups" element={<Backups user={user} />} />
<Route path="/docker" element={<Docker user={user} />} />
@@ -169,8 +178,10 @@ function Shelled({ user }: { user: CurrentUser }) {
<Route path="/osticket" element={<OsTicket user={user} />} />
<Route path="/admin-links" element={<AdminLinks user={user} />} />
<Route path="/alerts" element={<Alerts user={user} />} />
<Route path="/incidents" element={<Incidents />} />
<Route path="/incidents/:id" element={<IncidentDetail user={user} />} />
<Route path="/alerts/incidents/:id" element={<IncidentDetail user={user} />} />
{/* Incidents used to be a page of their own: old links, bookmarks and notifications still arrive. */}
<Route path="/incidents" element={<Navigate to="/alerts?view=history" replace />} />
<Route path="/incidents/:id" element={<OldIncidentLink />} />
<Route
path="/users"
element={