mirror of
https://github.com/swissmakers/fail2ban-ui.git
synced 2026-04-11 13:47:05 +02:00
Implemented a real-time console log streaming via WebSocket for debugging purposes. Users can enable console output in settings to view application logs directly in the web interface.
This commit is contained in:
@@ -82,6 +82,15 @@ func main() {
|
||||
wsHub := web.NewHub()
|
||||
go wsHub.Run()
|
||||
|
||||
// Setup console log writer to capture stdout and send via WebSocket
|
||||
web.SetupConsoleLogWriter(wsHub)
|
||||
// Update enabled state based on current settings
|
||||
web.UpdateConsoleLogEnabled()
|
||||
// Register callback to update console log state when settings change
|
||||
config.SetUpdateConsoleLogStateFunc(func(enabled bool) {
|
||||
web.SetConsoleLogEnabled(enabled)
|
||||
})
|
||||
|
||||
// Register all application routes, including the static files and templates.
|
||||
web.RegisterRoutes(router, wsHub)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user