fix: add json tags for memory fields in metrics struct

This commit is contained in:
tian 2026-05-08 19:50:22 +08:00
parent 807561b908
commit 08712814d9

View File

@ -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)