1
0
Эх сурвалжийг харах

fix the number of client bug

刘河 5 жил өмнө
parent
commit
883dd07d86
1 өөрчлөгдсөн 4 нэмэгдсэн , 1 устгасан
  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