feat(hwpod): 补齐拓扑与节点接入控制台

This commit is contained in:
root
2026-07-13 04:09:31 +02:00
parent 63a5cfff4a
commit 652f1f9c6b
14 changed files with 1369 additions and 122 deletions
+11 -2
View File
@@ -88,8 +88,10 @@ import {
handleHwlabNodeDownloadHttp,
handleHwlabNodeUpdateHttp,
handleHwpodNodeOpsHttp,
handleHwpodSpecDiscoveryHttp
handleHwpodSpecDiscoveryHttp,
handleHwpodTopologyHttp
} from "./server-hwpod-http.ts";
import { HWPOD_TOPOLOGY_CONTRACT_VERSION } from "./hwpod-topology-read-model.ts";
import { handleCaseRunHttp } from "./server-caserun-http.ts";
import { handleProjectManagementProxyHttp } from "./project-management-proxy.ts";
import { HWPOD_NODE_OPS, HWPOD_NODE_OPS_CONTRACT_VERSION } from "../../tools/src/hwpod-node-ops-contract.ts";
@@ -651,6 +653,8 @@ async function handleRestAdapter(request, response, url, options) {
hwpod: {
route: "/v1/hwpod-node-ops",
specDiscoveryRoute: "/v1/hwpod/specs",
topologyRoute: "/v1/hwpod/topology",
topologyContractVersion: HWPOD_TOPOLOGY_CONTRACT_VERSION,
contractVersion: HWPOD_NODE_OPS_CONTRACT_VERSION,
specAuthority: "workspace-or-registry",
compiler: "hwpod-compiler-cli",
@@ -813,6 +817,11 @@ async function handleRestAdapter(request, response, url, options) {
return;
}
if (url.pathname === "/v1/hwpod/topology") {
await handleHwpodTopologyHttp(request, response, url, options);
return;
}
if (request.method === "GET" && url.pathname === "/v1/hwpod-node/ws") {
sendJson(response, 426, { ok: false, status: "upgrade_required", route: "/v1/hwpod-node/ws", websocket: options.hwpodNodeWsRegistry.describe() });
return;
@@ -1003,7 +1012,7 @@ function navIdForRestPath(pathname, method = "GET") {
if (pathname.startsWith("/v1/admin/access")) return "admin.access";
if (pathname.startsWith("/v1/admin/users")) return "admin.users";
if (pathname.startsWith("/v1/admin/")) return "admin.access";
if (pathname === "/v1/hwpod-node-ops" || pathname === "/v1/caserun" || pathname.startsWith("/v1/caserun/") || pathname === "/v1/hwpod/specs") return "admin.hwpodGroups";
if (pathname === "/v1/hwpod-node-ops" || pathname === "/v1/caserun" || pathname.startsWith("/v1/caserun/") || pathname === "/v1/hwpod/specs" || pathname === "/v1/hwpod/topology") return "admin.hwpodGroups";
if (pathname === "/v1/web-performance/metrics" || pathname === "/v1/web-performance/summary" || pathname === "/v1/live-builds") return "system.performance";
if (pathname === "/v1/diagnostics/gate") return "system.gate";
return "";