mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-03 02:53:29 +08:00
refactor join
also removes server node suspect there may be issues with proxy and UI interactions with nodes
This commit is contained in:
@@ -84,7 +84,7 @@ func fetchTelemetryData() (telemetryData, error) {
|
||||
data.Users = getDBLength(database.USERS_TABLE_NAME)
|
||||
data.Networks = getDBLength(database.NETWORKS_TABLE_NAME)
|
||||
data.Version = servercfg.GetVersion()
|
||||
data.Servers = GetServerCount()
|
||||
//data.Servers = GetServerCount()
|
||||
nodes, err := GetAllNodes()
|
||||
if err == nil {
|
||||
data.Nodes = len(nodes)
|
||||
@@ -111,10 +111,14 @@ func setTelemetryTimestamp(telRecord *models.Telemetry) error {
|
||||
}
|
||||
|
||||
// getClientCount - returns counts of nodes with various OS types and conditions
|
||||
func getClientCount(nodes []models.LegacyNode) clientCount {
|
||||
func getClientCount(nodes []models.Node) clientCount {
|
||||
var count clientCount
|
||||
for _, node := range nodes {
|
||||
switch node.OS {
|
||||
host, err := GetHost(node.HostID.String())
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
switch host.OS {
|
||||
case "darwin":
|
||||
count.MacOS += 1
|
||||
case "windows":
|
||||
@@ -124,9 +128,6 @@ func getClientCount(nodes []models.LegacyNode) clientCount {
|
||||
case "freebsd":
|
||||
count.FreeBSD += 1
|
||||
}
|
||||
if !(node.IsServer == "yes") {
|
||||
count.NonServer += 1
|
||||
}
|
||||
}
|
||||
return count
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user