feat(logging): add real-time log streaming via websocket

- Implement WebSocket endpoint for streaming logs to clients
- Add log broadcaster to manage client connections and history
- Update documentation with new WebSocket API details
- Include gorilla/websocket dependency for WebSocket support
This commit is contained in:
2026-03-17 19:12:15 +08:00
parent 20ec25328d
commit 33e5119b0a
9 changed files with 444 additions and 150 deletions

View File

@@ -10,6 +10,8 @@ func setupRoutes() {
postLog.Info("Setting up routes...")
http.HandleFunc("/system/getStatus", GetStatusHandler)
http.HandleFunc("/system/getSoftwareInfo", GetSoftwareInfoHandler)
logHandler := postLog.NewLogSocketHandler(postLog.GetLogBroadcaster())
http.HandleFunc("/system/getLogs", logHandler.Handle)
http.HandleFunc("/register", RegisterHandler)
http.HandleFunc("/login", LoginHandler)