feat: refactor DashCommand to use useMemo for shortcuts and server commands

feat: optimize GlobalMap component with useMemo for country data processing

feat: enhance ServerCard and ServerCardInline components with memoization

feat: improve ServiceTracker component by processing service data with useMemo

feat: add VirtualServerList component for efficient rendering of server lists

refactor: update Servers page to utilize VirtualServerList for better performance

test: add tests for DashCommand and GlobalMap components, including virtualization checks
This commit is contained in:
hamster1963
2026-07-05 04:09:22 +08:00
parent 8f3a2f3eb3
commit 6c7ba30cee
14 changed files with 998 additions and 338 deletions
+40
View File
@@ -0,0 +1,40 @@
import { spawn } from "node:child_process";
const isWindows = process.platform === "win32";
const pnpmCommand = isWindows ? "pnpm.cmd" : "pnpm";
const children = [
spawn(process.execPath, ["scripts/mock-nezha-server.js"], {
stdio: "inherit",
}),
spawn(pnpmCommand, ["dev"], {
stdio: "inherit",
}),
];
let shuttingDown = false;
function shutdown(exitCode = 0) {
if (shuttingDown) return;
shuttingDown = true;
for (const child of children) {
if (!child.killed) {
child.kill("SIGTERM");
}
}
process.exit(exitCode);
}
for (const child of children) {
child.on("exit", (code, signal) => {
if (shuttingDown) return;
if (code === 0 || signal === "SIGTERM") return;
shutdown(code ?? 1);
});
}
process.on("SIGINT", () => shutdown(0));
process.on("SIGTERM", () => shutdown(0));