Show what Uptime Kuma reported for each maintenance window in the sync result
Each window in the "Sync schedule" result now lists how many monitors it covers and the time slots Kuma sent for it, so an empty result can be traced to missing monitors, missing slots or monitors that match no server. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9e483f2163
commit
27a191b54c
3 files changed
+13
No files matched your search
@@ -101,6 +101,9 @@ export interface MaintenanceSyncSummary {
|
|||||||
title: string;
|
title: string;
|
||||||
strategy: string;
|
strategy: string;
|
||||||
status: 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. */
|
/** Windows that apply here, by server name. */
|
||||||
servers: string[];
|
servers: string[];
|
||||||
/** Monitors the window covers that match no server. */
|
/** Monitors the window covers that match no server. */
|
||||||
@@ -167,6 +170,8 @@ export function desiredWindows(
|
|||||||
title: m.title,
|
title: m.title,
|
||||||
strategy: m.strategy,
|
strategy: m.strategy,
|
||||||
status: m.status,
|
status: m.status,
|
||||||
|
monitorCount: m.monitorIds.length,
|
||||||
|
slots: m.timeslots.slice(0, 3),
|
||||||
servers: [...matched.values()].sort(),
|
servers: [...matched.values()].sort(),
|
||||||
unmatched,
|
unmatched,
|
||||||
note,
|
note,
|
||||||
|
|||||||
@@ -781,6 +781,8 @@ export interface UptimeKumaSyncResult {
|
|||||||
title: string;
|
title: string;
|
||||||
strategy: string;
|
strategy: string;
|
||||||
status: string;
|
status: string;
|
||||||
|
monitorCount: number;
|
||||||
|
slots: { start: string; end: string }[];
|
||||||
servers: string[];
|
servers: string[];
|
||||||
unmatched: string[];
|
unmatched: string[];
|
||||||
/** Why it produced no window, when it did not. */
|
/** Why it produced no window, when it did not. */
|
||||||
|
|||||||
@@ -298,6 +298,12 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
|
|||||||
</span>
|
</span>
|
||||||
{m.servers.length > 0 ? ` → ${m.servers.join(", ")}` : m.note ? ` — nothing to schedule: ${m.note}` : ""}
|
{m.servers.length > 0 ? ` → ${m.servers.join(", ")}` : m.note ? ` — nothing to schedule: ${m.note}` : ""}
|
||||||
{m.unmatched.length > 0 && <span className="text-secondary"> · no server for {m.unmatched.join(", ")}</span>}
|
{m.unmatched.length > 0 && <span className="text-secondary"> · no server for {m.unmatched.join(", ")}</span>}
|
||||||
|
<div className="text-secondary small">
|
||||||
|
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("; ")}
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in new issue
Block a user