feat(web-ui): 添加历史轨迹功能与地图适配

- 在 web-ui 中新增历史轨迹查询与回放功能,允许用户查看历史数据。
- 更新 map-loader.js 和 history-map-adapter.js,支持历史轨迹的地图渲染与交互。
- 修改 CSS 文件以改善历史轨迹界面的样式,确保在不同主题下的视觉一致性。
- 在 receivers.js 中更新接收机配置,支持 UID 身份隔离与状态显示优化。
- 在 map_settings.rs 中设置默认经纬度,提升地图初始化体验。
This commit is contained in:
2026-11-02 15:28:01 +08:00
parent 87d0ec8352
commit 7af8fb32cf
43 changed files with 3107 additions and 302 deletions
+23
View File
@@ -96,3 +96,26 @@ func TestRejectsBrokenImage(t *testing.T) {
t.Fatal("oversized dimensions accepted")
}
}
func TestParentPreviewIsNeverSavedAsAnOfflineTile(t *testing.T) {
var imageBytes bytes.Buffer
_ = png.Encode(&imageBytes, image.NewRGBA(image.Rect(0, 0, 256, 256)))
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Header.Get("x-rid-map-download") != "1" {
t.Error("download request is not identified")
}
w.Header().Set("x-map-source", "offline-parent")
_, _ = w.Write(imageBytes.Bytes())
}))
defer server.Close()
root := t.TempDir()
limiter := make(chan time.Time, 1)
limiter <- time.Now()
err := fetch(server.Client(), request{Output: root, BaseURL: server.URL}, tile{layer: "img_w", z: 3, x: 2, y: 2}, limiter)
if err == nil {
t.Fatal("parent preview was accepted as an actual tile")
}
if _, err := os.Stat(filepath.Join(root, "img_w", "3", "2", "2.png")); !os.IsNotExist(err) {
t.Fatal("parent preview was written to the offline directory")
}
}