mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-02-18 10:53:43 +01:00
tail box can rerun scripts
This commit is contained in:
22
dist/vendor.bundle.js
vendored
22
dist/vendor.bundle.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -11,6 +11,9 @@ import { ResizableBox } from "react-resizable";
|
|||||||
import makeStyles from "@mui/styles/makeStyles";
|
import makeStyles from "@mui/styles/makeStyles";
|
||||||
import createStyles from "@mui/styles/createStyles";
|
import createStyles from "@mui/styles/createStyles";
|
||||||
import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos";
|
import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos";
|
||||||
|
import { workerScripts } from "../../Netscript/WorkerScripts";
|
||||||
|
import { startWorkerScript } from "../../NetscriptWorker";
|
||||||
|
import { GetServer } from "../../Server/AllServers";
|
||||||
|
|
||||||
let layerCounter = 0;
|
let layerCounter = 0;
|
||||||
|
|
||||||
@ -89,7 +92,12 @@ function LogWindow(props: IProps): React.ReactElement {
|
|||||||
|
|
||||||
function kill(): void {
|
function kill(): void {
|
||||||
killWorkerScript(props.script, props.script.server, true);
|
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 {
|
function updateLayer(): void {
|
||||||
@ -134,7 +142,8 @@ function LogWindow(props: IProps): React.ReactElement {
|
|||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<Box position="absolute" right={0}>
|
<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>
|
<Button onClick={props.onClose}>Close</Button>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
Reference in New Issue
Block a user