diff --git a/server/src/services/kumaMaintenanceSync.ts b/server/src/services/kumaMaintenanceSync.ts index a22dd75..a1e33be 100644 --- a/server/src/services/kumaMaintenanceSync.ts +++ b/server/src/services/kumaMaintenanceSync.ts @@ -101,6 +101,9 @@ export interface MaintenanceSyncSummary { title: string; strategy: string; status: string; + /** How many monitors the window covers in Uptime Kuma, and the time slots Kuma reported for it (running and next). */ + monitorCount: number; + slots: { start: string; end: string }[]; /** Windows that apply here, by server name. */ servers: string[]; /** Monitors the window covers that match no server. */ @@ -167,6 +170,8 @@ export function desiredWindows( title: m.title, strategy: m.strategy, status: m.status, + monitorCount: m.monitorIds.length, + slots: m.timeslots.slice(0, 3), servers: [...matched.values()].sort(), unmatched, note, diff --git a/web/src/api/client.ts b/web/src/api/client.ts index 38ffe81..dc3bae5 100644 --- a/web/src/api/client.ts +++ b/web/src/api/client.ts @@ -781,6 +781,8 @@ export interface UptimeKumaSyncResult { title: string; strategy: string; status: string; + monitorCount: number; + slots: { start: string; end: string }[]; servers: string[]; unmatched: string[]; /** Why it produced no window, when it did not. */ diff --git a/web/src/pages/Maintenance.tsx b/web/src/pages/Maintenance.tsx index dfa404b..072d1da 100644 --- a/web/src/pages/Maintenance.tsx +++ b/web/src/pages/Maintenance.tsx @@ -298,6 +298,12 @@ export default function Maintenance({ user }: { user: CurrentUser }) { {m.servers.length > 0 ? ` → ${m.servers.join(", ")}` : m.note ? ` — nothing to schedule: ${m.note}` : ""} {m.unmatched.length > 0 && · no server for {m.unmatched.join(", ")}} +
+ Covers {m.monitorCount} monitor{m.monitorCount === 1 ? "" : "s"} in Uptime Kuma ·{" "} + {m.slots.length === 0 + ? "Uptime Kuma gave no time slot" + : m.slots.map((s) => `${formatDateTime(new Date(s.start))} – ${formatDateTime(new Date(s.end))}`).join("; ")} +
))}