feat(web): add Re-run button to detail view with pre-filled wizard

Adds a "Re-run" button to the run detail view that opens the wizard
pre-populated with the previous run's settings (target, model, votes,
chain depth, recon, max agents, mode flags). Server now includes
launch params in the detail API response by looking up the persisted
job file. Previous findings and reports are preserved (new run ID).
This commit is contained in:
CyberSecurityUP committed 2026-10-18 18:43:02 -03:00
1 parent 78e7d27e2f
commit 33fd6ca508
3 files changed
+50 -1

No files matched your search

+13 -1
View File
@@ -791,7 +791,19 @@ async function runDetail(id) {
const liveRunIds = new Set([...jobs.values()].filter((j) => !j.done && j.runId).map((j) => j.runId));
if (!liveRunIds.has(id)) status.state = 'interrupted';
}
return { id, name: engagementNames.get(id) || '', meta, status, findings, assets, pocs, extras };
let launch = null;
const liveJob = [...jobs.values()].find((j) => j.runId === id);
if (liveJob?.launch) launch = liveJob.launch;
else {
try {
const jfiles = await fsp.readdir(JOBS_DIR);
for (const jf of jfiles) {
const rec = JSON.parse(await fsp.readFile(path.join(JOBS_DIR, jf), 'utf8'));
if (rec.runId === id && rec.launch) { launch = rec.launch; break; }
}
} catch { /* no job files */ }
}
return { id, name: engagementNames.get(id) || '', meta, status, findings, assets, pocs, extras, launch };
}
/// Relative file list under a directory (one level of nesting is enough for