diff --git a/README.md b/README.md index a462422..4d5ebc7 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@
LOGO designed by 熊大 .

-    +   

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

diff --git a/cmd/dashboard/controller/common_page.go b/cmd/dashboard/controller/common_page.go index 6c2893e..6b6c0b8 100644 --- a/cmd/dashboard/controller/common_page.go +++ b/cmd/dashboard/controller/common_page.go @@ -296,21 +296,22 @@ func (cp *commonPage) terminal(c *gin.Context) { go func() { connectDeadline := time.NewTimer(time.Second * 15) <-connectDeadline.C - close(deadlineCh) + deadlineCh <- struct{}{} }() dataCh := make(chan []byte) + errorCh := make(chan error) go func() { for { msgType, data, err := conn.ReadMessage() if err != nil { + errorCh <- err return } // 将文本消息转换为命令输入 if msgType == websocket.TextMessage { data = append([]byte{0}, data...) } - dataCh <- data } }() @@ -324,6 +325,8 @@ func (cp *commonPage) terminal(c *gin.Context) { if distConn == nil { return } + case <-errorCh: + return case data := <-dataCh: dataBuffer = append(dataBuffer, data) if distConn == nil { diff --git a/service/dao/dao.go b/service/dao/dao.go index a65c2ec..e91268a 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.9.27" // !!记得修改 README 中的 badge 版本!! +var Version = "v0.9.28" // !!记得修改 README 中的 badge 版本!! var ( Conf *model.Config