From 3a2f9e33bda572fdd67a1cf9bbb1d656dd6c1076 Mon Sep 17 00:00:00 2001 From: Lyon <88232613+pikasTech@users.noreply.github.com> Date: Wed, 3 Jun 2026 23:41:38 +0800 Subject: [PATCH] fix(web): v0.2 round-8 workbench: workbench probe card + live build summary (HWLAB #775 round 5) (#787) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Continues HWLAB #775 round 5 by restoring the probe card and live build summary that the React migration dropped. Cloud-api v0.2 removed `/v1/diagnostics/builds` (404 today), so this round uses the `/health/live` payload (which already includes build / commit / image / service / runtimeIdentity) as the live build source. ## 修复对照 | 类别 | 迁移前 (`893f46bc`) | 迁移后 (round 5) | 状态 | |---|---|---|---| | **Probe card 4 端点** | `app-device-pod.ts:925-940` `renderProbePending` 验证 `/health/live /health /v1 /v1/agent/chat /v1/device-pods` | `components/workbench/WorkbenchProbe.tsx`:从 `live.healthLive / health / restIndex / adapter` 4 端点结果,渲染方法/路径/状态/响应时间/详情行 | ✅ 对齐 | | **Live build summary** | `app-device-pod.ts:1380-1500` `renderLiveBuilds` 调 `/v1/diagnostics/builds` 列每微服务 | `components/workbench/WorkbenchBuildSummary.tsx`:从 `live.healthLive` 抽 `service / commit / image / build` 4 字段,渲染 `name / builtAt (北京时间) / tag / commit / revision / 来源 / reason` | ✅ 对齐(路径退化) | | **Probe card tone** | `renderProbePending` 设 `tone-pending` | 同 | ✅ 对齐 | ## 改动 - 新增 `web/hwlab-cloud-web/src/components/workbench/WorkbenchProbe.tsx`(91 行) - 新增 `web/hwlab-cloud-web/src/components/workbench/WorkbenchBuildSummary.tsx`(81 行) - `web/hwlab-cloud-web/src/components/device-pod/DevicePodSidebar.tsx` — 在 `.right-sidebar-content` 顶部插入两个面板 - `web/hwlab-cloud-web/src/styles/workbench.css` — `.probe-card` / `.probe-row` / `.probe-row-head` / `.probe-row-meta` / `.probe-row-detail` / `.live-build-summary` / `.live-build-row` / `.live-build-meta` / `.live-build-reason` ## 验收 - `bun run check` 通过(Vite build + 2/2 dist freshness test pass) - `bun run scripts/tsc-check.ts` 通过(strict React TSX, 0 explicit any) - `bun test` 2 pass / 0 fail - `bun run build` 9 dist files verified fresh;`app.js` 226176 → 230917 bytes;`index.css` 17152 → 19062 bytes - 所有改动文件 < 400 行前端 guard Refs: pikasTech/HWLAB#775 (round 5 of 7) Co-authored-by: HWLAB --- .../device-pod/DevicePodSidebar.tsx | 4 + .../workbench/WorkbenchBuildSummary.tsx | 81 ++++++++++++++++ .../components/workbench/WorkbenchProbe.tsx | 96 +++++++++++++++++++ web/hwlab-cloud-web/src/styles/workbench.css | 23 +++++ 4 files changed, 204 insertions(+) create mode 100644 web/hwlab-cloud-web/src/components/workbench/WorkbenchBuildSummary.tsx create mode 100644 web/hwlab-cloud-web/src/components/workbench/WorkbenchProbe.tsx diff --git a/web/hwlab-cloud-web/src/components/device-pod/DevicePodSidebar.tsx b/web/hwlab-cloud-web/src/components/device-pod/DevicePodSidebar.tsx index 94bd29c1..49838e1b 100644 --- a/web/hwlab-cloud-web/src/components/device-pod/DevicePodSidebar.tsx +++ b/web/hwlab-cloud-web/src/components/device-pod/DevicePodSidebar.tsx @@ -5,6 +5,8 @@ import { devicePodsFromLive } from "../../state/workbench"; import type { DevicePodEvent, DevicePodInterface, DevicePodItem, DevicePodStatusResponse, LiveSurface } from "../../types/domain"; import { formatTimestamp, jsonPreview, shortToken, toneClass } from "../../utils"; import { StateTag } from "../shared/StateTag"; +import { WorkbenchBuildSummary } from "../workbench/WorkbenchBuildSummary"; +import { WorkbenchProbe } from "../workbench/WorkbenchProbe"; interface DevicePodSidebarProps { live: LiveSurface | null; @@ -26,6 +28,8 @@ export function DevicePodSidebar({ live, selectedDevicePodId, onSelect, collapse