mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 04:20:45 +08:00
feat(ume): ne_type filter, rule edit, and pager layout
Match key alerts by optional inventory ne_types, add edit dialog to update device types on existing rules, and keep card pager controls on one row. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
d5d6d4eada
commit
e474c0a431
11 changed files with 383 additions and 24 deletions
|
|
@ -104,6 +104,7 @@ export const upsertUmeKeyAlertRule = (payload: {
|
|||
match_value: string;
|
||||
label: string;
|
||||
enabled?: boolean;
|
||||
ne_types?: string[];
|
||||
}) => apiPost<{ ok: boolean; item?: unknown }>("/v1/ume/key-alert-rules", payload);
|
||||
|
||||
export const updateUmeKeyAlertMonitorConfig = (payload: { forward_on_clear: boolean }) =>
|
||||
|
|
@ -112,7 +113,10 @@ export const updateUmeKeyAlertMonitorConfig = (payload: { forward_on_clear: bool
|
|||
export const deleteUmeKeyAlertRule = (ruleKey: string) =>
|
||||
apiDelete<{ ok: boolean }>(`/v1/ume/key-alert-rules/${encodeURIComponent(ruleKey)}`);
|
||||
|
||||
export const patchUmeKeyAlertRule = (ruleKey: string, payload: { enabled: boolean }) =>
|
||||
export const patchUmeKeyAlertRule = (
|
||||
ruleKey: string,
|
||||
payload: { enabled?: boolean; ne_types?: string[] },
|
||||
) =>
|
||||
apiPatch<{ ok: boolean; item?: unknown }>(
|
||||
`/v1/ume/key-alert-rules/${encodeURIComponent(ruleKey)}`,
|
||||
payload,
|
||||
|
|
@ -128,6 +132,11 @@ export const fetchUmeAlarmKeywords = (limit = 200) =>
|
|||
`/v1/ume/alarm-keywords?limit=${encodeURIComponent(String(limit))}`,
|
||||
);
|
||||
|
||||
export const fetchUmeInventoryNeTypes = (limit = 500) =>
|
||||
apiGet<{ items: Array<{ ne_type: string; ne_count: number }>; total: number }>(
|
||||
`/v1/ume/inventory/ne-types?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