feat: implement custom WebUI support with dynamic frontend replacement
- Add WebUI service and controller for managing custom frontend packages - Allow overriding default static assets when custom WebUI is activated - Add Make commands for packing custom WebUI distributions - Update UI settings to support uploading, activating and deleting WebUIs - Document WebUI feature in README and changelog
This commit is contained in:
@@ -64,6 +64,7 @@ func initAuthorizedAPIRoutes(api *gin.RouterGroup, c *Controllers) {
|
||||
registerNotificationRoutes(adminOnly, c)
|
||||
registerAppLogRoutes(adminOnly, c)
|
||||
registerSystemWSRoutes(adminOnly, c)
|
||||
registerWebUIRoutes(adminOnly, c)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,3 +277,13 @@ func initAgentAPIRoutes(root *gin.RouterGroup, c *Controllers) {
|
||||
agentAPI.GET("/ws", c.Agent.WSConnect) // WebSocket 连接
|
||||
}
|
||||
}
|
||||
|
||||
func registerWebUIRoutes(g *gin.RouterGroup, c *Controllers) {
|
||||
webuiGroup := g.Group("/webui")
|
||||
{
|
||||
webuiGroup.GET("", c.WebUI.GetWebUIs)
|
||||
webuiGroup.POST("/upload", c.WebUI.UploadWebUI)
|
||||
webuiGroup.PUT("/active", c.WebUI.SetActiveWebUI)
|
||||
webuiGroup.DELETE("/:name", c.WebUI.DeleteWebUI)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user