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:
kitos
2026-05-28 15:58:49 +02:00
parent cf19a18810
commit 322b6fcb62
2 changed files with 46 additions and 6 deletions
+6
View File
@@ -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;
}