unexport AllServers

This commit is contained in:
Olivier Gagnon
2021-10-07 16:04:04 -04:00
parent 1d488565c6
commit be29481689
27 changed files with 185 additions and 159 deletions
+8 -6
View File
@@ -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} />
))}
</>