feat(realtime): 多源观测追踪与启动配置文件支持

- 协议版本升至 3,Target 新增 sources 字段保留各接收器独立观测
- Store 改为按接收器维护 SourceObservation,基于 received_at_ms
  独立执行 TTL 过期,过期后自动 refresh 选取最新有效位置
- refresh() 按时间排序源观测,优先选取有坐标的最近记录
- rid-shared 新增 SourceObservation 结构体
- Observation 验证内联 target_id 规则,长度不超过 192
- DeviceTelemetry 扩展 raw_identity、raw_position、
  coordinate_system、position_unverified、relative_height_m
- 项目级 config.json 支持版本化配置与 sqlite.busy_timeout_ms,
  优先级:环境变量 > config.json > 旧版 maps/config.json
- web-worker 传递 sources 与 position_source 至前端
- 首页标题更新为"凌空智巡无人机监测系统"
```
This commit is contained in:
2026-10-27 15:49:52 +08:00
parent 4eaa88baeb
commit 11b71e5bf2
37 changed files with 1542 additions and 198 deletions
+8 -1
View File
@@ -117,7 +117,14 @@ pub fn connect(url: &str) -> Result<(), JsValue> {
}
for target in &frame.targets {
let o = &target.observation;
let detail = serde_json::to_string(o)
let mut value = serde_json::to_value(o).unwrap_or_default();
value["sources"] = serde_json::to_value(&target.sources).unwrap_or_default();
value["position_source"] = if o.coordinates().is_some() {
serde_json::json!(o.receiver_id)
} else {
serde_json::Value::Null
};
let detail = serde_json::to_string(&value)
.ok()
.and_then(|s| js_sys::JSON::parse(&s).ok())
.unwrap_or(JsValue::NULL);