mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
v0.6.1 优化CSS、服务报警、服务状态展示
This commit is contained in:
@@ -54,7 +54,7 @@ func ServeWeb(port uint) {
|
||||
}
|
||||
if a == 0 {
|
||||
// 这是从未在线的情况
|
||||
return 1 / float32(b) * 100
|
||||
return 0.00001 / float32(b) * 100
|
||||
}
|
||||
return float32(a) / float32(b) * 100
|
||||
},
|
||||
@@ -67,7 +67,7 @@ func ServeWeb(port uint) {
|
||||
}
|
||||
if a == 0 {
|
||||
// 这是从未在线的情况
|
||||
return 1 / float32(b) * 100
|
||||
return 0.00001 / float32(b) * 100
|
||||
}
|
||||
return float32(a) / float32(b) * 100
|
||||
},
|
||||
|
||||
@@ -110,6 +110,6 @@ func loadCrons() {
|
||||
func main() {
|
||||
go controller.ServeWeb(dao.Conf.HTTPPort)
|
||||
go rpc.ServeRPC(dao.Conf.GRPCPort)
|
||||
go rpc.DispatchTask(time.Minute * 3)
|
||||
go rpc.DispatchTask(time.Second * 30)
|
||||
dao.AlertSentinelStart()
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"os/exec"
|
||||
"time"
|
||||
|
||||
"github.com/genkiroid/cert"
|
||||
"github.com/go-ping/ping"
|
||||
"github.com/naiba/nezha/pkg/utils"
|
||||
"github.com/shirou/gopsutil/v3/cpu"
|
||||
@@ -20,8 +21,8 @@ import (
|
||||
func main() {
|
||||
// icmp()
|
||||
// tcpping()
|
||||
// httpWithSSLInfo()
|
||||
sysinfo()
|
||||
httpWithSSLInfo()
|
||||
// sysinfo()
|
||||
// cmdExec()
|
||||
}
|
||||
|
||||
@@ -72,11 +73,12 @@ func httpWithSSLInfo() {
|
||||
httpClient := &http.Client{Transport: transCfg, CheckRedirect: func(req *http.Request, via []*http.Request) error {
|
||||
return http.ErrUseLastResponse
|
||||
}}
|
||||
resp, err := httpClient.Get("http://mail.nai.ba")
|
||||
fmt.Println(err, resp.StatusCode)
|
||||
url := "https://ops.naibahq.com"
|
||||
resp, err := httpClient.Get(url)
|
||||
fmt.Println(err, resp)
|
||||
// SSL 证书信息获取
|
||||
// c := cert.NewCert("expired-ecc-dv.ssl.com")
|
||||
// fmt.Println(c.Error)
|
||||
c := cert.NewCert(url[8:])
|
||||
fmt.Println(c.Error)
|
||||
}
|
||||
|
||||
func icmp() {
|
||||
|
||||
Reference in New Issue
Block a user