🔖 dashboard v0.10.0

This commit is contained in:
naiba
2021-09-27 21:18:09 +08:00
parent ac3cfa162c
commit 4249fa82d7
11 changed files with 81 additions and 69 deletions

View File

@@ -74,11 +74,7 @@ func GetHost() *model.Host {
}
}
type GetStateConfig struct {
SkipConnectionCount bool
}
func GetState(conf GetStateConfig) *model.HostState {
func GetState(skipConnectionCount bool) *model.HostState {
hi, _ := host.Info()
mv, _ := mem.VirtualMemory()
@@ -101,7 +97,7 @@ func GetState(conf GetStateConfig) *model.HostState {
var tcpConnCount, udpConnCount uint64
if !conf.SkipConnectionCount {
if !skipConnectionCount {
conns, _ := net.Connections("all")
for i := 0; i < len(conns); i++ {
switch conns[i].Type {