功能修改

This commit is contained in:
npc0-hue
2026-07-20 16:42:33 +08:00
parent 48b8ad8d6c
commit a0e69417db
224 changed files with 22015 additions and 884 deletions
+20 -1
View File
@@ -2,6 +2,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 artifactTransferSource from "../utils/artifactTransfer.ts?raw";
import type { ServerConfigDiffPreviewResponse } from "../api/types";
@@ -81,7 +82,18 @@ describe("ServerDetailPage config write approval", () => {
expect(serverDetailPageSource).toContain("installDependencies");
expect(serverDetailPageSource).toContain("listServerLiveLogs");
expect(serverDetailPageSource).toContain("requestLogBackfill");
expect(serverDetailPageSource).toContain("safeRuntimeRef");
expect(serverDetailPageSource).toContain("ClientManagerLifecyclePanel");
expect(clientManagerLifecyclePanelSource).toContain("listClientManagerLifecycles");
expect(clientManagerLifecyclePanelSource).toContain("deployClientManager");
expect(clientManagerLifecyclePanelSource).toContain("controlClientManager");
expect(clientManagerLifecyclePanelSource).toContain("updateClientManager");
expect(clientManagerLifecyclePanelSource).toContain("retryClientManagerLifecycle");
expect(clientManagerLifecyclePanelSource).toContain("revokeClientManagerSession");
expect(clientManagerLifecyclePanelSource).toContain("uninstallClientManager");
expect(clientManagerLifecyclePanelSource).toContain("expectedDeploymentGeneration");
expect(clientManagerLifecyclePanelSource).not.toContain("secretRef");
expect(clientManagerLifecyclePanelSource).not.toContain("hostPath");
expect(clientManagerLifecyclePanelSource).not.toContain("process.pid");
expect(serverDetailPageSource).not.toContain("authKey");
expect(serverDetailPageSource).not.toContain("password=");
expect(serverDetailPageSource).not.toContain("unix://");
@@ -90,6 +102,13 @@ describe("ServerDetailPage config write approval", () => {
expect(serverDetailPageSource).not.toContain("sqlite://");
});
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"');
expect(runtimeDistributionSectionSource).toContain("dependencyActions.some((action) => action.available)");
expect(runtimeDistributionSectionSource).toContain("getDependencyCatalog(instance.id)");
});
it("reviews and updates only redacted runtime binding metadata", () => {
const runtimeBindingSectionSource = serverDetailPageSource.split("function RuntimeBindingSection")[1]?.split("function RuntimeDistributionSection")[0] ?? "";
expect(serverDetailPageSource).toContain("getServerRuntimeBinding");