From 4d3bea48e11883f0fb99f2e4bb8d943fe162c687 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Tue, 5 Dec 2023 00:30:47 +0330 Subject: [api] online users Co-Authored-By: Alireza Ahmadi --- web/controller/api.go | 6 ++++++ web/web.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'web') diff --git a/web/controller/api.go b/web/controller/api.go index 32c639f8..73c36787 100644 --- a/web/controller/api.go +++ b/web/controller/api.go @@ -38,6 +38,8 @@ func (a *APIController) initRouter(g *gin.RouterGroup) { g.POST("/resetAllClientTraffics/:id", a.resetAllClientTraffics) g.POST("/delDepletedClients/:id", a.delDepletedClients) g.GET("/createbackup", a.createBackup) + g.POST("/onlines", a.onlines) + a.inboundController = NewInboundController(g) } @@ -104,3 +106,7 @@ func (a *APIController) delDepletedClients(c *gin.Context) { func (a *APIController) createBackup(c *gin.Context) { a.Tgbot.SendBackupToAdmins() } + +func (a *APIController) onlines(c *gin.Context) { + a.inboundController.onlines(c) +} diff --git a/web/web.go b/web/web.go index a8c49ce5..51b7603c 100644 --- a/web/web.go +++ b/web/web.go @@ -175,7 +175,7 @@ func (s *Server) initRouter() (*gin.Engine, error) { if err != nil { return nil, err } - engine.Use(gzip.Gzip(gzip.DefaultCompression, gzip.WithExcludedPaths([]string{basePath + "xui/API/"}))) + engine.Use(gzip.Gzip(gzip.DefaultCompression, gzip.WithExcludedPaths([]string{basePath + "panel/API/"}))) assetsBasePath := basePath + "assets/" store := cookie.NewStore(secret) -- cgit v1.2.3