feat(tests): execution start/end times on red team, detection/containment times on blue team
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
This commit is contained in:
@@ -34,6 +34,13 @@ import JiraLinkPanel from "../components/JiraLinkPanel";
|
||||
import TestPhaseTimeline from "../components/TestPhaseTimeline";
|
||||
import { createTemplate } from "../api/test-templates";
|
||||
|
||||
// ── Helpers ────────────────────────────────────────────────────────
|
||||
|
||||
function isoToDatetimeLocal(iso: string | null): string {
|
||||
if (!iso) return "";
|
||||
return iso.replace("Z", "").replace(/\.\d+$/, "").slice(0, 16);
|
||||
}
|
||||
|
||||
// ── Page Component ─────────────────────────────────────────────────
|
||||
|
||||
export default function TestDetailPage() {
|
||||
@@ -58,15 +65,21 @@ export default function TestDetailPage() {
|
||||
tool_used: "",
|
||||
attack_success: false,
|
||||
red_summary: "",
|
||||
execution_start_time: "",
|
||||
execution_end_time: "",
|
||||
});
|
||||
|
||||
const [blueDraft, setBlueDraft] = useState<{
|
||||
detection_result: TestResult | "";
|
||||
containment_result: ContainmentResult | "";
|
||||
detection_time: string;
|
||||
containment_time: string;
|
||||
blue_summary: string;
|
||||
}>({
|
||||
detection_result: "",
|
||||
containment_result: "",
|
||||
detection_time: "",
|
||||
containment_time: "",
|
||||
blue_summary: "",
|
||||
});
|
||||
|
||||
@@ -108,10 +121,14 @@ export default function TestDetailPage() {
|
||||
tool_used: test.tool_used || "",
|
||||
attack_success: test.attack_success ?? false,
|
||||
red_summary: test.red_summary || "",
|
||||
execution_start_time: isoToDatetimeLocal(test.execution_start_time),
|
||||
execution_end_time: isoToDatetimeLocal(test.execution_end_time),
|
||||
});
|
||||
setBlueDraft({
|
||||
detection_result: test.detection_result || "",
|
||||
containment_result: test.containment_result || "",
|
||||
detection_time: isoToDatetimeLocal(test.detection_time),
|
||||
containment_time: isoToDatetimeLocal(test.containment_time),
|
||||
blue_summary: test.blue_summary || "",
|
||||
});
|
||||
}
|
||||
@@ -152,6 +169,8 @@ export default function TestDetailPage() {
|
||||
tool_used: redDraft.tool_used || undefined,
|
||||
attack_success: redDraft.attack_success,
|
||||
red_summary: redDraft.red_summary || undefined,
|
||||
execution_start_time: redDraft.execution_start_time || undefined,
|
||||
execution_end_time: redDraft.execution_end_time || undefined,
|
||||
}),
|
||||
onSuccess: () => {
|
||||
invalidateAll();
|
||||
@@ -165,6 +184,8 @@ export default function TestDetailPage() {
|
||||
updateTestBlue(testId!, {
|
||||
detection_result: (blueDraft.detection_result as TestResult) || undefined,
|
||||
containment_result: (blueDraft.containment_result as ContainmentResult) || undefined,
|
||||
detection_time: blueDraft.detection_time || undefined,
|
||||
containment_time: blueDraft.containment_time || undefined,
|
||||
blue_summary: blueDraft.blue_summary || undefined,
|
||||
}),
|
||||
onSuccess: () => {
|
||||
|
||||
Reference in New Issue
Block a user