mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 01:33:54 +01:00
logbox title isn't infinitely long anymore
This commit is contained in:
parent
30588a885b
commit
73b9cae203
@ -88,7 +88,6 @@ function LogWindow(props: IProps): React.ReactElement {
|
|||||||
killWorkerScript(props.script, props.script.server, true);
|
killWorkerScript(props.script, props.script.server, true);
|
||||||
props.onClose();
|
props.onClose();
|
||||||
}
|
}
|
||||||
//useEffect(() => TerminalEvents.subscribe(_.debounce(async () => rerender(), 25, { maxWait: 50 })), []);
|
|
||||||
|
|
||||||
function updateLayer(): void {
|
function updateLayer(): void {
|
||||||
const c = container.current;
|
const c = container.current;
|
||||||
@ -98,6 +97,15 @@ function LogWindow(props: IProps): React.ReactElement {
|
|||||||
rerender();
|
rerender();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function title(): string {
|
||||||
|
const maxLength = 30;
|
||||||
|
const t = `${props.script.filename} ${props.script.args.map((x: any): string => `${x}`).join(" ")}`;
|
||||||
|
if (t.length <= maxLength) {
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
return t.slice(0, maxLength - 3) + "...";
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Draggable handle=".drag">
|
<Draggable handle=".drag">
|
||||||
<Paper
|
<Paper
|
||||||
@ -119,7 +127,7 @@ function LogWindow(props: IProps): React.ReactElement {
|
|||||||
>
|
>
|
||||||
<Box className="drag" display="flex" alignItems="center">
|
<Box className="drag" display="flex" alignItems="center">
|
||||||
<Typography color="primary" variant="h6">
|
<Typography color="primary" variant="h6">
|
||||||
{props.script.filename} {props.script.args.map((x: any): string => `${x}`).join(" ")}
|
{title()}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<Box position="absolute" right={0}>
|
<Box position="absolute" right={0}>
|
||||||
|
Loading…
Reference in New Issue
Block a user