From 08712814d91e9cd1c8cf7cac30b064f5eb8ba55d Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Fri, 8 May 2026 19:50:22 +0800 Subject: [PATCH] fix: add json tags for memory fields in metrics struct --- internal/web/ui.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/web/ui.go b/internal/web/ui.go index c5b9bfd..b7d6bd3 100644 --- a/internal/web/ui.go +++ b/internal/web/ui.go @@ -786,7 +786,7 @@ func (u *UI) pageDashboard(w http.ResponseWriter, r *http.Request) { if err != nil || code != 200 { continue } var m struct { CPU struct{ UsagePct float64 } `json:"cpu"` - Memory struct{ TotalKB, AvailableKB uint64 } `json:"memory"` + Memory struct{ TotalKB uint64 `json:"total_kb"`; AvailableKB uint64 `json:"available_kb"` } `json:"memory"` NPU struct{ UsagePct float64 } `json:"npu"` } json.Unmarshal(body, &m)