feat: add management web console

This commit is contained in:
Yoilun
2026-04-27 11:28:57 +08:00
parent b3672c564a
commit c4f9dab049
17 changed files with 2051 additions and 7 deletions

View File

@@ -51,22 +51,55 @@
## 区域标定
项目内置一个本地 Web 标定工具,可以从 RTSP 拉取一帧截图,再用鼠标标定 8 个格口和垃圾桶区域:
项目现在有正式管理页,前端默认 `23000`,后端默认 `19080`
```bash
python3 tools/calibrator/server.py --host 127.0.0.1 --port 18090
scripts/run_manage_api.sh
```
另开一个终端:
```bash
scripts/run_web.sh
```
打开:
```text
http://127.0.0.1:18090
http://127.0.0.1:23000
```
详细说明见 `tools/calibrator/README_zh.md`
管理页支持:
- 配置 RTSP 地址和阈值
- 从 RTSP 拉取一帧截图
- 标定 `r1c1``r2c4` 的 8 个格口
- 标定垃圾桶区域
- 直接保存标定结果到项目配置文件
- 查看事件汇总和最近 JSONL 事件
项目仍保留 `tools/calibrator` 作为轻量单页标定工具,但正式使用建议走 `23000` 管理页。
## 管理 API
默认后端:
```text
http://127.0.0.1:19080
```
主要接口:
- `GET /api/manage/health`
- `GET /api/manage/config`
- `PUT /api/manage/config`
- `POST /api/manage/snapshot`
- `PUT /api/manage/calibration`
- `GET /api/manage/summary`
- `GET /api/manage/events`
## 本地测试
```bash
python3 -m unittest discover -s tests -v
PYTHONPATH=src python3 -m unittest discover -s tests -v
```