mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
feat: Add GPU inspection support (#373)
This commit is contained in:
@@ -32,6 +32,7 @@ type HostState struct {
|
||||
UdpConnCount uint64
|
||||
ProcessCount uint64
|
||||
Temperatures []SensorTemperature
|
||||
GPU float64
|
||||
}
|
||||
|
||||
func (s *HostState) PB() *pb.State {
|
||||
@@ -60,6 +61,7 @@ func (s *HostState) PB() *pb.State {
|
||||
UdpConnCount: s.UdpConnCount,
|
||||
ProcessCount: s.ProcessCount,
|
||||
Temperatures: ts,
|
||||
Gpu: s.GPU,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,6 +91,7 @@ func PB2State(s *pb.State) HostState {
|
||||
UdpConnCount: s.GetUdpConnCount(),
|
||||
ProcessCount: s.GetProcessCount(),
|
||||
Temperatures: ts,
|
||||
GPU: s.GetGpu(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,6 +108,7 @@ type Host struct {
|
||||
IP string `json:"-"`
|
||||
CountryCode string
|
||||
Version string
|
||||
GPU []string
|
||||
}
|
||||
|
||||
func (h *Host) PB() *pb.Host {
|
||||
@@ -121,6 +125,7 @@ func (h *Host) PB() *pb.Host {
|
||||
Ip: h.IP,
|
||||
CountryCode: h.CountryCode,
|
||||
Version: h.Version,
|
||||
Gpu: h.GPU,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,5 +143,6 @@ func PB2Host(h *pb.Host) Host {
|
||||
IP: h.GetIp(),
|
||||
CountryCode: h.GetCountryCode(),
|
||||
Version: h.GetVersion(),
|
||||
GPU: h.GetGpu(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user