add "network page" api (#460)

* add network api

* a minor change

* only show service name if unauthorized

* update

* 除了 load/初始化 避免在 singleton 进行查询等操作

---------

Co-authored-by: naiba <hi@nai.ba>
This commit is contained in:
UUBulb
2024-10-27 14:43:37 +08:00
committed by GitHub
parent b4edb4cc95
commit ff0ff9a9ee
4 changed files with 180 additions and 50 deletions

View File

@@ -55,6 +55,10 @@ func routers(r *gin.Engine) {
optionalAuth.GET("/ws/server", commonHandler(serverStream))
optionalAuth.GET("/server-group", commonHandler(listServerGroup))
optionalAuth.GET("/service", commonHandler(listService))
optionalAuth.GET("/service/:id", commonHandler(listServiceHistory))
optionalAuth.GET("/service/server", commonHandler(listServerWithServices))
optionalAuth.GET("/setting", commonHandler(listConfig))
auth := api.Group("", authMiddleware.MiddlewareFunc())
@@ -71,7 +75,6 @@ func routers(r *gin.Engine) {
auth.POST("/user", commonHandler(createUser))
auth.POST("/batch-delete/user", commonHandler(batchDeleteUser))
auth.GET("/service", commonHandler(listService))
auth.POST("/service", commonHandler(createService))
auth.PATCH("/service/:id", commonHandler(updateService))
auth.POST("/batch-delete/service", commonHandler(batchDeleteService))