mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-29 19:13:49 +01:00
Merge pull request #1735 from danielyxie/dev
tail box can rerun scripts
This commit is contained in:
commit
cd8da81c97
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 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>
|
||||
|
Loading…
Reference in New Issue
Block a user