mirror of
https://github.com/cloudreve/cloudreve.git
synced 2025-12-15 10:04:01 +08:00
feat(fs): fs change event notification via SSE / show panic stack trace in task queue
This commit is contained in:
@@ -426,3 +426,13 @@ func ListArchiveFiles(c *gin.Context) {
|
||||
Data: resp,
|
||||
})
|
||||
}
|
||||
|
||||
func HandleExplorerEventsPush(c *gin.Context) {
|
||||
service := ParametersFromContext[*explorer.ExplorerEventService](c, explorer.ExplorerEventParamCtx{})
|
||||
err := service.HandleExplorerEventsPush(c)
|
||||
if err != nil {
|
||||
c.JSON(200, serializer.Err(c, err))
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -727,6 +727,13 @@ func initMasterRouter(dep dependency.Dep) *gin.Engine {
|
||||
controllers.FromJSON[explorer.PatchViewService](explorer.PatchViewParameterCtx{}),
|
||||
controllers.PatchView,
|
||||
)
|
||||
|
||||
// Server event push
|
||||
file.GET("events",
|
||||
middleware.LoginRequired(),
|
||||
controllers.FromQuery[explorer.ExplorerEventService](explorer.ExplorerEventParamCtx{}),
|
||||
controllers.HandleExplorerEventsPush,
|
||||
)
|
||||
}
|
||||
|
||||
// 分享相关
|
||||
|
||||
Reference in New Issue
Block a user