diff --git a/router/websocket/message.go b/router/websocket/message.go index 5186826..85fb77f 100644 --- a/router/websocket/message.go +++ b/router/websocket/message.go @@ -8,6 +8,7 @@ const ( SetStateEvent = "set state" SendServerLogsEvent = "send logs" SendCommandEvent = "send command" + SendStatsEvent = "send stats" ErrorEvent = "daemon error" JwtErrorEvent = "jwt error" ) diff --git a/router/websocket/websocket.go b/router/websocket/websocket.go index 45cc575..45ddf9f 100644 --- a/router/websocket/websocket.go +++ b/router/websocket/websocket.go @@ -360,6 +360,16 @@ func (h *Handler) HandleInbound(m Message) error { }) } + return nil + } + case SendStatsEvent: + { + b, _ := json.Marshal(h.server.Proc()) + h.SendJson(&Message{ + Event: server.StatsEvent, + Args: []string{string(b)}, + }) + return nil } case SendCommandEvent: