feat(dashboard): auto-compute risk scores + refresh button on Critical Gaps
- Auto-trigger POST /risk/compute on first load if no profiles exist - Add "Refresh scores" button next to Critical Gaps header (spins while computing) - Add computeRiskScores() to frontend/src/api/risk.ts - After compute, invalidate risk-profiles query so table updates immediately
This commit is contained in:
@@ -42,3 +42,9 @@ export async function getRiskProfile(techniqueId: string): Promise<RiskProfile>
|
||||
const { data } = await client.get<RiskProfile>(`/risk/profiles/${techniqueId}`);
|
||||
return data;
|
||||
}
|
||||
|
||||
/** Trigger recomputation of all risk scores. */
|
||||
export async function computeRiskScores(): Promise<{ computed: number; skipped: number; errors: number; duration_seconds: number }> {
|
||||
const { data } = await client.post("/risk/compute");
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user