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

+1 -1
View File
@@ -1788,7 +1788,7 @@ export const webhookEvents = ["alert.opened", "alert.resolved", "maintenance.sta
export type WebhookEvent = (typeof webhookEvents)[number];
// A URL that gets a signed JSON message for the events it subscribes to — for Home Assistant, n8n, a status board. Separate from the
// chat-style webhook under Alert settings → Notifications, which carries the same text a person would read.
// chat-style webhook under Settings → Notifications, which carries the same text a person would read.
export const eventWebhooks = sqliteTable("event_webhooks", {
id: integer("id").primaryKey({ autoIncrement: true }),
label: text("label").notNull(),
+1 -1
View File
@@ -239,7 +239,7 @@ export function agendaFromData(data: AgendaData, now: Date, tz: string, days: nu
day(`renewal:${r.id}`, "renewal", r.nextRenewal, () => ({ title: `${r.name} is billed — ${money}`, link: "/costs" }));
}
// A restore test is due a set time after the last good one — only if a time limit is set (Alert settings → Notifications).
// A restore test is due a set time after the last good one — only if a time limit is set (Settings → Notifications).
if (data.restoreLimitDays > 0) {
for (const t of data.restoreTests) {
if ((t.result !== "ok" && t.result !== "partial") || !isYmd(t.testedAt)) continue;
+1 -1
View File
@@ -1,6 +1,6 @@
/**
* The links behind buttons on a notification (see services/alertActions.ts for what they do): Acknowledge, Silence for an hour, Snooze until tomorrow morning — from the phone push, an ntfy message, a link in an email or a Gotify message,
* without signing in to the app. A switch an administrator turns on (Alert settings → Notifications → Who hears what); off, no link works.
* without signing in to the app. A switch an administrator turns on (Settings → Notifications → Who hears what); off, no link works.
*
* What makes it safe enough to have is how little each link can do:
*
+2 -2
View File
@@ -81,8 +81,8 @@ export function hintFor(category: string, alertId: string): string {
if (key.startsWith("endpoint-cert:")) return "Renew the certificate, or lower how early the check warns.";
if (key.startsWith("failed-units:")) return "If a service is expected to fail, add it to “Services to ignore” on the server's Host health card; otherwise fix the service.";
if (key.startsWith("disk-forecast:") || category === "disk") return "Raise the limit for this disk (a server can have its own, per disk), or leave it alone on the server's page if it is meant to be full.";
if (category === "offline") return "If the server is just slow to report, raise “Server offline after” under Alert settings → Notifications, or give this server its own limit.";
if (category === "integration") return "Raise “Alert after … consecutive failures” under Alert settings → Notifications; the Call log (Integrations) shows what is failing.";
if (category === "offline") return "If the server is just slow to report, raise “Server offline after” under Settings → Notifications, or give this server its own limit.";
if (category === "integration") return "Raise “Alert after … consecutive failures” under Settings → Notifications; the Call log (Integrations) shows what is failing.";
if (category === "backup") return "A guest that is backed up late each time may need its “too old” limit raised on its server, or its job moved.";
return "Acknowledge it with a note, silence it with maintenance while you work on it, or fix what raises it.";
}
+1 -1
View File
@@ -5,7 +5,7 @@
* Nothing here starts a scan: Dockhand scans when it is told to (by hand, after a pull, or for a whole host), and this only reads what it kept. So an image that was never scanned is
* not known to be clean — the page says how many of a host's images have a scan — and an environment whose summary could not be read is *unknown*, never *none*.
*
* What is raised is **critical** findings only (a host with one or more is a warning), and only while the setting for it is on (Alert settings → Notifications). Dockhand can also notify
* What is raised is **critical** findings only (a host with one or more is a warning), and only while the setting for it is on (Settings → Notifications). Dockhand can also notify
* about vulnerabilities itself; if both are switched on you hear twice.
*/
import { and, eq, notInArray } from "drizzle-orm";
+1 -1
View File
@@ -1,7 +1,7 @@
/**
* Event webhooks: tell another system when something happens. Each webhook is a URL with the events it wants; when one happens it is
* sent a JSON message, signed with the webhook's secret so the receiver can tell it came from here. This is separate from the chat-style
* webhook under Alert settings → Notifications, which carries the same sentence a person would read.
* webhook under Settings → Notifications, which carries the same sentence a person would read.
*
* alert.opened / alert.resolved a problem began or ended — on the same terms as a notification (a problem under maintenance,
* or folded under another, isn't announced until it stands alone)
+1 -1
View File
@@ -1,7 +1,7 @@
/**
* Restore tests: a backup nobody has ever restored is a hope, not a backup. Somebody records when they tried to restore a guest (or anything else
* — a share, a database) and how it went, and the app keeps the history, shows each guest's newest test beside its backups, and speaks up
* when a test failed (always) or when none has been done in too long (if a time limit is set under Alert settings → Notifications).
* when a test failed (always) or when none has been done in too long (if a time limit is set under Settings → Notifications).
*/
import { desc } from "drizzle-orm";
import { db } from "../db/client.js";
+1 -1
View File
@@ -1,5 +1,5 @@
/**
* Per-server alert thresholds. The ones in Alert settings → Notifications apply to every server; some machines are different — a NAS that sits at
* Per-server alert thresholds. The ones in Settings → Notifications apply to every server; some machines are different — a NAS that sits at
* 92% by design, a database host that should speak up at 80%, a laptop that is meant to be off at night. Each server may override the
* server-offline time, the disk-usage percentage, the disk forecast window and (for the Proxmox guest it is linked to) how old a backup may
* be, and may set a limit for one disk or say not to alert about that disk at all. Anything not overridden follows the global setting, so
+2 -2
View File
@@ -165,7 +165,7 @@ export interface MonthlyReportSettings {
time: string;
}
/** The weekly digest: one message a week through the notification channels. Off until an admin switches it on under Alert settings → Notifications. */
/** The weekly digest: one message a week through the notification channels. Off until an admin switches it on under Settings → Notifications. */
export interface DigestSettings {
enabled: boolean;
/** 0 = Sunday … 6 = Saturday, in notifications.timezone. */
@@ -397,7 +397,7 @@ function openValue(section: string, field: string, stored: unknown): unknown {
const name = `${section}.${field}`;
if (!warnedUnreadable.has(name)) {
warnedUnreadable.add(name);
console.warn(`Can't decrypt the stored ${name} — CREDENTIALS_ENCRYPTION_KEY has changed or is missing. Enter it again under Alert settings → Notifications.`);
console.warn(`Can't decrypt the stored ${name} — CREDENTIALS_ENCRYPTION_KEY has changed or is missing. Enter it again under Settings → Notifications.`);
}
return "";
}