diff --git a/README.md b/README.md index 1d7ef39..3670f2b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@
LOGO designed by 熊大 .

-    +   

:trollface: Nezha Monitoring self-hosted lightweight monitoring and operation and maintenance system. Supports system status, HTTP (SSL certificate change, upcoming expiration, expiration), TCP, Ping monitoring and alerting, execute scheduled tasks and web terminal.

diff --git a/cmd/agent/monitor/monitor.go b/cmd/agent/monitor/monitor.go index 0977e37..d62014d 100644 --- a/cmd/agent/monitor/monitor.go +++ b/cmd/agent/monitor/monitor.go @@ -71,7 +71,7 @@ func GetHost(agentConfig *model.AgentConfig) *model.Host { } return &model.Host{ - Platform: hi.OS, + Platform: hi.Platform, PlatformVersion: hi.PlatformVersion, CPU: cpus, MemTotal: mv.Total, diff --git a/cmd/playground/main.go b/cmd/playground/main.go index 7905807..af2dedb 100644 --- a/cmd/playground/main.go +++ b/cmd/playground/main.go @@ -1,5 +1,15 @@ package main -func main() { +import ( + "log" + "github.com/shirou/gopsutil/v3/host" +) + +func main() { + info, err := host.Info() + if err != nil { + panic(err) + } + log.Printf("%#v", info) } diff --git a/go.mod b/go.mod index 615c6b6..25c5e71 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/p14yground/go-github-selfupdate v0.0.0-20220205132106-76a6d59b925b github.com/patrickmn/go-cache v2.1.0+incompatible github.com/robfig/cron/v3 v3.0.1 - github.com/shirou/gopsutil/v3 v3.22.3 + github.com/shirou/gopsutil/v3 v3.22.4 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.11.0 github.com/stretchr/testify v1.7.1 diff --git a/go.sum b/go.sum index 60e7982..6b61363 100644 --- a/go.sum +++ b/go.sum @@ -291,8 +291,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/shirou/gopsutil/v3 v3.22.3 h1:UebRzEomgMpv61e3hgD1tGooqX5trFbdU/ehphbHd00= -github.com/shirou/gopsutil/v3 v3.22.3/go.mod h1:D01hZJ4pVHPpCTZ3m3T2+wDF2YAGfd+H4ifUguaQzHM= +github.com/shirou/gopsutil/v3 v3.22.4 h1:srAQaiX6jX/cYL6q29aE0m8lOskT9CurZ9N61YR3yoI= +github.com/shirou/gopsutil/v3 v3.22.4/go.mod h1:D01hZJ4pVHPpCTZ3m3T2+wDF2YAGfd+H4ifUguaQzHM= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= diff --git a/resource/static/theme-hotaru/img/clients/CN.png b/resource/static/theme-hotaru/img/clients/CN.png index b9b81fd..5165243 100644 Binary files a/resource/static/theme-hotaru/img/clients/CN.png and b/resource/static/theme-hotaru/img/clients/CN.png differ diff --git a/resource/template/common/header.html b/resource/template/common/header.html index 13ee240..0443dc9 100644 --- a/resource/template/common/header.html +++ b/resource/template/common/header.html @@ -7,11 +7,14 @@ {{.Title}} - + + - {{end}} + {{end}} \ No newline at end of file diff --git a/resource/template/dashboard/server.html b/resource/template/dashboard/server.html index 7164b34..934c122 100644 --- a/resource/template/dashboard/server.html +++ b/resource/template/dashboard/server.html @@ -73,7 +73,7 @@ {{template "component/server" .}} {{template "common/footer" .}} - + - - + + + {{if ts .CustomCode}} @@ -165,8 +165,8 @@ - - + +