Files
operating-room-monitor-server/clients/demo-client/README.md
op b8bf31c23c Improve demo client consumable UX and clarify live vs offline flows.
Separate mode-specific steps, show product code with name in chips, validate against mistaken video paths, and load label_id from labels.yaml via server.py.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 10:44:41 +08:00

34 lines
1.5 KiB
Markdown
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Demo Client · 联调台
浏览器联调页,覆盖两条录制链路。语音待确认请使用 [`../voice-confirmation/`](../voice-confirmation/)(默认 :8080
## 两条链路
| 模式 | 操作 | API | 语音 | 结束手术 |
|------|------|-----|------|----------|
| **链路 1 · 真摄像头** | 填 camera_id → 开始手术 | `POST /client/surgeries/start` | 需要 | 需要 |
| **链路 3 · 离线精确** | 选 MP4 → 上传并处理 | `POST /internal/demo/offline-batch` | 无 | 不需要 |
链路 3 需 `DEMO_ORCHESTRATOR_ENABLED=true`。页顶「刷新状态」可查看 API 与 Demo 模式是否就绪。
## 界面说明
- **链路 1**:只需填 `camera_ids` 与耗材候选,点「开始手术」;**无需上传视频**(服务端自动 RTSP 拉流切片)。
- **链路 1 / 3 共用「步骤 2 · 耗材候选」**:标签区显示「编号 + 名称」;提交时以 `{"消耗品编号","名称"}` 对象数组发送(与医院导出表一致)。
- 误把 `.mp4` 路径填进耗材候选时,页面会提示并阻止提交。
详见 [`docs/video-backends.md`](../../docs/video-backends.md)。
## 启动
```bash
cd clients/demo-client
python3 server.py
```
浏览器打开 `http://127.0.0.1:38081/`API 地址填后端(默认 `http://127.0.0.1:38080`)。须用 `server.py`(而非裸 `http.server`),才能从 `labels.yaml` 加载编号+名称。
## HLS 预览(链路 1
真 RTSP 可通过 MediaMTX 转 HLS 在页内预览;点击「启动 / 刷新预览」。