From 55cbbcafe647873ddd22744469ae994c2297c15e Mon Sep 17 00:00:00 2001 From: Akkia Date: Fri, 22 Apr 2022 16:30:05 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E5=A2=9E=E5=8A=A0TCP=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E6=95=B0=E4=B8=8EUDP=E8=BF=9E=E6=8E=A5=E6=95=B0?= =?UTF-8?q?=E7=9A=84=E5=8D=A0=E4=BD=8D=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/notification.go | 4 ++++ resource/template/component/notification.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/model/notification.go b/model/notification.go index 3e631d4..448d31b 100644 --- a/model/notification.go +++ b/model/notification.go @@ -175,6 +175,8 @@ func replaceParamsInString(s *Server, str string, message string, mod func(strin str = strings.ReplaceAll(str, "#SERVER.LOAD1#", mod(fmt.Sprintf("%f", s.State.Load1))) str = strings.ReplaceAll(str, "#SERVER.LOAD5#", mod(fmt.Sprintf("%f", s.State.Load5))) str = strings.ReplaceAll(str, "#SERVER.LOAD15#", mod(fmt.Sprintf("%f", s.State.Load15))) + str = strings.ReplaceAll(str, "#SERVER.TCPCONNCOUNT#", mod(fmt.Sprintf("%d", s.State.TcpConnCount))) + str = strings.ReplaceAll(str, "#SERVER.UDPCONNCOUNT#", mod(fmt.Sprintf("%d", s.State.UdpConnCount))) } } else { str = strings.ReplaceAll(str, "#NEZHA#", message) @@ -192,6 +194,8 @@ func replaceParamsInString(s *Server, str string, message string, mod func(strin str = strings.ReplaceAll(str, "#SERVER.LOAD1#", fmt.Sprintf("%f", s.State.Load1)) str = strings.ReplaceAll(str, "#SERVER.LOAD5#", fmt.Sprintf("%f", s.State.Load5)) str = strings.ReplaceAll(str, "#SERVER.LOAD15#", fmt.Sprintf("%f", s.State.Load15)) + str = strings.ReplaceAll(str, "#SERVER.TCPCONNCOUNT#", fmt.Sprintf("%d", s.State.TcpConnCount)) + str = strings.ReplaceAll(str, "#SERVER.UDPCONNCOUNT#", fmt.Sprintf("%d", s.State.UdpConnCount)) } } return str diff --git a/resource/template/component/notification.html b/resource/template/component/notification.html index 693468e..f44d26f 100644 --- a/resource/template/component/notification.html +++ b/resource/template/component/notification.html @@ -36,7 +36,7 @@
- +