Explorar o código

fix the number of client bug

刘河 %!s(int64=5) %!d(string=hai) anos
pai
achega
883dd07d86
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      server/server.go

+ 4 - 1
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