mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 09:33:49 +01:00
BUGFIX: Attach hostname to script links in ls command (#1062)
fixes #1051 * Add hostname to script editor page options * Add hostname option to script editor page * Attach hostname to script links in ls * Fix script editor page option type
This commit is contained in:
parent
b79df29ef4
commit
dc7c9bb065
@ -136,8 +136,9 @@ export function ls(args: (string | number | boolean)[], server: BaseServer): voi
|
|||||||
function onClick() {
|
function onClick() {
|
||||||
const code = server.scripts.get(fullPath)?.content ?? "";
|
const code = server.scripts.get(fullPath)?.content ?? "";
|
||||||
const files = new Map<ContentFilePath, string>();
|
const files = new Map<ContentFilePath, string>();
|
||||||
|
const options = { hostname: server.hostname };
|
||||||
files.set(fullPath, code);
|
files.set(fullPath, code);
|
||||||
Router.toPage(Page.ScriptEditor, { files });
|
Router.toPage(Page.ScriptEditor, { files, options });
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
|
@ -246,7 +246,7 @@ export function GameRoot(): React.ReactElement {
|
|||||||
mainPage = (
|
mainPage = (
|
||||||
<ScriptEditorRoot
|
<ScriptEditorRoot
|
||||||
files={pageWithContext.files ?? new Map()}
|
files={pageWithContext.files ?? new Map()}
|
||||||
hostname={Player.getCurrentServer().hostname}
|
hostname={pageWithContext.options?.hostname ?? Player.getCurrentServer().hostname}
|
||||||
vim={!!pageWithContext.options?.vim}
|
vim={!!pageWithContext.options?.vim}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -88,7 +88,8 @@ export type PageWithContext =
|
|||||||
| { page: SimplePage };
|
| { page: SimplePage };
|
||||||
|
|
||||||
export interface ScriptEditorRouteOptions {
|
export interface ScriptEditorRouteOptions {
|
||||||
vim: boolean;
|
vim?: boolean;
|
||||||
|
hostname?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The router keeps track of player navigation/routing within the game. */
|
/** The router keeps track of player navigation/routing within the game. */
|
||||||
|
Loading…
Reference in New Issue
Block a user