refactor: migrate real-time log viewing from WebSocket to SSE with JSON wrapping

This commit is contained in:
duorameng
2026-06-29 22:00:09 +08:00
parent 06980beeb6
commit e5fc716b8f
7 changed files with 147 additions and 171 deletions
+1 -1
View File
@@ -161,7 +161,7 @@ func registerLogRoutes(g *gin.RouterGroup, c *Controllers) {
{
logs.GET("", c.Log.GetLogs)
logs.POST("/clear", c.Log.ClearLogs)
logs.GET("/ws", c.LogWS.StreamLog)
logs.GET("/sse", c.LogSSE.StreamLog)
logs.GET("/:id", c.Log.GetLogDetail)
logs.DELETE("/:id", c.Log.DeleteLog)
}
+1 -1
View File
@@ -58,7 +58,7 @@ func RegisterControllers() *Controllers {
File: controllers.NewFileController(constant.ScriptsWorkDir),
Dashboard: controllers.NewDashboardController(executorService),
Log: controllers.NewLogController(),
LogWS: controllers.NewLogWSController(),
LogSSE: controllers.NewLogSSEController(),
Terminal: controllers.NewTerminalController(envService),
Settings: controllers.NewSettingsController(userService, loginLogService, executorService),
Dependency: controllers.NewDependencyController(),
+1 -1
View File
@@ -21,7 +21,7 @@ type Controllers struct {
File *controllers.FileController
Dashboard *controllers.DashboardController
Log *controllers.LogController
LogWS *controllers.LogWSController
LogSSE *controllers.LogSSEController
Terminal *controllers.TerminalController
Settings *controllers.SettingsController
Dependency *controllers.DependencyController