From a289882a1caa6333271648d13829a044b23832af Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Thu, 7 May 2026 14:16:21 +0800 Subject: [PATCH] feat: video monitor page with HLS preview --- internal/web/ui.go | 6 +++ internal/web/ui/templates/layout.html | 1 + internal/web/ui/templates/monitor.html | 69 ++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 internal/web/ui/templates/monitor.html diff --git a/internal/web/ui.go b/internal/web/ui.go index 4e33944..702997e 100644 --- a/internal/web/ui.go +++ b/internal/web/ui.go @@ -661,6 +661,7 @@ func (u *UI) Routes() (chi.Router, error) { r.Post("/resources/sync", u.actionResourceSync) r.Get("/diagnostics", u.pageDiagnostics) r.Get("/alarms", u.pageAlarms) + r.Get("/monitor", u.pageMonitor) r.Get("/recognition", u.pageRecognition) r.Get("/logs", u.pageLogs) @@ -3863,3 +3864,8 @@ func (u *UI) actionDeviceFaceGalleryReload(w http.ResponseWriter, r *http.Reques } u.render(w, r, "config_ui", data) } + +func (u *UI) pageMonitor(w http.ResponseWriter, r *http.Request) { + u.ensureDevicesLoaded() + u.render(w, r, "monitor", PageData{Title: "视频监控", Devices: u.registry.GetDevices()}) +} diff --git a/internal/web/ui/templates/layout.html b/internal/web/ui/templates/layout.html index a011604..f9ea65a 100644 --- a/internal/web/ui/templates/layout.html +++ b/internal/web/ui/templates/layout.html @@ -36,6 +36,7 @@ {{icon "assets"}}模型管理 {{icon "template"}}资源管理 {{icon "bell"}}告警中心 +t {{icon "devices"}}视频监控 {{icon "logs"}}日志审计 {{icon "heartbeat"}}系统状态 diff --git a/internal/web/ui/templates/monitor.html b/internal/web/ui/templates/monitor.html new file mode 100644 index 0000000..40b7c3d --- /dev/null +++ b/internal/web/ui/templates/monitor.html @@ -0,0 +1,69 @@ +{{define "monitor"}} +
+
+
+

{{icon "devices"}}视频监控

+
从设备拉取通道列表,点击通道查看实时画面。
+
+
+ +
+
+
+ +
+
请先选择在线设备,点击"加载通道"。
+
+ + +{{end}}