Away mode, and critical alerts through quiet hours

For a one-person homelab, "on call" is when you can be reached. Settings ->
Notifications -> When -> Away holds notifications while you are away (a banner on
every page says so) and sends one digest when it ends, at its time or when you say
you are back. Critical alerts can still come through. Quiet hours get the same
"still send critical alerts" option. Escalation steps marked to send in quiet hours
are sent while away too. What is held for one reason is not released while the
other still holds it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-22 19:14:29 +02:00
1 parent 3b31b16796
commit 16b24f5436
21 files changed
+737 -50

No files matched your search

+14
View File
@@ -556,6 +556,15 @@ export interface QuietHoursSettings {
enabled: boolean;
start: string;
end: string;
/** A critical alert is sent at once even inside the window. */
criticalThrough: boolean;
}
/** Whether somebody is away (notifications held until they are back), and how many are being held. */
export interface AwayView {
away: { from: string | null; until: string | null; criticalThrough: boolean; note: string; state: "none" | "planned" | "active" };
held: number;
timezone: string;
}
/** The weekly digest: one message a week through the notification channels. */
@@ -2557,6 +2566,11 @@ export const api = {
create: (label: string) => request<{ token: MetricsToken; secret: string }>("/api/metrics-tokens", { method: "POST", body: JSON.stringify({ label }) }),
remove: (id: number) => request<void>(`/api/metrics-tokens/${id}`, { method: "DELETE" }),
},
away: {
get: () => request<AwayView>("/api/away"),
start: (data: { until: string; from?: string | null; criticalThrough: boolean; note?: string }) => request<AwayView>("/api/away", { method: "PUT", body: JSON.stringify(data) }),
end: () => request<AwayView & { sent: number }>("/api/away", { method: "DELETE" }),
},
serviceLevels: {
list: () => request<{ levels: ServiceLevel[]; subjects: Record<ServiceLevelSubject, { id: number; name: string }[]> }>("/api/service-levels"),
create: (data: ServiceLevelInput) => request<{ id: number }>("/api/service-levels", { method: "POST", body: JSON.stringify(data) }),