mirror of
https://github.com/CyberSecurityUP/NeuroSploit.git
synced 2026-10-19 22:17:18 +02:00
fix(web): auto-exit live view when job no longer exists on server restart
This commit is contained in:
1 parent
48d3b61aed
commit
28faefef94
1 file changed
+14
-1
+14
-1
@@ -779,7 +779,20 @@ function attachLiveJob(id, target, name, pinnedAgents) {
|
||||
clearInterval(state.currentJob.pocPoll);
|
||||
refreshRuns();
|
||||
});
|
||||
es.onerror = () => { /* EventSource auto-retries; the server replays its buffer on reconnect */ };
|
||||
es.onerror = () => {
|
||||
if (es.readyState === EventSource.CLOSED) return;
|
||||
api(`/api/exploit/${id}`).catch(() => {
|
||||
es.close();
|
||||
clearInterval(state.currentJob?.pocPoll);
|
||||
localStorage.removeItem(ACTIVE_JOB_KEY);
|
||||
if (state.currentJob?.runId) {
|
||||
show($('#liveView'), false); show($('#detailView'), true);
|
||||
loadDetail(state.currentJob.runId);
|
||||
} else { show($('#liveView'), false); show($('#dashView'), true); }
|
||||
state.currentJob = null;
|
||||
refreshRuns();
|
||||
});
|
||||
};
|
||||
|
||||
// PoC scripts land in runs/<id>/pocs/ during the run — poll for them once
|
||||
// the CLI's own run id is known (see applySnapshot), so the finding modal
|
||||
|
||||
Reference in new issue
Block a user