Files
operating-room-monitor-server/clients/demo-client/README.md
Kevin 153c91f8ff 将 Demo 录制收敛为三条独立链路,并重做联调台 UI。
移除 demo_orch 统一编排,改为 recording_demo 与 live/simulated 服务;客户端拆分为静态资源,以模式卡片与 chip 耗材覆盖三链路联调,并同步测试与文档。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 16:50:23 +08:00

56 lines
1.9 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` | 需要 | 需要 |
| **链路 2 · 模拟实时** | 选满 N 路视频 → 开始模拟开录 | `POST /internal/demo/simulated-start` | 需要 | 需要 |
| **链路 3 · 离线精确** | 选 MP4 → 上传并处理 | `POST /internal/demo/offline-batch` | 无 | 不需要 |
链路 2/3 需 `DEMO_ORCHESTRATOR_ENABLED=true`;链路 2 还需可写 `OR_SITE_CONFIG_JSON_FILE`。页顶「刷新状态」可查看 API 与 Demo 模式是否就绪。
## 界面说明
- **模式卡片**:点选切换,只显示当前模式相关配置
- **耗材**:标签 chip 多选;「高级」可编辑 JSON
- **链路 2**默认只需上传视频RTSP 路径与 camera_id 在「高级」折叠
- **链路 3**:独立 MP4 上传区,可选生成标注视频
- **开发者日志**:右侧折叠,记录完整 HTTP 请求/响应
## 运行
```bash
cd backend && docker compose up -d --build
cd ../clients/demo-client && ./start.sh
open http://127.0.0.1:38081/
```
「API 地址」默认 `http://127.0.0.1:38080`;从局域网访问 demo 页时会自动改用当前主机 IP。
## 文件
```
clients/demo-client/
index.html # 页面骨架
styles.css # 样式
app.js # 逻辑
server.py # 静态服务 + GET /labels.json
labels.yaml # 耗材标签(与后端同步)
start.sh
```
## 手跑假 RTSP链路 2 高级)
```bash
python3 fake_rtsp_from_file.py /path/to/video.mp4 --port 18554 --path demo
```
详见 [`../../docs/video-backends.md`](../../docs/video-backends.md)。
## CORS
跨域访问 API 时设置 `DEMO_CORS_ENABLED=true`