Disk fill forecasts, skeleton loaders, and a Silence button on alerts

A disk that is on course to be full within 14 days (setting: 0 turns it off) is
flagged on the Alerts page and dashboard, from the server's own history: needs
three days of steady growth, skips erratic disks and ones the ordinary disk
alert covers. Skeleton placeholders replace "Fetching status…" and "Loading…".
Alerts that a maintenance window can silence get a Silence button (1, 4 or 24
hours) that starts one, and the alert list is refreshed at once when a window
starts or ends.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-15 00:12:33 +02:00
1 parent 82974b98d0
commit f7f5e1cd41
24 files changed
+566 -25

No files matched your search

+5
View File
@@ -4,6 +4,7 @@ import { z } from "zod";
import { db } from "../db/client.js";
import { dnsProviders, integrations, maintenanceAliases, maintenanceTargetTypes, maintenanceWindows, servers } from "../db/schema.js";
import { hostOfAddress } from "../services/kumaTargets.js";
import { invalidateAlertsCache } from "../services/alerts.js";
import { requireAuth, requireRole } from "../auth/middleware.js";
import { recordAudit } from "../services/audit.js";
import { describeTarget, listActiveWindows, listUpcomingWindows, startOrExtendWindow } from "../services/maintenance.js";
@@ -80,6 +81,7 @@ maintenanceRouter.post("/", requireRole("operator"), asyncHandler(async (req, re
detail: { name: result.target.name, minutes, reason: reason ?? null },
});
invalidateAlertsCache();
res.status(201).json({ window: { ...result.window, targetName: result.target.name, targetKind: result.target.kind } });
}));
@@ -149,6 +151,7 @@ maintenanceRouter.post("/import/uptimekuma", requireRole("operator"), asyncHandl
imported.push({ serverId: m.matchedServer.id, serverName: result.target.name, monitorName: m.name, extended: result.extended });
}
invalidateAlertsCache();
res.json({ imported, unmatched, monitorsInMaintenance: inMaintenance.length, monitorsChecked: monitors.length });
}));
@@ -223,6 +226,7 @@ maintenanceRouter.post("/sync/uptimekuma", requireRole("operator"), asyncHandler
targetId: parsed.data.integrationId,
detail: { started: result.started, updated: result.updated, removed: result.removed },
});
invalidateAlertsCache();
res.json(result);
} catch (err) {
if (err instanceof KumaSyncError) {
@@ -253,5 +257,6 @@ maintenanceRouter.delete("/:id", requireRole("operator"), asyncHandler(async (re
targetId: existing.targetId,
detail: { name: target?.name ?? null },
});
invalidateAlertsCache();
res.status(204).end();
}));