feat: Problems API, ingest hook, and UI
This commit is contained in:
@@ -84,3 +84,31 @@ export interface HostListResponse {
|
||||
page: number;
|
||||
page_size: number;
|
||||
}
|
||||
|
||||
export interface ProblemSummary {
|
||||
id: number;
|
||||
host_id: number | null;
|
||||
hostname: string | null;
|
||||
title: string;
|
||||
summary: string;
|
||||
severity: string;
|
||||
status: string;
|
||||
rule_id: string | null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface ProblemListResponse {
|
||||
items: ProblemSummary[];
|
||||
total: number;
|
||||
page: number;
|
||||
page_size: number;
|
||||
}
|
||||
|
||||
export async function ackProblem(problemId: number): Promise<{ id: number; status: string }> {
|
||||
return apiFetch(`/api/v1/problems/${problemId}/ack`, { method: "POST" });
|
||||
}
|
||||
|
||||
export async function resolveProblem(problemId: number): Promise<{ id: number; status: string }> {
|
||||
return apiFetch(`/api/v1/problems/${problemId}/resolve`, { method: "POST" });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user