improve: ping 监控 close #68

服务状态页插入自定义代码
This commit is contained in:
naiba 2021-01-18 09:42:44 +08:00
parent 49d4f4879f
commit 14a6df66ff
5 changed files with 9 additions and 2 deletions

View File

@ -205,7 +205,7 @@ URL 里面也可放置占位符,请求时会进行简单的字符串替换。
## 变更日志
最新:`dashboard 0.2.5` `agent 0.2.4`,只记录最后一次更新导致必须更新面板的说明。
最新:`dashboard 0.2.5` `agent 0.2.5`,只记录最后一次更新导致必须更新面板的说明。
- `dashboard 0.2.0` `agent 0.2.0` **重大更新**

View File

@ -198,6 +198,7 @@ func doTask(task *pb.Task) {
}
case model.MonitorTypeICMPPing:
pinger, err := ping.NewPinger(task.GetData())
pinger.SetPrivileged(true)
if err == nil {
pinger.Count = 10
pinger.Timeout = time.Second * 20

View File

@ -1,5 +1,8 @@
{{define "theme-default/service"}}
{{template "common/header" .}}
{{if ts .CustomCode}}
{{.CustomCode|safe}}
{{end}}
{{template "common/menu" .}}
<div class="nb-container">
<div class="ui container">

View File

@ -1,5 +1,8 @@
{{define "theme-hotaru/service"}}
{{template "common/header" .}}
{{if ts .CustomCode}}
{{.CustomCode|safe}}
{{end}}
{{template "common/menu" .}}
<div class="nb-container">
<div class="ui container">

View File

@ -27,7 +27,7 @@ var ServerLock sync.RWMutex
var SortedServerList []*model.Server
var SortedServerLock sync.RWMutex
var Version = "v0.2.4"
var Version = "v0.2.5"
func ReSortServer() {
ServerLock.RLock()