Add alert rule editing UI

This commit is contained in:
Keith Smith
2026-05-23 16:08:27 -06:00
parent a8a4eb84f6
commit 5c9f93692a
10 changed files with 340 additions and 47 deletions
+8
View File
@@ -1,4 +1,6 @@
import type {
AlertRule,
AlertRuleUpdate,
Asset,
CheckResult,
Incident,
@@ -85,6 +87,12 @@ export const api = {
}),
monitorResults: (token: string, monitorId: number, limit = 1) =>
request<CheckResult[]>(`/monitors/${monitorId}/results?limit=${limit}`, token),
alertRules: (token: string) => request<AlertRule[]>("/alerts/rules", token),
updateAlertRule: (token: string, ruleId: number, payload: AlertRuleUpdate) =>
request<AlertRule>(`/alerts/rules/${ruleId}`, token, {
method: "PATCH",
body: JSON.stringify(payload),
}),
incidents: (token: string) => request<Incident[]>("/incidents", token),
acknowledgeIncident: (token: string, incidentId: number) =>
request<Incident>(`/incidents/${incidentId}/acknowledge`, token, {