Restore interactive server terminal drawer

This commit is contained in:
npc0-hue
2026-08-10 23:43:17 +08:00
parent 1207ba6c5b
commit 0154f42485
7 changed files with 410 additions and 83 deletions
+7 -5
View File
@@ -1,6 +1,7 @@
import { describe, expect, it } from "vitest";
import { configDiffViewFromPreview } from "./ServerDetailPage";
import serverManagementTerminalSource from "../components/ServerManagementTerminalDrawer.tsx?raw";
import serverDetailPageSource from "./ServerDetailPage.tsx?raw";
import type { ServerConfigDiffPreviewResponse } from "../api/types";
@@ -79,7 +80,7 @@ describe("ServerDetailPage config write approval", () => {
expect(serverDetailPageSource).not.toContain("pushRunUpdate");
expect(serverDetailPageSource).not.toContain("generateClientManager");
expect(serverDetailPageSource).not.toContain("ClientManagerLifecyclePanel");
expect(serverDetailPageSource).not.toContain("openServerLogEvents");
expect(serverManagementTerminalSource).toContain("openServerLogEvents");
expect(serverDetailPageSource).not.toContain("authKey");
expect(serverDetailPageSource).not.toContain("password=");
expect(serverDetailPageSource).not.toContain("unix://");
@@ -95,13 +96,14 @@ describe("ServerDetailPage config write approval", () => {
expect(serverDetailPageSource).not.toContain("RuntimeDLLExtensionsPanel");
});
it("does not expose raw SCUM RCON command panels", () => {
it("uses the historical terminal drawer without restoring separate raw command panels", () => {
expect(serverDetailPageSource).not.toContain("SourceRCONCommandPanel");
expect(serverDetailPageSource).not.toContain("queueGameClientBridgeCommand");
expect(serverManagementTerminalSource).toContain("queueGameClientBridgeCommand");
expect(serverDetailPageSource).not.toContain("scumManagementRCONCommandRequest");
expect(serverDetailPageSource).not.toContain("管理终端");
expect(serverDetailPageSource).toContain("<span>打开终端</span>");
expect(serverDetailPageSource).toContain("RemoteTerminalEntryDialog");
expect(serverDetailPageSource).toContain("ServerManagementTerminalDrawer");
expect(serverManagementTerminalSource).toContain("terminal-output-topbar");
expect(serverManagementTerminalSource).toContain("terminalQuickCommandCatalog");
expect(serverDetailPageSource).toContain("PluginPageHostPage");
});