mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 01:32:55 +02:00
tail box can rerun scripts
This commit is contained in:
@@ -11,6 +11,9 @@ import { ResizableBox } from "react-resizable";
|
||||
import makeStyles from "@mui/styles/makeStyles";
|
||||
import createStyles from "@mui/styles/createStyles";
|
||||
import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos";
|
||||
import { workerScripts } from "../../Netscript/WorkerScripts";
|
||||
import { startWorkerScript } from "../../NetscriptWorker";
|
||||
import { GetServer } from "../../Server/AllServers";
|
||||
|
||||
let layerCounter = 0;
|
||||
|
||||
@@ -89,7 +92,12 @@ function LogWindow(props: IProps): React.ReactElement {
|
||||
|
||||
function kill(): void {
|
||||
killWorkerScript(props.script, props.script.server, true);
|
||||
props.onClose();
|
||||
}
|
||||
|
||||
function run(): void {
|
||||
const server = GetServer(props.script.server);
|
||||
if (server === null) return;
|
||||
startWorkerScript(props.script, server);
|
||||
}
|
||||
|
||||
function updateLayer(): void {
|
||||
@@ -134,7 +142,8 @@ function LogWindow(props: IProps): React.ReactElement {
|
||||
</Typography>
|
||||
|
||||
<Box position="absolute" right={0}>
|
||||
<Button onClick={kill}>Kill Script</Button>
|
||||
{!workerScripts.has(props.script.pid) && <Button onClick={run}>Run</Button>}
|
||||
{workerScripts.has(props.script.pid) && <Button onClick={kill}>Kill</Button>}
|
||||
<Button onClick={props.onClose}>Close</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user