feat(web): metric monitor rule builder and per-server state table

This commit is contained in:
mrhid6 committed 2026-09-17 09:11:23 +00:00
1 parent 3cb8463dc7
commit 4158696388
7 files changed
+213 -10

No files matched your search

+16
View File
@@ -121,6 +121,18 @@ export interface Incident {
server_id?: string;
}
/** Per-server state for a metric monitor's rule, one row per matching server. */
export interface MonitorServerState {
monitor_id: string;
server_id: string;
hostname?: string;
status: MonitorStatus;
breach_since?: string;
value: number;
message?: string;
updated_at: string;
}
/** One check result. Kept for 48 hours, which is what the sub-hour views read. */
export interface MonitorSample {
monitor_id: string;
@@ -1035,6 +1047,10 @@ export const api = {
return request<Incident[]>(`/monitors/${monitorId}/incidents`);
},
monitorServers(monitorId: string): Promise<MonitorServerState[]> {
return request<MonitorServerState[]>(`/monitors/${monitorId}/servers`);
},
getMonitorUptime(monitorId: string): Promise<Rollup[]> {
return request<Rollup[]>(`/monitors/${monitorId}/uptime`);
},