FEATURE: Add "Recent Errors" tab and improved error modal (#2169)

This commit is contained in:
Michael Ficocelli
2025-06-16 19:43:21 -04:00
committed by GitHub
parent cf72937faf
commit 18f84396e2
17 changed files with 530 additions and 34 deletions

View File

@@ -6,7 +6,7 @@ import { ScriptDeath } from "./ScriptDeath";
import { WorkerScript } from "./WorkerScript";
import { workerScripts } from "./WorkerScripts";
import { GetServer } from "../Server/AllServers";
import { GetAllServers, GetServer } from "../Server/AllServers";
import { AddRecentScript } from "./RecentScripts";
import { ITutorial } from "../InteractiveTutorial";
import { AlertEvents } from "../ui/React/AlertManager";
@@ -34,6 +34,16 @@ export function killWorkerScriptByPid(pid: number, killer?: WorkerScript): boole
return false;
}
export const killAllScripts = () => {
for (const server of GetAllServers()) {
for (const byPid of server.runningScriptMap.values()) {
for (const pid of byPid.keys()) {
killWorkerScriptByPid(pid);
}
}
}
};
function stopAndCleanUpWorkerScript(ws: WorkerScript): void {
// Only clean up once.
// Important: Only this function can set stopFlag!