Files
Homelab-manager/web/src/pages/Maintenance.tsx
T
bobbanandClaude Sonnet 5.5 6e39430a1f Swedish interface: labels and short texts across every page
About 1,600 more headings, buttons, table columns, status words, placeholders and short messages are translated. Tables of words built when the app loads are now read when they are drawn, so they follow the language, and a test fails if text is translated at load time.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-16 20:16:39 +01:00

749 lines
33 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { useEffect, useState } from "react";
import ImpactNote from "../components/ImpactNote";
import {
api,
type CurrentUser,
type IntegrationSummary,
type MaintenanceAlias,
type MaintenanceBulkScope,
type MaintenanceTargets,
type MaintenanceTargetType,
type MaintenanceWindow,
type UptimeKumaImportResult,
type UptimeKumaSyncResult,
} from "../api/client";
import { formatDateTime } from "../utils/date";
import { formatRemaining } from "../utils/duration";
import { readableError } from "../utils/errors";
import { ErrorNotice } from "../components/Notice";
import { toast } from "../utils/toast";
import { confirmDialog } from "../utils/dialogs";
import MaintenanceTimeline from "../components/MaintenanceTimeline";
import RecurringMaintenance from "../components/RecurringMaintenance";
import ExportTableButton from "../components/ExportTableButton";
import { EmptyRow, LoadingRow } from "../components/EmptyState";
import PageIntro from "../components/PageIntro";
import { t } from "../i18n";
const DURATIONS: { minutes: number; label: string }[] = [
{ minutes: 30, label: "30 minutes" },
{ minutes: 60, label: "1 hour" },
{ minutes: 120, label: "2 hours" },
{ minutes: 240, label: "4 hours" },
{ minutes: 480, label: "8 hours" },
{ minutes: 1440, label: "24 hours" },
{ minutes: 4320, label: "3 days" },
];
// Tells the app shell's banner to refetch right away instead of waiting for its next poll.
function announceChange() {
window.dispatchEvent(new Event("maintenance-changed"));
}
export default function Maintenance({ user }: { user: CurrentUser }) {
const canEdit = user.role === "admin" || user.role === "operator";
const [windows, setWindows] = useState<MaintenanceWindow[] | null>(null);
const [upcoming, setUpcoming] = useState<MaintenanceWindow[]>([]);
const [aliases, setAliases] = useState<MaintenanceAlias[]>([]);
const [aliasAddress, setAliasAddress] = useState("");
const [aliasTarget, setAliasTarget] = useState("");
const [aliasBusy, setAliasBusy] = useState(false);
const [aliasError, setAliasError] = useState<string | null>(null);
const [targets, setTargets] = useState<MaintenanceTargets | null>(null);
// Whether what depends on the chosen target is silenced along with it (offered once the target is known to have dependents).
const [withDependents, setWithDependents] = useState(true);
const [error, setError] = useState<string | null>(null);
const [now, setNow] = useState(() => Date.now());
const [target, setTarget] = useState("");
const [minutes, setMinutes] = useState(60);
const [reason, setReason] = useState("");
const [busy, setBusy] = useState(false);
const [kumaIntegrations, setKumaIntegrations] = useState<IntegrationSummary[] | null>(null);
const [kumaIntegrationId, setKumaIntegrationId] = useState<number | "">("");
const [kumaMinutes, setKumaMinutes] = useState(60);
const [kumaBusy, setKumaBusy] = useState(false);
const [kumaError, setKumaError] = useState<string | null>(null);
const [kumaResult, setKumaResult] = useState<UptimeKumaImportResult | null>(null);
const [syncBusy, setSyncBusy] = useState(false);
const [syncError, setSyncError] = useState<string | null>(null);
const [syncResult, setSyncResult] = useState<UptimeKumaSyncResult | null>(null);
useEffect(() => {
api.integrations
.list()
.then((res) => {
const found = res.integrations.filter((i) => i.type === "uptimekuma");
setKumaIntegrations(found);
const firstEnabled = found.find((i) => i.enabled);
if (firstEnabled) setKumaIntegrationId(firstEnabled.id);
})
.catch(() => setKumaIntegrations([]));
}, []);
function load() {
api.maintenance
.list()
.then((res) => {
setWindows(res.windows);
setUpcoming(res.upcoming ?? []);
setAliases(res.aliases ?? []);
setTargets(res.targets);
})
.catch((err) => setError(readableError(err)));
}
useEffect(() => {
load();
const tick = setInterval(() => setNow(Date.now()), 30_000);
return () => clearInterval(tick);
}, []);
async function startBulk(scope: MaintenanceBulkScope) {
const words = t(DURATIONS.find((d) => d.minutes === minutes)?.label ?? "{n} minutes", { n: minutes });
// Everything is the one choice that can hide a real outage, so it asks first.
if (
scope === "everything" &&
!(await confirmDialog({
title: t("Silence everything?"),
message: `This silences every alert about every server, integration and DNS provider for ${words}. Anything still wrong when it ends alerts then.`,
confirmLabel: t("Silence everything"),
danger: true,
}))
)
return;
setError(null);
setBusy(true);
try {
const res = await api.maintenance.startBulk({ scope, minutes, reason: reason.trim() || undefined });
setTarget("");
setReason("");
toast.success(`Maintenance started on ${res.total} item${res.total === 1 ? "" : "s"} for ${words}. End them all from the Active list.`);
load();
announceChange();
} catch (err) {
setError(readableError(err));
} finally {
setBusy(false);
}
}
async function endAll() {
if (!(await confirmDialog({ title: t("End all maintenance"), message: `End all ${windows?.length ?? 0} windows now? Alerts about them become active again.`, confirmLabel: t("End all"), danger: true }))) return;
setError(null);
try {
const res = await api.maintenance.endAll();
toast.success(`Ended ${res.ended} maintenance window${res.ended === 1 ? "" : "s"}. Alerts are active again.`);
load();
announceChange();
} catch (err) {
setError(readableError(err));
}
}
async function start(e: React.FormEvent) {
e.preventDefault();
if (target.startsWith("all:")) return startBulk(target.slice(4) as MaintenanceBulkScope);
const [targetType, id] = target.split(":");
if (!targetType || !id) return;
setError(null);
setBusy(true);
try {
const res = await api.maintenance.start({
targetType: targetType as MaintenanceTargetType,
targetId: Number(id),
minutes,
reason: reason.trim() || undefined,
withDependents: withDependents || undefined,
});
setTarget("");
setReason("");
const also = res.alsoSilenced?.length ?? 0;
toast.success(also > 0 ? `Maintenance started, and on ${also} thing${also === 1 ? "" : "s"} that depend on it. Alerts for them are silenced until it ends.` : t("Maintenance started. Alerts for it are silenced until it ends."));
load();
announceChange();
} catch (err) {
setError(readableError(err));
} finally {
setBusy(false);
}
}
async function addAlias(e: React.FormEvent) {
e.preventDefault();
const [targetType, id] = aliasTarget.split(":");
if (!targetType || !id) return;
setAliasError(null);
setAliasBusy(true);
try {
await api.maintenance.addAlias({ address: aliasAddress.trim(), targetType: targetType as MaintenanceTargetType, targetId: Number(id) });
setAliasAddress("");
setAliasTarget("");
load();
} catch (err) {
setAliasError(readableError(err));
} finally {
setAliasBusy(false);
}
}
async function removeAlias(a: MaintenanceAlias) {
setAliasError(null);
try {
await api.maintenance.removeAlias(a.id);
load();
} catch (err) {
setAliasError(readableError(err));
}
}
async function end(w: MaintenanceWindow) {
setError(null);
try {
await api.maintenance.end(w.id);
toast.success(w.startedAt > new Date().toISOString() ? t("Scheduled window cancelled.") : t("Maintenance ended. Alerts for it are active again."));
load();
announceChange();
} catch (err) {
setError(readableError(err));
}
}
async function syncFromUptimeKuma() {
if (kumaIntegrationId === "") return;
setSyncError(null);
setSyncResult(null);
setSyncBusy(true);
try {
const result = await api.maintenance.syncUptimeKuma({ integrationId: kumaIntegrationId });
setSyncResult(result);
load();
announceChange();
} catch (err) {
setSyncError(readableError(err));
} finally {
setSyncBusy(false);
}
}
async function importFromUptimeKuma(e: React.FormEvent) {
e.preventDefault();
if (kumaIntegrationId === "") return;
setKumaError(null);
setKumaResult(null);
setKumaBusy(true);
try {
const result = await api.maintenance.importUptimeKuma({ integrationId: kumaIntegrationId, minutes: kumaMinutes });
setKumaResult(result);
if (result.imported.length > 0) {
load();
announceChange();
}
} catch (err) {
setKumaError(readableError(err));
} finally {
setKumaBusy(false);
}
}
return (
<>
<h2 className="page-title mb-3">{t("Maintenance")}</h2>
<PageIntro>
Silence alerts about one server or integration while you work on it. Every window ends on its own — anything
still wrong when it ends alerts then, so nothing stays hidden.
</PageIntro>
<ErrorNotice error={error} />
{canEdit && (
<div className="card mb-3">
<div className="card-header">
<h3 className="card-title">{t("Start maintenance")}</h3>
</div>
<form onSubmit={start}>
<div className="card-body row g-3">
<div className="col-md-4">
<label className="form-label">{t("What are you working on?")}</label>
<select className="form-select" required value={target} onChange={(e) => setTarget(e.target.value)}>
<option value="">{t("Choose…")}</option>
{targets && targets.servers.length + targets.integrations.length + targets.dnsProviders.length + targets.devices.length > 1 && (
<optgroup label={t("Many at once")}>
<option value="all:everything">{t("Everything — every server, integration, network device and DNS provider")}</option>
{targets.devices.length > 1 && <option value="all:devices">All network devices ({targets.devices.length})</option>}
{targets.servers.length > 1 && <option value="all:servers">All servers ({targets.servers.length})</option>}
{targets.integrations.length > 1 && <option value="all:integrations">{t("All integrations (the enabled ones)")}</option>}
{targets.dnsProviders.length > 1 && <option value="all:dns_providers">{t("All DNS providers (the enabled ones)")}</option>}
</optgroup>
)}
{targets && targets.servers.length > 0 && (
<optgroup label={t("Servers")}>
{targets.servers.map((s) => (
<option key={`s${s.id}`} value={`server:${s.id}`}>
{s.name}
</option>
))}
</optgroup>
)}
{targets && targets.integrations.length > 0 && (
<optgroup label={t("Integrations")}>
{targets.integrations.map((i) => (
<option key={`i${i.id}`} value={`integration:${i.id}`}>
{i.name} ({i.type})
</option>
))}
</optgroup>
)}
{targets && targets.devices.length > 0 && (
<optgroup label={t("Network devices")}>
{targets.devices.map((d) => (
<option key={`n${d.id}`} value={`device:${d.id}`}>
{d.name} ({d.kind.replace("_", " ")})
</option>
))}
</optgroup>
)}
{targets && targets.dnsProviders.length > 0 && (
<optgroup label={t("DNS providers")}>
{targets.dnsProviders.map((p) => (
<option key={`d${p.id}`} value={`dns_provider:${p.id}`}>
{p.name} ({p.providerType})
</option>
))}
</optgroup>
)}
</select>
</div>
<div className="col-md-3">
<label className="form-label">{t("For")}</label>
<select className="form-select" value={minutes} onChange={(e) => setMinutes(Number(e.target.value))}>
{DURATIONS.map((d) => (
<option key={d.minutes} value={d.minutes}>
{t(d.label)}
</option>
))}
</select>
</div>
<div className="col-md-5">
<label className="form-label">{t("Reason (optional)")}</label>
<input
className="form-control"
maxLength={200}
placeholder="e.g. kernel update and reboot"
value={reason}
onChange={(e) => setReason(e.target.value)}
/>
</div>
{(target.startsWith("server:") || target.startsWith("integration:")) && (
<div className="col-12">
<ImpactNote targets={[{ type: target.split(":")[0], id: Number(target.split(":")[1]) }]} silence={{ value: withDependents, onChange: setWithDependents }} />
</div>
)}
</div>
<div className="card-footer">
<button type="submit" className="btn btn-primary" disabled={busy || !target}>
{busy ? t("Starting…") : t("Start maintenance")}
</button>
</div>
</form>
</div>
)}
{((windows?.length ?? 0) > 0 || upcoming.length > 0) && <MaintenanceTimeline windows={[...(windows ?? []), ...upcoming]} now={now} />}
<RecurringMaintenance
canEdit={canEdit}
targets={targets}
onChanged={() => {
load();
announceChange();
}}
/>
{canEdit && kumaIntegrations && kumaIntegrations.length > 0 && (
<div className="card mb-3">
<div className="card-header">
<h3 className="card-title">{t("Import from Uptime Kuma")}</h3>
</div>
<form onSubmit={importFromUptimeKuma}>
<div className="card-body row g-3">
<div className="text-secondary">
<strong>{t("Sync schedule")}</strong> copies Uptime Kuma's maintenance windows — the one running now and the
next one of each daily, weekly or one-off window — onto the servers their monitors belong to, so they
show up under Scheduled below and silence alerts when they start. It needs the login username and
password filled in on the integration, and runs by itself every 15 minutes when{" "}
<em>{t("Keep maintenance windows in step")}</em> is ticked there.
</div>
<div className="text-secondary">
<strong>{t("Import now")}</strong> only looks at what is in maintenance <em>this moment</em>: pick a duration
— it doesn't have to match Uptime Kuma's own schedule exactly, and importing again later just extends
the window instead of stacking a second one.
</div>
{kumaIntegrations.length > 1 && (
<div className="col-md-5">
<label className="form-label">{t("Uptime Kuma integration")}</label>
<select
className="form-select"
value={kumaIntegrationId}
onChange={(e) => setKumaIntegrationId(e.target.value ? Number(e.target.value) : "")}
>
{kumaIntegrations.map((i) => (
<option key={i.id} value={i.id} disabled={!i.enabled}>
{i.name}
{!i.enabled ? " — disabled" : ""}
</option>
))}
</select>
</div>
)}
<div className="col-md-3">
<label className="form-label">{t("For")}</label>
<select className="form-select" value={kumaMinutes} onChange={(e) => setKumaMinutes(Number(e.target.value))}>
{DURATIONS.map((d) => (
<option key={d.minutes} value={d.minutes}>
{t(d.label)}
</option>
))}
</select>
</div>
</div>
{syncError && (
<div className="card-body pt-0">
<div className="alert alert-danger mb-0">{syncError}</div>
</div>
)}
{syncResult && (
<div className="card-body pt-0">
<div className={`alert ${syncResult.started + syncResult.updated + syncResult.removed > 0 ? "alert-success" : "alert-info"} mb-0`}>
{syncResult.maintenances.length === 0
? t("Uptime Kuma has no maintenance windows.")
: `Read ${syncResult.maintenances.length} maintenance window${syncResult.maintenances.length === 1 ? "" : "s"} from Uptime Kuma: ${syncResult.started} added, ${syncResult.updated} changed, ${syncResult.removed} removed here.`}
<ul className="mb-0 mt-2">
{syncResult.maintenances.map((m) => (
<li key={m.id}>
<strong>{m.title}</strong>{" "}
<span className="text-secondary">
({m.strategy}, {m.status})
</span>
{m.targets.length > 0 ? ` → ${m.targets.map((t) => `${t.name} (${t.type === "dns_provider" ? "DNS provider" : t.type})`).join(", ")}` : m.note ? ` — nothing to schedule: ${m.note}` : ""}
{m.unmatched.length > 0 && <span className="text-secondary"> · nothing here for {m.unmatched.join(", ")}</span>}
{m.unmatched.length > 0 && (
<div className="text-secondary small">
Is one of those yours? Add its address under <em>{t("Address aliases")}</em> below, saying what it belongs to.
</div>
)}
<div className="text-secondary small">
Covers {m.monitorCount} monitor{m.monitorCount === 1 ? "" : "s"} in Uptime Kuma ·{" "}
{m.slots.length === 0
? t("Uptime Kuma gave no time slot")
: m.slots.map((s) => `${formatDateTime(new Date(s.start))} – ${formatDateTime(new Date(s.end))}`).join("; ")}
</div>
</li>
))}
</ul>
</div>
</div>
)}
{kumaError && (
<div className="card-body pt-0">
<div className="alert alert-danger mb-0">{kumaError}</div>
</div>
)}
{kumaResult && (
<div className="card-body pt-0">
{kumaResult.monitorsInMaintenance === 0 ? (
<div className="alert alert-info mb-0">
{kumaResult.monitorsChecked === 0
? t("Uptime Kuma answered, but reported no monitors at all.")
: `Read ${kumaResult.monitorsChecked} monitor${kumaResult.monitorsChecked === 1 ? "" : "s"} from Uptime Kuma; none is in maintenance right now.`}{" "}
Only a maintenance window that is active at this moment can be imported — one scheduled for later
shows up here once it starts.
</div>
) : (
<div className="alert alert-success mb-0">
{kumaResult.imported.length > 0 ? (
<>
{kumaResult.imported.length} window{kumaResult.imported.length === 1 ? "" : "s"}{" "}
{kumaResult.imported.every((i) => i.extended)
? "extended"
: kumaResult.imported.every((i) => !i.extended)
? "started"
: "started or extended"}
: {kumaResult.imported.map((i) => `${i.serverName} (${i.extended ? "extended" : "started"})`).join(", ")}.
</>
) : (
"None of the monitors currently in maintenance matched a server."
)}
{kumaResult.unmatched.length > 0 && (
<div className="mt-1">
{kumaResult.unmatched.length} monitor{kumaResult.unmatched.length === 1 ? "" : "s"} in maintenance
{" "}couldn't be matched to a server: {kumaResult.unmatched.join(", ")}.
</div>
)}
</div>
)}
</div>
)}
<div className="card-footer d-flex align-items-center gap-3">
<button type="button" className="btn btn-primary" onClick={syncFromUptimeKuma} disabled={syncBusy || kumaIntegrationId === ""}>
{syncBusy ? t("Syncing…") : t("Sync schedule")}
</button>
<button type="submit" className="btn" disabled={kumaBusy || kumaIntegrationId === ""}>
{kumaBusy ? t("Importing…") : t("Import now")}
</button>
{kumaIntegrationId === "" && (
<span className="text-secondary">{t("Every Uptime Kuma integration is disabled — enable one under Integrations.")}</span>
)}
</div>
</form>
</div>
)}
{canEdit && kumaIntegrations && kumaIntegrations.length > 0 && (
<div className="card mb-3">
<div className="card-header">
<h3 className="card-title">{t("Address aliases")}</h3>
<div className="card-actions">
<ExportTableButton filename="maintenance-aliases" />
</div>
</div>
<form onSubmit={addAlias}>
<div className="card-body row g-3">
<div className="text-secondary">
Uptime Kuma may watch something by a different address than the one you added it with here — a host
added by its LAN address but monitored over Tailscale, for instance. An alias says that an address
belongs to a server, integration or DNS provider, so the syncing above puts the maintenance window
there. Matching stays exact: only the address you list counts.
</div>
<div className="col-md-4">
<label className="form-label">{t("Address in Uptime Kuma")}</label>
<input
className="form-control"
required
maxLength={253}
placeholder="e.g. 100.116.179.43 or felicia.tail1234.ts.net"
value={aliasAddress}
onChange={(e) => setAliasAddress(e.target.value)}
/>
</div>
<div className="col-md-5">
<label className="form-label">{t("Belongs to")}</label>
<select className="form-select" required value={aliasTarget} onChange={(e) => setAliasTarget(e.target.value)}>
<option value="">{t("Choose…")}</option>
{targets && targets.servers.length > 0 && (
<optgroup label={t("Servers")}>
{targets.servers.map((s) => (
<option key={`s${s.id}`} value={`server:${s.id}`}>
{s.name}
</option>
))}
</optgroup>
)}
{targets && targets.integrations.length > 0 && (
<optgroup label={t("Integrations")}>
{targets.integrations.map((i) => (
<option key={`i${i.id}`} value={`integration:${i.id}`}>
{i.name} ({i.type})
</option>
))}
</optgroup>
)}
{targets && targets.dnsProviders.length > 0 && (
<optgroup label={t("DNS providers")}>
{targets.dnsProviders.map((p) => (
<option key={`d${p.id}`} value={`dns_provider:${p.id}`}>
{p.name} ({p.providerType})
</option>
))}
</optgroup>
)}
</select>
</div>
<div className="col-md-3 d-flex align-items-end">
<button type="submit" className="btn btn-primary" disabled={aliasBusy || !aliasTarget || !aliasAddress.trim()}>
{aliasBusy ? t("Adding…") : t("Add alias")}
</button>
</div>
</div>
{aliasError && (
<div className="card-body pt-0">
<div className="alert alert-danger mb-0">{aliasError}</div>
</div>
)}
</form>
{aliases.length > 0 && (
<div className="table-responsive">
<table className="table table-vcenter card-table">
<thead>
<tr>
<th>{t("Address")}</th>
<th>{t("Belongs to")}</th>
<th className="w-1">{t("Actions")}</th>
</tr>
</thead>
<tbody>
{aliases.map((a) => (
<tr key={a.id}>
<td>{a.address}</td>
<td>
{a.targetName} <span className="text-secondary">· {a.targetKind}</span>
</td>
<td>
<button className="btn btn-sm btn-outline-danger" onClick={() => removeAlias(a)}>
{t("Remove")}
</button>
</td>
</tr>
))}
</tbody>
</table>
</div>
)}
</div>
)}
{upcoming.length > 0 && (
<div className="card mb-3">
<div className="card-header">
<h3 className="card-title">{t("Scheduled")}</h3>
<div className="card-actions">
<ExportTableButton filename="maintenance-scheduled" />
</div>
</div>
<div className="table-responsive">
<table className="table table-vcenter card-table">
<thead>
<tr>
<th>{t("Target")}</th>
<th>{t("Reason")}</th>
<th>{t("Starts")}</th>
<th>{t("Ends")}</th>
{canEdit && <th className="w-1">{t("Actions")}</th>}
</tr>
</thead>
<tbody>
{upcoming.map((w) => (
<tr key={w.id}>
<td>
{w.targetName} <span className="text-secondary">· {w.targetKind}</span>
</td>
<td className="text-secondary">{w.reason ?? "—"}</td>
<td data-csv={w.startedAt}>
<span className="badge bg-blue-lt text-blue me-2">in {formatRemaining(w.startedAt, now)}</span>
<span className="text-secondary small">{formatDateTime(new Date(w.startedAt))}</span>
</td>
<td className="text-secondary small" data-csv={w.endsAt}>{formatDateTime(new Date(w.endsAt))}</td>
{canEdit && (
<td>
<button className="btn btn-sm btn-outline-secondary" onClick={() => end(w)}>
{t("Cancel")}
</button>
</td>
)}
</tr>
))}
</tbody>
</table>
</div>
<div className="card-footer text-secondary small">
Not silencing anything yet. These start by themselves; the schedule comes from Uptime Kuma and is refreshed
every 15 minutes, so a cancelled one stays cancelled but a change in Uptime Kuma is followed.
</div>
</div>
)}
<div className="card mb-3">
<div className="card-header">
<h3 className="card-title">{t("Active")}</h3>
<div className="card-actions">
<ExportTableButton filename="maintenance-active" />
{canEdit && (windows?.length ?? 0) > 1 && (
<button className="btn btn-sm btn-outline-secondary" onClick={() => void endAll()}>
End all ({windows?.length})
</button>
)}
</div>
</div>
<div className="table-responsive">
<table className="table table-vcenter card-table">
<thead>
<tr>
<th>{t("Target")}</th>
<th>{t("Reason")}</th>
<th>{t("Ends")}</th>
<th>{t("Started by")}</th>
{canEdit && <th className="w-1">{t("Actions")}</th>}
</tr>
</thead>
<tbody>
{windows?.map((w) => (
<tr key={w.id}>
<td>
{w.targetName} <span className="text-secondary">· {w.targetKind}</span>
{w.source?.startsWith("kuma:") && <span className="badge bg-cyan-lt ms-2">{t("Uptime Kuma")}</span>}
</td>
<td className="text-secondary">{w.reason ?? "—"}</td>
<td data-csv={w.endsAt}>
<span className="badge bg-yellow-lt text-yellow me-2">{formatRemaining(w.endsAt, now)} left</span>
<span className="text-secondary small">{formatDateTime(new Date(w.endsAt))}</span>
</td>
<td className="text-secondary">{w.createdBy ?? "—"}</td>
{canEdit && (
<td>
<button className="btn btn-sm btn-outline-secondary" onClick={() => end(w)}>
{t("End now")}
</button>
</td>
)}
</tr>
))}
{windows === null && <LoadingRow colSpan={canEdit ? 5 : 4} />}
{windows?.length === 0 && (
<EmptyRow colSpan={canEdit ? 5 : 4} title={t("Nothing is in maintenance")} hint={t("Every alert is live. Start a window above before you work on something, so it doesn't raise alarms while you do.")} />
)}
</tbody>
</table>
</div>
</div>
<div className="card">
<div className="card-header">
<h3 className="card-title">{t("What gets silenced")}</h3>
</div>
<div className="card-body">
<div className="row">
<div className="col-md-6">
<div className="fw-bold mb-1">{t("Silenced for the target")}</div>
<ul className="text-secondary">
<li>{t("Server offline and disk-full alerts (for a server).")}</li>
<li>{t("Storage, volume and disk-health alerts (for a Proxmox or Synology integration).")}</li>
<li>{t("Backup-failure and uncovered-guest alerts (for a Proxmox integration).")}</li>
<li>{t("Backup-verification-failure alerts (for a Proxmox Backup Server integration).")}</li>
<li>{t("Failed-run alerts for the Semaphore or Gitea integration you choose.")}</li>
<li>
"Integration down" alerts for that <em>type</em> of service — these are tracked per type (e.g. all
Proxmox), not per instance, so with two Proxmox integrations a failure on the other one is silenced
too while a window is open.
</li>
</ul>
</div>
<div className="col-md-6">
<div className="fw-bold mb-1">{t("Not silenced")}</div>
<ul className="text-secondary">
<li>{t("Secret and certificate expiry, Tailscale key expiry, Docker update reminders.")}</li>
<li>{t("DNS record change notifications.")}</li>
</ul>
<div className="fw-bold mb-1">{t("When a window ends")}</div>
<div className="text-secondary">
A problem that started during it and is still there alerts on the next check (within 15 minutes). One
that was already alerted before it began and has since cleared is reported as cleared; one that
started and cleared entirely inside the window is never reported.
</div>
</div>
</div>
</div>
</div>
</>
);
}