mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 04:20:45 +08:00
feat(ume): keyword key-alert rules with label and case-insensitive match
Add description keyword matching alongside notificationId rules, require per-rule labels, and improve the AI monitor form layout and clear-on-push UX. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
99e7b1557f
commit
34db62c8d2
11 changed files with 449 additions and 134 deletions
|
|
@ -75,20 +75,26 @@ export const clearLocalUmeAlarmSubscription = () =>
|
|||
export const fetchUmeKeyAlertMonitor = () => apiGet<UmeKeyAlertMonitorResponse>("/v1/ume/key-alert-monitor");
|
||||
|
||||
export const upsertUmeKeyAlertRule = (payload: {
|
||||
notification_id: string;
|
||||
label?: string;
|
||||
match_type: "notification_id" | "keyword";
|
||||
match_value: string;
|
||||
label: string;
|
||||
enabled?: boolean;
|
||||
forward_on_clear?: boolean;
|
||||
}) => apiPost<{ ok: boolean }>("/v1/ume/key-alert-rules", payload);
|
||||
}) => apiPost<{ ok: boolean; item?: unknown }>("/v1/ume/key-alert-rules", payload);
|
||||
|
||||
export const deleteUmeKeyAlertRule = (notificationId: string) =>
|
||||
apiDelete<{ ok: boolean }>(`/v1/ume/key-alert-rules/${encodeURIComponent(notificationId)}`);
|
||||
export const deleteUmeKeyAlertRule = (ruleKey: string) =>
|
||||
apiDelete<{ ok: boolean }>(`/v1/ume/key-alert-rules/${encodeURIComponent(ruleKey)}`);
|
||||
|
||||
export const fetchUmeNotificationIds = (limit = 200) =>
|
||||
apiGet<{ items: Array<{ notification_id: string; native_probable_cause_sample: string }> }>(
|
||||
`/v1/ume/notification-ids?limit=${encodeURIComponent(String(limit))}`,
|
||||
);
|
||||
|
||||
export const fetchUmeAlarmKeywords = (limit = 200) =>
|
||||
apiGet<{ items: Array<{ keyword: string; alarm_count: number }> }>(
|
||||
`/v1/ume/alarm-keywords?limit=${encodeURIComponent(String(limit))}`,
|
||||
);
|
||||
|
||||
export const fetchUmeSyncStatus = (params: { page: number; pageSize: number }) => {
|
||||
const p = new URLSearchParams();
|
||||
p.set("page", String(Math.max(1, Number(params.page || 1))));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue