Improve system information retrieval for macOS and Windows

- Introduce `Os` enum to represent supported operating systems.
- Update `SystemInfo` interface to include OS type.
- Refactor `ContainerChart` component to use `ChartType` enum for better clarity.
- Switched to dynamic units in container memory chart.
This commit is contained in:
henrygd
2025-04-22 20:29:17 -04:00
parent 358e05d544
commit ea665e02da
7 changed files with 89 additions and 24 deletions

View File

@@ -64,6 +64,14 @@ type NetIoStats struct {
Name string
}
type Os uint8
const (
Linux Os = iota
Darwin
Windows
)
type Info struct {
Hostname string `json:"h"`
KernelVersion string `json:"k,omitempty"`
@@ -79,6 +87,7 @@ type Info struct {
Podman bool `json:"p,omitempty"`
GpuPct float64 `json:"g,omitempty"`
DashboardTemp float64 `json:"dt,omitempty"`
Os Os `json:"os"`
}
// Final data structure to return to the hub