From 883dd07d86a8eaf755a111bcae7d674166de5a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B2=B3?= Date: Fri, 6 Dec 2019 23:42:37 +0800 Subject: [PATCH] fix the number of client bug --- server/server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/server.go b/server/server.go index 5335a40..868a94d 100644 --- a/server/server.go +++ b/server/server.go @@ -342,7 +342,10 @@ func GetDashboardData() map[string]interface{} { data := make(map[string]interface{}) data["version"] = version.VERSION data["hostCount"] = common.GeSynctMapLen(file.GetDb().JsonDb.Hosts) - data["clientCount"] = common.GeSynctMapLen(file.GetDb().JsonDb.Clients) - 1 //Remove the public key client + data["clientCount"] = common.GeSynctMapLen(file.GetDb().JsonDb.Clients) + if beego.AppConfig.String("public_vkey") != "" { //remove public vkey + data["clientCount"] = data["clientCount"].(int) - 1 + } dealClientData() c := 0 var in, out int64