Integrate SCUM real ops workflows

This commit is contained in:
npc0-hue
2026-08-10 21:12:53 +08:00
parent 1063330710
commit a770bc6250
88 changed files with 6375 additions and 2719 deletions
+28 -43
View File
@@ -10,7 +10,6 @@ import { ServersPage } from "./ServersPage";
import { UsersPage } from "./UsersPage";
import runtimeTaskProgressSource from "../components/RuntimeTaskProgress.tsx?raw";
import serverDeploymentWorkflowSource from "../components/ServerDeploymentWorkflow.tsx?raw";
import serverLiveOperationsSource from "../components/ServerLiveOperations.tsx?raw";
import serverCreateSchemaSource from "../schemas/serverManagement.ts?raw";
import serversPageSource from "./ServersPage.tsx?raw";
import serverDetailPageSource from "./ServerDetailPage.tsx?raw";
@@ -214,17 +213,25 @@ describe("first-party console pages", () => {
}
});
it("keeps live logs and management terminal on server detail instead of the server list", () => {
it("removes raw log and management terminal entry points from server pages", () => {
expect(serversPageSource).not.toContain("ServerLiveLogDrawer");
expect(serversPageSource).not.toContain("ServerManagementTerminalDrawer");
expect(serversPageSource).not.toContain("live-logs");
expect(serversPageSource).not.toContain("historical-logs");
expect(serversPageSource).not.toContain("requestLogBackfill");
expect(serversPageSource).not.toContain("管理终端");
expect(serverDetailPageSource).toContain("ServerManagementTerminalDrawer");
expect(serverDetailPageSource).not.toContain("ServerManagementTerminalDrawer");
expect(serverDetailPageSource).not.toContain("SourceRCONCommandPanel");
expect(serverDetailPageSource).not.toContain("ServerLiveLogDrawer");
expect(serverDetailPageSource).not.toContain('<span>实时日志</span>');
expect(serverDetailPageSource).not.toContain("openServerLogEvents");
expect(serverDetailPageSource).not.toContain("previewServerConfigDiff");
expect(serverDetailPageSource).not.toContain("approveServerConfigWrite");
expect(serverDetailPageSource).not.toContain("操作历史");
expect(serverDetailPageSource).toContain("runtimeObservationFreshness");
expect(serverDetailPageSource).toContain("Run 未验证");
expect(serverDetailPageSource).toContain("管理终端");
expect(serverDetailPageSource).toContain("PluginPageSection");
expect(serverDetailPageSource).toContain("AI 配置助手");
});
it("keeps create target and profile controls out while preserving deployment steps", () => {
@@ -311,52 +318,30 @@ describe("first-party console pages", () => {
expect(html).toContain("返回列表");
expect(html).not.toContain("概览");
expect(html).toContain("日志");
expect(html).toContain("管理终端");
expect(html).toContain("配置");
expect(html).toContain("管理");
expect(html).not.toContain("日志");
expect(html).not.toContain("管理终端");
expect(html).not.toContain("配置");
expect(html).not.toContain("运行操作");
expect(html).not.toContain("插件控制");
expect(html).toContain("AI 助手");
expect(html).toContain("操作历史");
expect(html).not.toContain("操作历史");
});
it("renders management terminal as a large command console with quick commands", () => {
expect(serverLiveOperationsSource).toContain("management-terminal-drawer");
expect(serverLiveOperationsSource).toContain("terminal-output-topbar");
expect(serverLiveOperationsSource).toContain("terminal-command-dock");
expect(serverLiveOperationsSource).toContain("terminalQuickCommandCatalog");
expect(serverLiveOperationsSource).toContain("terminalQuickCommandsForPlugin");
expect(serverLiveOperationsSource).toContain("queueGameClientBridgeCommand");
expect(serverLiveOperationsSource).toContain("scumManagementRCONCommandRequest");
expect(serverLiveOperationsSource).toContain("#ListSquads");
expect(serverLiveOperationsSource).toContain("#ListSpawnedVehicles");
expect(serverLiveOperationsSource).toContain("selectQuickCommand(item)");
expect(serverLiveOperationsSource).toContain("hideHeader");
expect(serverLiveOperationsSource).toContain("handleCommandKeyDown");
expect(serverLiveOperationsSource).toContain("commandHistory");
expect(serverLiveOperationsSource).toContain("ArrowUp");
expect(serverLiveOperationsSource).not.toContain("listServerLiveLogs");
expect(serverLiveOperationsSource).toContain("openServerLogEvents");
expect(serverLiveOperationsSource).toContain("getGameClientBridgeCommand");
expect(serverLiveOperationsSource).toContain("terminalLineFromBridgeCommand");
expect(serverLiveOperationsSource).not.toContain("terminalRelevantStreams");
expect(serverLiveOperationsSource).toContain("SSE 实时推送");
expect(serverLiveOperationsSource).toContain("mergeTerminalLines");
expect(serverLiveOperationsSource).toContain("terminalInitialHistoryWindow = 500");
expect(serverLiveOperationsSource).toContain("maxTerminalLines = 10000");
expect(serverLiveOperationsSource).toContain("followLatestRef");
expect(serverLiveOperationsSource).toContain("initialHistoryPendingRef");
expect(serverLiveOperationsSource).toContain("lockTerminalFollow");
expect(serverLiveOperationsSource).toContain("handleTerminalScroll");
expect(serverLiveOperationsSource).toContain("scrollHeight - output.clientHeight - output.scrollTop <= 24");
expect(serverLiveOperationsSource).not.toContain("terminalLogPollMs = 1000");
expect(serverLiveOperationsSource).not.toContain("logStreamPollMs = 5000");
expect(serverLiveOperationsSource).not.toContain("queryLogStream(");
expect(serverLiveOperationsSource).not.toContain("SaveWorld");
it("routes SCUM operations through typed plugin workflow surfaces", () => {
expect(serverDetailPageSource).toContain("PluginPageHostPage");
expect(serverDetailPageSource).toContain("plugin:${page.key}");
expect(serverDetailPageSource).toContain("section === \"llm\"");
expect(serverDetailPageSource).not.toContain("terminalQuickCommandCatalog");
expect(serverDetailPageSource).not.toContain("scumManagementRCONCommandRequest");
expect(serverDetailPageSource).not.toContain("queueGameClientBridgeCommand");
expect(serverDetailPageSource).not.toContain("commandHistory");
});
it("uses declared SCUM log source keys for log backfill defaults", () => {
expect(serversPageSource).toContain("scum-server-events");
it("does not expose SCUM log backfill defaults as product actions", () => {
expect(serversPageSource).not.toContain("scum-server-events");
expect(serversPageSource).not.toContain("requestLogBackfill");
expect(serversPageSource).not.toContain("historical-logs");
expect(serversPageSource).not.toContain("server-log");
expect(serverDetailPageSource).not.toContain("server-log");
});