feat(web): metric monitor rule builder and per-server state table
This commit is contained in:
@@ -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`);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user