Patch plans, a monthly report and new-port alerts
Patch plans (Updates -> Patch plans): updates on a schedule, one server at a time, each by an ordinary update run, stopping at the first failure by default, silencing what depends on a server while it is updated, with one message at the end. Monthly report (Operations -> Monthly report, and optionally a message on a day of the month): availability, incidents, updates, restore tests, backups and renewals for a calendar month, printable. Backed by daily endpoint figures and a record of renewals. New ports: the first report with ports is the baseline; a TCP port that begins listening later and is not noted on the server's Ports card is a warning, cleared by Mark as expected. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ddd0aa622a
commit
be6c5552bd
46 files changed
+7836
-26
No files matched your search
@@ -508,6 +508,17 @@ export interface HealthCheckSettings {
|
||||
backupStaleHours: number;
|
||||
/** A restore test older than this many days is a problem; 0 = off (a failed test always is). */
|
||||
restoreTestDays: number;
|
||||
/** A server that starts listening on a TCP port it did not at first, and that is not noted on its Ports card, is a warning. */
|
||||
newPortAlerts: boolean;
|
||||
}
|
||||
|
||||
/** The monthly report: last month's availability, incidents, updates and renewals, in one message on a day of the month. */
|
||||
export interface MonthlyReportSettings {
|
||||
enabled: boolean;
|
||||
/** Day of the month, 1–28, in the notification time zone. */
|
||||
day: number;
|
||||
/** "HH:MM", in the notification time zone. */
|
||||
time: string;
|
||||
}
|
||||
|
||||
export interface QuietHoursSettings {
|
||||
@@ -543,6 +554,7 @@ export interface AppSettings {
|
||||
digest: DigestSettings;
|
||||
signIn: SignInSettings;
|
||||
profilePictures: ProfilePictureSettings;
|
||||
monthlyReport: MonthlyReportSettings;
|
||||
}
|
||||
|
||||
export type AppSettingsPatch = { [K in keyof AppSettings]?: Partial<AppSettings[K]> };
|
||||
@@ -905,6 +917,94 @@ export interface EndpointInput {
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
export type PatchPlanItemStatus = "pending" | "running" | "done" | "failed" | "skipped";
|
||||
export interface PatchPlanItem {
|
||||
serverId: number;
|
||||
name: string;
|
||||
status: PatchPlanItemStatus;
|
||||
updateRunId: number | null;
|
||||
message: string | null;
|
||||
}
|
||||
export interface PatchPlanRun {
|
||||
id: number;
|
||||
planId: number;
|
||||
planName: string;
|
||||
trigger: "schedule" | "manual";
|
||||
startedBy: string | null;
|
||||
status: "running" | "done" | "failed" | "cancelled";
|
||||
message: string | null;
|
||||
startedAt: string;
|
||||
finishedAt: string | null;
|
||||
items: PatchPlanItem[];
|
||||
}
|
||||
/** Updates on a schedule, one server at a time. */
|
||||
export interface PatchPlan {
|
||||
id: number;
|
||||
name: string;
|
||||
enabled: boolean;
|
||||
/** 0 = Sunday … 6 = Saturday. */
|
||||
days: number[];
|
||||
startTime: string;
|
||||
timezone: string;
|
||||
tags: string[];
|
||||
serverIds: number[];
|
||||
integrationId: number;
|
||||
projectId: number;
|
||||
templateId: number;
|
||||
templateName: string;
|
||||
limitFrom: "name" | "hostname";
|
||||
stopOnFailure: boolean;
|
||||
onlyWithUpdates: boolean;
|
||||
silenceDependents: boolean;
|
||||
windowMinutes: number;
|
||||
createdBy: string | null;
|
||||
/** The servers it covers right now. */
|
||||
servers: { id: number; name: string }[];
|
||||
/** ISO — its next times. */
|
||||
next: string[];
|
||||
running: boolean;
|
||||
}
|
||||
export type PatchPlanInput = Omit<PatchPlan, "id" | "createdBy" | "servers" | "next" | "running">;
|
||||
|
||||
export interface AvailabilityRow {
|
||||
id: number;
|
||||
name: string;
|
||||
percent: number | null;
|
||||
downMinutes: number;
|
||||
}
|
||||
export interface MonthlyReport {
|
||||
month: string;
|
||||
label: string;
|
||||
from: string;
|
||||
to: string;
|
||||
partial: boolean;
|
||||
timezone: string;
|
||||
servers: AvailabilityRow[];
|
||||
integrations: AvailabilityRow[];
|
||||
endpoints: { id: number; name: string; percent: number | null; avgMs: number | null; checks: number }[];
|
||||
incidents: {
|
||||
began: number;
|
||||
resolved: number;
|
||||
stillOpen: number;
|
||||
totalMinutes: number;
|
||||
averageMinutes: number | null;
|
||||
longest: { id: number; message: string; minutes: number } | null;
|
||||
byCategory: { category: string; count: number }[];
|
||||
list: { id: number; message: string; where: string; severity: string; openedAt: string; resolvedAt: string | null; minutes: number }[];
|
||||
};
|
||||
updates: {
|
||||
runs: number;
|
||||
done: number;
|
||||
failed: number;
|
||||
installed: number;
|
||||
byServer: { name: string; runs: number; failed: number; installed: number }[];
|
||||
planRuns: { runs: number; done: number; failed: number };
|
||||
};
|
||||
restoreTests: { label: string; testedAt: string; result: string; note: string | null }[];
|
||||
backups: { ok: number; stale: number; failed: number; none: number; unknown: number; total: number; asOf: string } | null;
|
||||
renewals: { kind: string; subject: string; at: string; fromDate: string; toDate: string }[];
|
||||
}
|
||||
|
||||
/** A check the app could set up for you, from what it already knows. */
|
||||
export interface EndpointSuggestion {
|
||||
key: string;
|
||||
@@ -1322,6 +1422,8 @@ export interface PortEntry {
|
||||
lastSeenOpenAt: string | null;
|
||||
agent: { addresses: string[]; process: string | null; localOnly: boolean } | null;
|
||||
state: "open" | "reserved";
|
||||
/** Began listening after the first report and nobody has noted it: a "new port" alert is on. */
|
||||
isNew: boolean;
|
||||
}
|
||||
|
||||
export interface PortScanSummary {
|
||||
@@ -1947,6 +2049,19 @@ export const api = {
|
||||
start: (data: UpdateRunInput) => request<{ run: UpdateRun }>("/api/update-runs", { method: "POST", body: JSON.stringify(data) }),
|
||||
cancel: (id: number) => request<{ status: string }>(`/api/update-runs/${id}/cancel`, { method: "POST" }),
|
||||
},
|
||||
patchPlans: {
|
||||
list: () => request<{ plans: PatchPlan[]; runs: PatchPlanRun[]; servers: { id: number; name: string; tags: string[] }[]; tags: string[] }>("/api/patch-plans"),
|
||||
create: (data: PatchPlanInput) => request<{ plan: PatchPlan }>("/api/patch-plans", { method: "POST", body: JSON.stringify(data) }),
|
||||
update: (id: number, data: PatchPlanInput) => request<{ plan: PatchPlan }>(`/api/patch-plans/${id}`, { method: "PUT", body: JSON.stringify(data) }),
|
||||
remove: (id: number) => request<void>(`/api/patch-plans/${id}`, { method: "DELETE" }),
|
||||
run: (id: number) => request<{ run: PatchPlanRun }>(`/api/patch-plans/${id}/run`, { method: "POST" }),
|
||||
cancel: (runId: number) => request<{ run: PatchPlanRun }>(`/api/patch-plans/runs/${runId}/cancel`, { method: "POST" }),
|
||||
},
|
||||
reports: {
|
||||
monthly: (month?: string) => request<{ report: MonthlyReport; months: { id: string; label: string }[] }>(`/api/reports/monthly${month ? `?month=${month}` : ""}`),
|
||||
monthlyText: (month?: string) => request<{ title: string; message: string }>(`/api/reports/monthly?format=text${month ? `&month=${month}` : ""}`),
|
||||
sendMonthly: (month?: string) => request<{ sent: boolean }>("/api/reports/monthly/send", { method: "POST", body: JSON.stringify({ month }) }),
|
||||
},
|
||||
backups: {
|
||||
coverage: (staleDays: number, refresh = false) => request<BackupCoverage>(`/api/backups/coverage?staleDays=${staleDays}${refresh ? "&refresh=1" : ""}`),
|
||||
restoreTests: () => request<{ limitDays: number; tests: RestoreTestEntry[]; custom: (RestoreInfo & { key: string; label: string })[] }>("/api/backups/restore-tests"),
|
||||
|
||||
Reference in new issue
Block a user