Files
VoCat/internal/server/host_stats_other.go
T
MengMengCodeandClaude Opus 4.8 115598757a feat: dashboard host, performance, task, and online-rate cards
Add four cards to the dashboard:

- Host hardware card (CPU / motherboard / memory / disk model) backed by
  a new GET /api/dashboard/host endpoint that probes /proc and /sys once
  and caches the identities. x86 hosts read cpuinfo model name, DMI board
  data, dmidecode DIMM info, and block device models; ARM boards compose
  the device-tree SoC with the Cortex part name and fall back to memory
  capacity.
- Performance card with live CPU / memory / disk usage bars and real-time
  network up/down rates. Rates derive from cumulative kernel counters
  sampled on demand by dashboard polling (no background goroutine), with
  bridge/tunnel/vocat virtual interfaces excluded to avoid double
  counting.
- Upcoming scheduled tasks card listing the next three enabled automatic
  tasks with their run times.
- Module online rate card aggregating all recognized modules into one
  large percentage colored by four levels (red/orange/yellow/green).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-16 17:46:38 +08:00

17 lines
544 B
Go

//go:build !linux
package server
// Host statistics are only meaningful on the Linux deployment target; on other
// platforms every probe reports empty/zero and the dashboard renders "—".
func probeHostStatic() hostStaticInfo { return hostStaticInfo{} }
func readHostCPUTimes() (hostCPUTimes, bool) { return hostCPUTimes{}, false }
func readHostNetTotals() (uint64, uint64, bool) { return 0, 0, false }
func readHostMemory() (float64, uint64, uint64) { return 0, 0, 0 }
func readHostDisk() (float64, uint64, uint64) { return 0, 0, 0 }