feat: 天地图瓦片缓存(tile-cache)、拓扑标注助手与文档更新
- tile-cache: 瓦片缓存服务(vec/cva)、启动探针、详细日志、上游超时可配置(UPSTREAM_TIMEOUT_MS) - central: docker-compose 集成 tile-cache,env.example 增加 TILE_CACHE_* / TIANDITU_TK - topology-editor: 天地图/缓存加载、GPS 安全来源错误提示、TIANDITU 文档(403/白名单、localhost 测试说明) - doc: README 部署步骤与 GPS 安全来源说明,TIANDITU_CONFIG 完善 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
43
README.md
43
README.md
@@ -20,8 +20,9 @@
|
||||
|
||||
## 项目结构
|
||||
|
||||
- **central-server/** — 中央:Prometheus、Grafana、VictoriaMetrics、Alertmanager
|
||||
- **central-server/** — 中央:Prometheus、Grafana、VictoriaMetrics、Alertmanager、拓扑标注助手
|
||||
- **edge-agent/** — 边缘:Prometheus Edge、ONVIF Exporter、Blackbox Exporter
|
||||
- **topology-editor/** — 拓扑标注助手(与 central 同机运行):上传/下载 targets.csv,H5 采集 GPS、天地图校验
|
||||
|
||||
---
|
||||
|
||||
@@ -33,7 +34,8 @@
|
||||
cp env.example .env # 可选
|
||||
bash deploy.sh
|
||||
```
|
||||
访问 Grafana:http://localhost:3000(admin / admin123)。
|
||||
访问 Grafana:http://localhost:3000(admin / admin123)。
|
||||
拓扑标注助手随中央一起启动:http://localhost:4080 — 上传本机 `targets.csv`,选设备、补 GPS 或地图点击修正后下载 CSV,再部署到边缘 `edge-agent/config/`。
|
||||
|
||||
2. **第二步:部署边缘**(可选)
|
||||
- 本机同机:`cd edge-agent && bash run-edge-local.sh`
|
||||
@@ -41,7 +43,7 @@
|
||||
|
||||
边缘数据在 Grafana 中需选择数据源 **「VictoriaMetrics」** 才能看到;中央自身指标在数据源「Prometheus」。
|
||||
|
||||
3. **第三步(可选)**:多用户见 `doc/USER_MANAGEMENT.md`,告警见 `doc/ALERTMANAGER_CONFIG.md`。
|
||||
3. **第三步(可选)**:多用户见 `doc/USER_MANAGEMENT.md`,告警见 `doc/ALERTING.md`。
|
||||
|
||||
---
|
||||
|
||||
@@ -50,8 +52,9 @@
|
||||
- Grafana: http://localhost:3000
|
||||
- Prometheus: http://localhost:9091
|
||||
- VictoriaMetrics: http://localhost:8428
|
||||
- Alertmanager: http://localhost:9093
|
||||
边缘 Prometheus(端口 9092):http://localhost:9092
|
||||
- Alertmanager: http://localhost:9093
|
||||
- **拓扑标注助手**: http://localhost:4080
|
||||
- 边缘 Prometheus(端口 9092):http://localhost:9092
|
||||
|
||||
---
|
||||
|
||||
@@ -61,6 +64,36 @@ Grafana 支持多组织、多用户;通过 Prometheus 标签做数据隔离(
|
||||
|
||||
---
|
||||
|
||||
## 拓扑标注助手(targets.csv 标注流程)
|
||||
|
||||
拓扑标注助手主要解决「在现场用手机给设备打坐标、维护拓扑关系」的问题,典型使用流程:
|
||||
|
||||
1. **准备 CSV**
|
||||
在本机编辑好 `targets.csv`(推荐按 `edge-agent/config/targets.csv` 的示例维护完整的 type/name/role/parent/uplink_type 等字段)。
|
||||
|
||||
2. **上传到标注助手**
|
||||
中央已启动后,浏览器访问 `http://localhost:4080`:
|
||||
- 在顶部「上传 / 下载 targets.csv」区域,选择本机 `targets.csv` 并点击 **上传 CSV**。
|
||||
|
||||
3. **现场标注 / 校正坐标**
|
||||
- 在「选择已有设备」下拉中选中要标注的设备;
|
||||
- 在现场用手机点击 **获取当前 GPS 坐标**,或在天地图上点击正确位置;
|
||||
- 如有需要,补充/调整 `parent`、`uplink_type` 等字段;
|
||||
- 点击 **保存到 targets.csv**(仅修改标注助手中的当前副本)。
|
||||
|
||||
4. **下载并应用到边缘**
|
||||
- 在页面顶部点击 **下载 targets.csv**,得到新的 CSV;
|
||||
- 将其拷贝到边缘节点的 `edge-agent/config/targets.csv` 覆盖原文件;
|
||||
- 在边缘节点执行:
|
||||
```bash
|
||||
cd edge-agent/config
|
||||
./update-configs.sh
|
||||
./csv-to-topology-geojson.sh targets.csv topology.geojson
|
||||
```
|
||||
以生成最新的 onvif/ping 配置与拓扑 GeoJSON,Grafana Geomap 即可按经纬度和拓扑关系展示设备与链路。
|
||||
|
||||
---
|
||||
|
||||
## 文档
|
||||
|
||||
**入口与部署顺序**:**[doc/README.md](doc/README.md)**
|
||||
|
||||
Reference in New Issue
Block a user