From 7aa3249314e8863a1fc765792e40787f4600f169 Mon Sep 17 00:00:00 2001 From: naiba Date: Fri, 23 Apr 2021 19:09:04 +0800 Subject: [PATCH] v0.6.6 --- README.md | 2 +- cmd/dashboard/controller/member_api.go | 3 ++- resource/static/main.js | 7 +++++-- resource/template/common/footer.html | 2 +- service/dao/dao.go | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2691a17..8b5d4e7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@


-    +   

:trollface: 哪吒监控 一站式轻监控轻运维系统。支持系统状态、HTTP(SSL 证书变更、即将到期、到期)、TCP、Ping 监控报警,命令批量执行和计划任务。

diff --git a/cmd/dashboard/controller/member_api.go b/cmd/dashboard/controller/member_api.go index 5bf15fc..e3480c1 100644 --- a/cmd/dashboard/controller/member_api.go +++ b/cmd/dashboard/controller/member_api.go @@ -6,6 +6,7 @@ import ( "fmt" "net/http" "strconv" + "strings" "time" "github.com/gin-gonic/gin" @@ -205,7 +206,7 @@ func (ma *memberAPI) addOrEditMonitor(c *gin.Context) { err := c.ShouldBindJSON(&mf) if err == nil { m.Name = mf.Name - m.Target = mf.Target + m.Target = strings.TrimSpace(mf.Target) m.Type = mf.Type m.ID = mf.ID m.SkipServersRaw = mf.SkipServersRaw diff --git a/resource/static/main.js b/resource/static/main.js index 82ad95b..30343fd 100644 --- a/resource/static/main.js +++ b/resource/static/main.js @@ -60,8 +60,11 @@ function showFormModal(modelSelector, formID, URL, getData) { if (item.name.endsWith("ServersRaw")) { if (item.value.length > 2) { - obj[item.name] = - "[" + item.value.substr(3, item.value.length - 1) + "]"; + obj[item.name] = JSON.stringify( + [...item.value.matchAll(/\d+/gm)].map((k) => + parseInt(k[0]) + ) + ); } } diff --git a/resource/template/common/footer.html b/resource/template/common/footer.html index 52824af..4f594c6 100644 --- a/resource/template/common/footer.html +++ b/resource/template/common/footer.html @@ -9,7 +9,7 @@ - + diff --git a/service/dao/dao.go b/service/dao/dao.go index 3b6c8a9..7e8a8c3 100644 --- a/service/dao/dao.go +++ b/service/dao/dao.go @@ -13,7 +13,7 @@ import ( pb "github.com/naiba/nezha/proto" ) -var Version = "v0.6.5" // !!记得修改 README 中的 badge 版本!! +var Version = "v0.6.6" // !!记得修改 README 中的 badge 版本!! const ( SnapshotDelay = 3