Move Notifications back to Settings and link to it from Alert settings

Alert settings keeps Alert rules, Service levels and Alert tickets; administrators get a link to Settings -> Notifications.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-03 20:49:09 +01:00
1 parent 4269213275
commit ccb863e7c3
32 files changed
+152 -150

No files matched your search

+3 -3
View File
@@ -8,7 +8,7 @@ import Secrets from "./pages/Secrets";
import Ipam from "./pages/Ipam";
import NetworkDevices from "./pages/NetworkDevices";
import ProxyHosts from "./pages/ProxyHosts";
import AlertSettings, { NotificationsRedirect } from "./pages/AlertSettings";
import AlertSettings, { NotificationsPage } from "./pages/AlertSettings";
import HomeAssistant from "./pages/HomeAssistant";
import Ups from "./pages/Ups";
import Jellyfin from "./pages/Jellyfin";
@@ -248,8 +248,8 @@ function Shelled({ user }: { user: CurrentUser }) {
</RequireRole>
}
>
<Route index element={<Navigate to="sign-in" replace />} />
<Route path="notifications" element={<NotificationsRedirect />} />
<Route index element={<Navigate to="notifications" replace />} />
<Route path="notifications" element={<NotificationsPage />} />
<Route path="sign-in" element={<SignInSettings />} />
<Route path="display" element={<DisplayGroup />} />
<Route path="names" element={<NameSettings />} />
+1 -1
View File
@@ -3156,7 +3156,7 @@ export interface DockhandVulnerabilityEnvironment {
}
export interface DockhandVulnerabilitiesResponse {
/** Whether critical findings are alerted (Alert settings → Notifications). */
/** Whether critical findings are alerted (Settings → Notifications). */
alerts: boolean;
/** A host with at least this many high findings is alerted too; 0 = never. */
highThreshold: number;
+1 -1
View File
@@ -77,7 +77,7 @@ export default function AlertNoise() {
<>
<p className="text-secondary">
The alerts that keep coming back. Each time one is raised and later goes away counts once; only those raised at least twice are listed. The last column says what usually helps — a longer grace time, a different threshold,
or fixing the thing itself. An alert raised and cleared often enough in an hour is called <strong>flapping</strong> and its messages are held back until it has been calm for an hour (set under Alert settings → Notifications).
or fixing the thing itself. An alert raised and cleared often enough in an hour is called <strong>flapping</strong> and its messages are held back until it has been calm for an hour (set under Settings → Notifications).
</p>
<ErrorNotice error={error} />
+1 -1
View File
@@ -206,7 +206,7 @@ export default function DatabaseBackups() {
Save
</button>
</div>
<div className="col-12 text-secondary small">The time is in the notification time zone (Alert settings → Notifications). An alert is raised if the newest backup gets more than two days old.</div>
<div className="col-12 text-secondary small">The time is in the notification time zone (Settings → Notifications). An alert is raised if the newest backup gets more than two days old.</div>
</form>
{data.snapshots.length === 0 ? (
+2 -2
View File
@@ -16,7 +16,7 @@ const FIELDS: { key: Field; label: string; unit: string; min: number; max: numbe
const has = (t: Thresholds | null) => !!t && (Object.keys(t).some((k) => k !== "mounts" && k !== "ignoreServices") || Object.keys(t.mounts ?? {}).length > 0);
/**
* This server's own alert limits. Anything left empty follows Alert settings → Notifications, so changing the global limit still reaches every
* This server's own alert limits. Anything left empty follows Settings → Notifications, so changing the global limit still reaches every
* server that hasn't said otherwise. A disk can have a limit of its own, or be left alone altogether. Everyone can see what is set; only
* an administrator changes it.
*/
@@ -115,7 +115,7 @@ export default function ServerThresholds({ server, defaults, disks, canEdit, onC
}}
>
<div className="card-body">
<p className="text-secondary small">Leave a box empty to follow Alert settings → Notifications (shown inside the box). Only what you fill in is different for this server.</p>
<p className="text-secondary small">Leave a box empty to follow Settings → Notifications (shown inside the box). Only what you fill in is different for this server.</p>
<div className="row g-3">
{FIELDS.filter((f) => !f.onlyForGuests || isGuest || own?.[f.key] !== undefined).map((f) => (
<div className="col-md-6" key={f.key}>
+1 -1
View File
@@ -389,7 +389,7 @@ export default function AppShell({ user, children }: { user: CurrentUser; childr
{away.away.state === "planned" ? `Away from ${formatDateTime(new Date(away.away.from!))} until ${formatDateTime(new Date(away.away.until))}` : `Away until ${formatDateTime(new Date(away.away.until))}`}
{away.away.note ? ` — ${away.away.note}` : ""}.{" "}
{away.away.state === "active" ? `Notifications are held${away.away.criticalThrough ? " (critical alerts still come through)" : ""}${away.held > 0 ? ` — ${away.held} so far` : ""}. ` : ""}
<Link to="/alert-settings?view=notifications&tab=when">{user.role === "admin" ? "Manage" : "Details"}</Link>
<Link to="/settings/notifications?tab=when">{user.role === "admin" ? "Manage" : "Details"}</Link>
</div>
</div>
)}
+1 -1
View File
@@ -221,7 +221,7 @@ function RuleDrawer({ initial, servers, tags, onClose, onSaved }: { initial: Ale
</select>
)}
<div className="text-secondary small mb-3">
Severity and kind decide who hears of it: these are <strong>Monitoring</strong> alerts, so the routing rules under Alert settings → Notifications apply to them like any other.
Severity and kind decide who hears of it: these are <strong>Monitoring</strong> alerts, so the routing rules under Settings → Notifications apply to them like any other.
</div>
{tried && (
<div className={`alert ${tried.length > 0 ? "alert-warning" : "alert-success"} py-2`}>
+20 -19
View File
@@ -1,4 +1,4 @@
import { Navigate, useLocation, useSearchParams } from "react-router-dom";
import { Link, Navigate, useLocation, useSearchParams } from "react-router-dom";
import type { CurrentUser } from "../api/client";
import ViewTabs from "../components/ViewTabs";
import AlertRules from "./AlertRules";
@@ -6,41 +6,42 @@ import ServiceLevels from "./ServiceLevels";
import NotificationSettings from "./settings/NotificationSettings";
import AlertTicketSettings from "./settings/AlertTicketSettings";
type View = "rules" | "levels" | "notifications" | "tickets";
type View = "rules" | "levels" | "tickets";
/**
* Everything that decides what is an alert and who hears of it, on one page with a tab for each: **Alert rules** (limits of your own), **Service levels**
* (targets and error budgets), **Notifications** (channels, what is sent, who hears what, quiet hours, away mode) and **Alert tickets** (osTicket). The first two
* are for everyone to read; the last two are Settings, so only an administrator sees them. The tab is `?view=`; Notifications keeps its own `?tab=` and `?section=`.
* What decides what is an alert, on one page with a tab for each: **Alert rules** (limits of your own), **Service levels** (targets and error budgets) and **Alert tickets**
* (osTicket). The first two are for everyone to read; the third is Settings, so only an administrator sees it. The tab is `?view=`. Who hears of an alert — the
* channels, what is sent, quiet hours — is not here: it serves more than alerts, so it stays under Settings → Notifications, and an administrator gets a link to it.
*/
export default function AlertSettings({ user }: { user: CurrentUser }) {
const [params] = useSearchParams();
const isAdmin = user.role === "admin";
const asked = params.get("view");
const view: View = asked === "levels" ? "levels" : isAdmin && (asked === "notifications" || asked === "tickets") ? asked : "rules";
const view: View = asked === "levels" ? "levels" : isAdmin && asked === "tickets" ? "tickets" : "rules";
const tabs = [
{ to: "/alert-settings", label: "Alert rules", active: view === "rules" },
{ to: "/alert-settings?view=levels", label: "Service levels", active: view === "levels" },
...(isAdmin
? [
{ to: "/alert-settings?view=notifications", label: "Notifications", active: view === "notifications" },
{ to: "/alert-settings?view=tickets", label: "Alert tickets", active: view === "tickets" },
]
: []),
...(isAdmin ? [{ to: "/alert-settings?view=tickets", label: "Alert tickets", active: view === "tickets" }] : []),
];
return (
<>
<h2 className="page-title mb-3">Alert settings</h2>
<div className="d-flex flex-wrap align-items-center gap-2 mb-3">
<h2 className="page-title mb-0">Alert settings</h2>
{isAdmin && (
<Link to="/settings/notifications" className="ms-auto">
Notification settings: channels, what is sent, quiet hours →
</Link>
)}
</div>
<ViewTabs label="Alert settings" tabs={tabs} />
{view === "levels" ? <ServiceLevels user={user} /> : view === "notifications" ? <NotificationSettings /> : view === "tickets" ? <AlertTicketSettings /> : <AlertRules user={user} />}
{view === "levels" ? <ServiceLevels user={user} /> : view === "tickets" ? <AlertTicketSettings /> : <AlertRules user={user} />}
</>
);
}
/** `/settings/notifications` (and its `?tab=`, `?section=`, `?view=tickets`) as it was before the alert settings were one page: the same place on the new one. */
export function NotificationsRedirect() {
/** `/settings/notifications?view=tickets` is how Alert tickets was addressed when it was a tab beside Notifications: it is a tab of Alert settings now. Anything else is Notifications itself. */
export function NotificationsPage() {
const { search } = useLocation();
const next = new URLSearchParams(search);
next.set("view", next.get("view") === "tickets" ? "tickets" : "notifications");
return <Navigate to={`/alert-settings?${next.toString()}`} replace />;
if (new URLSearchParams(search).get("view") === "tickets") return <Navigate to="/alert-settings?view=tickets" replace />;
return <NotificationSettings />;
}
+1 -1
View File
@@ -379,7 +379,7 @@ export default function Backups({ user, tabs }: { user?: CurrentUser; /** The ta
</div>
<div className="card-body text-secondary small pb-0">
A backup nobody has restored is a hope, not a backup. Record each time you try one — for a guest above, or for anything else (a share, a database). A failed test is raised on the
Alerts page; under Alert settings → Notifications you can also ask to be reminded when a guest with backups hasn&rsquo;t had one in a while{report?.restoreTestDays ? ` (now: ${report.restoreTestDays} days)` : ""}.
Alerts page; under Settings → Notifications you can also ask to be reminded when a guest with backups hasn&rsquo;t had one in a while{report?.restoreTestDays ? ` (now: ${report.restoreTestDays} days)` : ""}.
</div>
{custom.length > 0 && (
<div className="card-body pb-0">
+1 -1
View File
@@ -753,7 +753,7 @@ export default function Dashboard({ user }: { user: CurrentUser }) {
{ id: "server", title: "Add a server and install its agent", description: "The agent reports scheduled tasks, disks, memory and open ports, and lets the app tell when a server goes quiet.", to: "/servers", action: "Add a server", done: (serverSummary?.total ?? 0) > 0 },
{ id: "dns", title: "Connect a DNS provider", description: "See your zones and records, and have names matched to servers.", to: "/dns", action: "Connect", done: (dnsStats?.totalProviders ?? 0) > 0 },
{ id: "secret", title: "Track something that expires", description: "An API token, a certificate or a password — you're warned before it runs out.", to: "/secrets", action: "Add one", done: (secrets?.length ?? 0) > 0 },
{ id: "notify", title: "Choose how you'll be told about problems", description: "Gotify, ntfy, email, a webhook or push to your phone, with the checks you want.", to: "/alert-settings?view=notifications", action: "Set up", done: notifyConfigured === true },
{ id: "notify", title: "Choose how you'll be told about problems", description: "Gotify, ntfy, email, a webhook or push to your phone, with the checks you want.", to: "/settings/notifications", action: "Set up", done: notifyConfigured === true },
{ id: "people", title: "Let someone else in (optional)", description: "Others sign in with Authentik and appear under Users; you decide their role.", to: "/users", action: "Open Users", done: (userCount ?? 0) > 1 },
];
+3 -3
View File
@@ -121,15 +121,15 @@ export default function DockerVulnerabilities({ integrationId }: { integrationId
<strong>Critical</strong> findings are an alert — see <Link to="/alerts">Alerts</Link>;{" "}
{data.highThreshold > 0 ? (
<>
so is a host with <strong>{data.highThreshold} or more high</strong> ones (<Link to="/alert-settings?view=notifications">Alert settings → Notifications</Link>); medium and low are only shown here.
so is a host with <strong>{data.highThreshold} or more high</strong> ones (<Link to="/settings/notifications">Settings → Notifications</Link>); medium and low are only shown here.
</>
) : (
<>high, medium and low are only shown here (high ones can be alerted from a number you choose under Alert settings → Notifications).</>
<>high, medium and low are only shown here (high ones can be alerted from a number you choose under Settings → Notifications).</>
)}
</>
) : (
<>
The alert for critical findings is switched off (<Link to="/alert-settings?view=notifications">Alert settings → Notifications</Link>).
The alert for critical findings is switched off (<Link to="/settings/notifications">Settings → Notifications</Link>).
</>
)}
</p>
+1 -1
View File
@@ -201,7 +201,7 @@ export default function MonthlyReport({ user }: { user: CurrentUser }) {
{user.role === "admin" ? (
<>
{" "}
It can be sent on a day of the month, and a quarter's and year's report after the month that ends it: <Link to="/alert-settings?view=notifications">Alert settings → Notifications</Link>.
It can be sent on a day of the month, and a quarter's and year's report after the month that ends it: <Link to="/settings/notifications">Settings → Notifications</Link>.
</>
) : null}
</p>
+1
View File
@@ -3,6 +3,7 @@ import { Link, NavLink, Outlet } from "react-router-dom";
import { searchSettings } from "../utils/settingsIndex";
const SUB_NAV = [
{ to: "/settings/notifications", label: "Notifications" },
{ to: "/settings/sign-in", label: "Sign-in" },
{ to: "/settings/display", label: "Display" },
{ to: "/settings/names", label: "Names" },
+25 -25
View File
@@ -11,34 +11,34 @@ export interface SettingsEntry {
words: string;
}
const N = "/alert-settings?view=notifications";
const N = "/settings/notifications";
export const SETTINGS_INDEX: SettingsEntry[] = [
// Notifications
{ title: "Gotify, ntfy, email and webhook channels", where: "Alert settings › Notifications › Channels", to: `${N}&tab=channels`, words: "gotify ntfy smtp email mail webhook push channel test send where notifications go" },
{ title: "Browser and phone push", where: "Alert settings › Notifications › Channels", to: `${N}&tab=channels`, words: "web push browser phone device subscribe pwa notify vapid" },
{ title: "Server offline after (minutes)", where: "Alert settings › Notifications › What to send › Servers and disks", to: `${N}&tab=events`, words: "offline stopped reporting silent agent threshold limit minutes" },
{ title: "Disk usage alert at (percent)", where: "Alert settings › Notifications › What to send › Servers and disks", to: `${N}&tab=events`, words: "disk full storage percent threshold space" },
{ title: "Warn when a disk will fill within (days)", where: "Alert settings › Notifications › What to send › Servers and disks", to: `${N}&tab=events`, words: "disk forecast fill growth trend days" },
{ title: "Away mode: hold notifications while I'm away", where: "Alert settings › Notifications › When", to: `${N}&tab=when`, words: "away holiday vacation travel back hold digest pause mute do not disturb critical" },
{ title: "Let critical alerts through quiet hours", where: "Alert settings › Notifications › When", to: `${N}&tab=when`, words: "quiet hours critical night wake sleep through urgent" },
{ title: "Quarterly and annual reports", where: "Alert settings › Notifications › When", to: `${N}&tab=when`, words: "report quarterly annual yearly quarter year send message monthly" },
{ title: "Warn about critical vulnerabilities in Docker images", where: "Alert settings › Notifications › What to send › Backups and updates", to: `${N}&tab=events&section=backups`, words: "vulnerability vulnerabilities cve security scan critical dockhand grype trivy image docker" },
{ title: "Warn when a Docker container is broken, and containers to leave alone", where: "Alert settings › Notifications › What to send › Backups and updates", to: `${N}&tab=events&section=backups`, words: "docker container restarting restart loop unhealthy stopped exited created dockhand hawser ignore leave alone" },
{ title: "Warn when CPU or memory is unusually high for the time", where: "Alert settings › Notifications › What to send › Servers and disks", to: `${N}&tab=events`, words: "baseline usual normal unusual unusually busy high cpu memory load weekday hour history anomaly" },
{ title: "Warn when a server starts listening on a new port", where: "Alert settings › Notifications › What to send › Servers and disks", to: `${N}&tab=events`, words: "new port baseline listening tcp monitoring" },
{ title: "Call an alert flapping after (raises in an hour)", where: "Alert settings › Notifications › What to send › Servers and disks", to: `${N}&tab=events`, words: "flapping flap noise repeat raised cleared again hold back" },
{ title: "Alert when a network device is offline for (minutes)", where: "Alert settings › Notifications › What to send › Servers and disks", to: `${N}&tab=events`, words: "unifi network device switch access point gateway offline" },
{ title: "Secret, Tailscale key and domain expiry reminders", where: "Alert settings › Notifications › What to send › Secrets, keys and domains", to: `${N}&tab=events&section=secrets`, words: "expiry expire secrets certificate tailscale key domain renew warn days" },
{ title: "Backups too old, and restore tests", where: "Alert settings › Notifications › What to send › Backups and updates", to: `${N}&tab=events&section=backups`, words: "backup stale old restore test guest proxmox updates docker image" },
{ title: "Integration, automation and ticket alerts", where: "Alert settings › Notifications › What to send › Integrations and automation", to: `${N}&tab=events&section=integrations`, words: "integration failing semaphore gitea automation failed osticket tickets uptime kuma" },
{ title: "DNS change notifications", where: "Alert settings › Notifications › What to send › DNS changes", to: `${N}&tab=events&section=dns`, words: "dns changes record added removed" },
{ title: "Routing rules: which channel gets which alert", where: "Alert settings › Notifications › Who hears what", to: `${N}&tab=routing`, words: "routing rules route channel tags severity kinds mute" },
{ title: "Escalation: tell more people if nobody acts", where: "Alert settings › Notifications › Who hears what", to: `${N}&tab=routing`, words: "escalation escalate unacknowledged steps neglected" },
{ title: "Time zone and daily reminders", where: "Alert settings › Notifications › When", to: `${N}&tab=when`, words: "timezone time zone daily reminder time of day" },
{ title: "Quiet hours", where: "Alert settings › Notifications › When", to: `${N}&tab=when`, words: "quiet hours night hold queue do not disturb" },
{ title: "Monthly report", where: "Alert settings › Notifications › When", to: `${N}&tab=when`, words: "monthly report day of month send availability" },
{ title: "Weekly digest", where: "Alert settings › Notifications › When", to: `${N}&tab=when`, words: "weekly digest summary email day" },
{ title: "Gotify, ntfy, email and webhook channels", where: "Notifications › Channels", to: `${N}?tab=channels`, words: "gotify ntfy smtp email mail webhook push channel test send where notifications go" },
{ title: "Browser and phone push", where: "Notifications › Channels", to: `${N}?tab=channels`, words: "web push browser phone device subscribe pwa notify vapid" },
{ title: "Server offline after (minutes)", where: "Notifications › What to send › Servers and disks", to: `${N}?tab=events`, words: "offline stopped reporting silent agent threshold limit minutes" },
{ title: "Disk usage alert at (percent)", where: "Notifications › What to send › Servers and disks", to: `${N}?tab=events`, words: "disk full storage percent threshold space" },
{ title: "Warn when a disk will fill within (days)", where: "Notifications › What to send › Servers and disks", to: `${N}?tab=events`, words: "disk forecast fill growth trend days" },
{ title: "Away mode: hold notifications while I'm away", where: "Notifications › When", to: `${N}?tab=when`, words: "away holiday vacation travel back hold digest pause mute do not disturb critical" },
{ title: "Let critical alerts through quiet hours", where: "Notifications › When", to: `${N}?tab=when`, words: "quiet hours critical night wake sleep through urgent" },
{ title: "Quarterly and annual reports", where: "Notifications › When", to: `${N}?tab=when`, words: "report quarterly annual yearly quarter year send message monthly" },
{ title: "Warn about critical vulnerabilities in Docker images", where: "Notifications › What to send › Backups and updates", to: `${N}?tab=events&section=backups`, words: "vulnerability vulnerabilities cve security scan critical dockhand grype trivy image docker" },
{ title: "Warn when a Docker container is broken, and containers to leave alone", where: "Notifications › What to send › Backups and updates", to: `${N}?tab=events&section=backups`, words: "docker container restarting restart loop unhealthy stopped exited created dockhand hawser ignore leave alone" },
{ title: "Warn when CPU or memory is unusually high for the time", where: "Notifications › What to send › Servers and disks", to: `${N}?tab=events`, words: "baseline usual normal unusual unusually busy high cpu memory load weekday hour history anomaly" },
{ title: "Warn when a server starts listening on a new port", where: "Notifications › What to send › Servers and disks", to: `${N}?tab=events`, words: "new port baseline listening tcp monitoring" },
{ title: "Call an alert flapping after (raises in an hour)", where: "Notifications › What to send › Servers and disks", to: `${N}?tab=events`, words: "flapping flap noise repeat raised cleared again hold back" },
{ title: "Alert when a network device is offline for (minutes)", where: "Notifications › What to send › Servers and disks", to: `${N}?tab=events`, words: "unifi network device switch access point gateway offline" },
{ title: "Secret, Tailscale key and domain expiry reminders", where: "Notifications › What to send › Secrets, keys and domains", to: `${N}?tab=events&section=secrets`, words: "expiry expire secrets certificate tailscale key domain renew warn days" },
{ title: "Backups too old, and restore tests", where: "Notifications › What to send › Backups and updates", to: `${N}?tab=events&section=backups`, words: "backup stale old restore test guest proxmox updates docker image" },
{ title: "Integration, automation and ticket alerts", where: "Notifications › What to send › Integrations and automation", to: `${N}?tab=events&section=integrations`, words: "integration failing semaphore gitea automation failed osticket tickets uptime kuma" },
{ title: "DNS change notifications", where: "Notifications › What to send › DNS changes", to: `${N}?tab=events&section=dns`, words: "dns changes record added removed" },
{ title: "Routing rules: which channel gets which alert", where: "Notifications › Who hears what", to: `${N}?tab=routing`, words: "routing rules route channel tags severity kinds mute" },
{ title: "Escalation: tell more people if nobody acts", where: "Notifications › Who hears what", to: `${N}?tab=routing`, words: "escalation escalate unacknowledged steps neglected" },
{ title: "Time zone and daily reminders", where: "Notifications › When", to: `${N}?tab=when`, words: "timezone time zone daily reminder time of day" },
{ title: "Quiet hours", where: "Notifications › When", to: `${N}?tab=when`, words: "quiet hours night hold queue do not disturb" },
{ title: "Monthly report", where: "Notifications › When", to: `${N}?tab=when`, words: "monthly report day of month send availability" },
{ title: "Weekly digest", where: "Notifications › When", to: `${N}?tab=when`, words: "weekly digest summary email day" },
{ title: "Open osTicket tickets from alerts", where: "Alert settings › Alert tickets", to: "/alert-settings?view=tickets", words: "osticket ticket alert open api key which problems" },
// Sign-in
{ title: "Roles from groups", where: "Sign-in", to: "/settings/sign-in", words: "roles groups authentik oidc admin operator viewer claim map" },