fix: restore server create deployment wizard

This commit is contained in:
npc0-hue
2026-07-30 21:02:17 +08:00
parent e614a17fe3
commit 2a17718158
7 changed files with 77 additions and 30 deletions
+9 -6
View File
@@ -168,7 +168,7 @@ describe("first-party console pages", () => {
expect(serversPageSource).toContain("旧 run 会话已失效");
});
it("separates minimal creation from post-create deployment editing without exposing protected inputs", () => {
it("keeps deployment startup inputs in the create wizard without exposing protected values", () => {
expect(serversPageSource).toContain("<ServerDeploymentWorkflow");
expect(serversPageSource).toContain("openEditDeployment");
expect(serversPageSource).toContain("编辑部署");
@@ -192,14 +192,14 @@ describe("first-party console pages", () => {
expect(serverDeploymentWorkflowSource).toContain("当前平台尚未提供 SCUM 服务端的受控升级任务");
expect(serverDeploymentWorkflowSource).toContain("已绑定服务器编辑时会直接进入相关配置");
expect(serverDeploymentWorkflowSource).toContain("可在此调整部署方式;不会重复要求选择已绑定的运行节点");
expect(serversPageSource).toContain('onNavigate("serverDetail", { serverId: result.instance.id })');
expect(serversPageSource).toContain('onNavigate("serverDetail", { serverId: result.instance.id, routeKey: "run-builder" })');
expect(serverDetailPageSource).toContain("运行配置绑定");
expect(serverDetailPageSource).toContain('type={field.sensitive ? "password" : "text"}');
expect(serverDeploymentWorkflowSource).toContain("显示已保存配置");
expect(serverDeploymentWorkflowSource).toContain("revealSavedInputs");
expect(serversPageSource).toContain("revealServerDeployment");
expect(serverDetailPageSource).toContain("最近 Run 调度");
expect(serversPageSource).toContain("minimalServerCreateRequestFromForm(nextForm)");
expect(serversPageSource).toContain("serverCreateRequestFromForm(nextForm)");
expect(serverDeploymentWorkflowSource).not.toContain('name="id"');
expect(serverDeploymentWorkflowSource).not.toContain("实例 ID");
for (const forbidden of ["secret://", "/Users/", "/var/run/", "unix://", "tcp://"]) {
@@ -207,7 +207,7 @@ describe("first-party console pages", () => {
}
});
it("keeps create-only controls structurally minimal", () => {
it("keeps create target and profile controls out while preserving deployment steps", () => {
expect(serverDeploymentWorkflowSource).not.toContain('name="deploymentTargetId"');
expect(serverDeploymentWorkflowSource).not.toContain("请选择部署目标");
expect(serverDeploymentWorkflowSource).not.toContain("saveAsDraft");
@@ -216,9 +216,12 @@ describe("first-party console pages", () => {
expect(serverDeploymentWorkflowSource).toContain("await onSubmit(form)");
expect(serverDeploymentWorkflowSource).not.toContain('kind === "create" && <label>运行预设');
expect(serverDeploymentWorkflowSource).not.toContain('kind === "create" && bindingFields');
expect(serverDeploymentWorkflowSource).toContain("插件类型和服务器名称是创建时仅有的必填信息");
expect(serverDeploymentWorkflowSource).toContain("配置启动项");
expect(serverDeploymentWorkflowSource).toContain("本次保存创建向导配置");
expect(serverDeploymentWorkflowSource).toContain('const modeStep = kind === "create" ? 1 : -1;');
expect(serverDeploymentWorkflowSource).toContain('const configurationStep = kind === "create" ? 2 : needsTargetSelection ? 1 : 0;');
expect(serverDeploymentWorkflowSource).toContain('const needsTargetSelection = kind === "edit" && !initialForm.runEndpointId;');
expect(serversPageSource).toContain("minimalServerCreateRequestFromForm(nextForm)");
expect(serversPageSource).toContain("serverCreateRequestFromForm(nextForm)");
});
it("renders server runtime actions as a compact popover trigger instead of an in-card details stack", () => {