feat: add UE4SS DLL runtime extension

This commit is contained in:
npc0-hue
2026-07-23 09:49:14 +08:00
parent 8e34c8762a
commit 1caf40565c
30 changed files with 1179 additions and 70 deletions
@@ -3,6 +3,7 @@ import { describe, expect, it } from "vitest";
import { configDiffViewFromPreview } from "./ServerDetailPage";
import serverDetailPageSource from "./ServerDetailPage.tsx?raw";
import clientManagerLifecyclePanelSource from "../components/ClientManagerLifecyclePanel.tsx?raw";
import runtimeDLLExtensionsPanelSource from "../components/RuntimeDLLExtensionsPanel.tsx?raw";
import artifactTransferSource from "../utils/artifactTransfer.ts?raw";
import type { ServerConfigDiffPreviewResponse } from "../api/types";
@@ -103,6 +104,17 @@ describe("ServerDetailPage config write approval", () => {
expect(serverDetailPageSource).not.toContain("sqlite://");
});
it("renders declared UE4SS DLL update policy without local paths or RCON secrets", () => {
expect(serverDetailPageSource).toContain("RuntimeDLLExtensionsPanel");
expect(runtimeDLLExtensionsPanelSource).toContain("启动前自动校验和更新");
expect(runtimeDLLExtensionsPanelSource).toContain("运行:SCUM 服务器受监管启动");
expect(runtimeDLLExtensionsPanelSource).toContain("由 UE4SS 正常加载");
expect(runtimeDLLExtensionsPanelSource).toContain("Linux 启动前拒绝");
for (const forbidden of ["dllRef", "targetKey", "rconPort", "password="]) {
expect(runtimeDLLExtensionsPanelSource).not.toContain(forbidden);
}
});
it("loads the dependency catalog only after runtime actions expose dependency operations", () => {
const runtimeDistributionSectionSource = serverDetailPageSource.split("function RuntimeDistributionSection")[1]?.split("function RuntimeBindingFields")[0] ?? "";
expect(runtimeDistributionSectionSource).toContain('action.key === "dependencies-check" || action.key === "dependencies-install"');