Browse Source

Send groups with initial websocket status

Ask Bjørn Hansen 12 years ago
parent
commit
a173befa7c
1 changed files with 7 additions and 1 deletions
  1. 7 1
      monitor.go

+ 7 - 1
monitor.go

@@ -111,7 +111,13 @@ func wsHandler(ws *websocket.Conn) {
 }
 
 func initialStatus() string {
-	status := map[string]string{"v": VERSION, "id": serverId, "ip": serverIP}
+	status := make(map[string]interface{})
+	status["v"] = VERSION
+	status["id"] = serverId
+	status["ip"] = serverIP
+	if len(serverGroups) > 0 {
+		status["groups"] = serverGroups
+	}
 	hostname, err := os.Hostname()
 	if err == nil {
 		status["h"] = hostname