mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 18:35:51 +02:00
refactor: nodes analytics (#847)
* refactor: nodes analytics * feat(debug): add pprof in debug mode * refactor: websocket error handler
This commit is contained in:
parent
b1ba719cb1
commit
cb4977e5ab
17 changed files with 276 additions and 155 deletions
|
@ -3,6 +3,8 @@ package router
|
|||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-contrib/pprof"
|
||||
|
||||
"github.com/0xJacky/Nginx-UI/api/analytic"
|
||||
"github.com/0xJacky/Nginx-UI/api/certificate"
|
||||
"github.com/0xJacky/Nginx-UI/api/cluster"
|
||||
|
@ -23,6 +25,7 @@ import (
|
|||
"github.com/0xJacky/Nginx-UI/internal/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/uozi-tech/cosy"
|
||||
cSettings "github.com/uozi-tech/cosy/settings"
|
||||
)
|
||||
|
||||
func InitRouter() {
|
||||
|
@ -45,6 +48,9 @@ func InitRouter() {
|
|||
// Authorization required and not websocket request
|
||||
g := root.Group("/", middleware.AuthRequired(), middleware.Proxy())
|
||||
{
|
||||
if cSettings.ServerSettings.RunMode == gin.DebugMode {
|
||||
pprof.Register(g)
|
||||
}
|
||||
user.InitUserRouter(g)
|
||||
analytic.InitRouter(g)
|
||||
user.InitManageUserRouter(g)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue