mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-24 02:03:01 +02:00
unexport AllServers
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import React from "react";
|
||||
import { AllServers } from "../Server/AllServers";
|
||||
import { GetAllServers } from "../Server/AllServers";
|
||||
import { getServer } from "../Server/ServerHelpers";
|
||||
import { Modal } from "../ui/React/Modal";
|
||||
import { numeralWrapper } from "../ui/numeralFormat";
|
||||
|
||||
@@ -21,7 +22,8 @@ interface IServerProps {
|
||||
}
|
||||
|
||||
function ServerAccordion(props: IServerProps): React.ReactElement {
|
||||
const server = AllServers[props.ip];
|
||||
const server = getServer(props.ip);
|
||||
if (server === null) throw new Error("server should not be null");
|
||||
let totalSize = 0;
|
||||
for (const f of server.scripts) {
|
||||
totalSize += f.code.length;
|
||||
@@ -98,9 +100,9 @@ interface IProps {
|
||||
}
|
||||
|
||||
export function FileDiagnosticModal(props: IProps): React.ReactElement {
|
||||
const ips: string[] = [];
|
||||
for (const ip of Object.keys(AllServers)) {
|
||||
ips.push(ip);
|
||||
const keys: string[] = [];
|
||||
for (const key in GetAllServers()) {
|
||||
keys.push(key);
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -110,7 +112,7 @@ export function FileDiagnosticModal(props: IProps): React.ReactElement {
|
||||
Welcome to the file diagnostic! If your save file is really big it's likely because you have too many
|
||||
text/scripts. This tool can help you narrow down where they are.
|
||||
</Typography>
|
||||
{ips.map((ip: string) => (
|
||||
{keys.map((ip: string) => (
|
||||
<ServerAccordion key={ip} ip={ip} />
|
||||
))}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user