diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-12-05 00:00:47 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-12-05 14:10:16 +0300 |
| commit | 4d3bea48e11883f0fb99f2e4bb8d943fe162c687 (patch) | |
| tree | 7277670770186abc266e1fc69c984d84c43ee5b9 | |
| parent | d8c509b41056b9ca41725fac0bfa7515ce1f795b (diff) | |
[api] online users
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | web/controller/api.go | 6 | ||||
| -rw-r--r-- | web/web.go | 2 |
3 files changed, 8 insertions, 1 deletions
@@ -311,6 +311,7 @@ Enter the user ID in input field number 4. The Telegram accounts with this id wi | `POST` | `"/resetAllTraffics"` | Reset traffics of all inbounds | | `POST` | `"/resetAllClientTraffics/:id"` | Reset traffics of all clients in an inbound | | `POST` | `"/delDepletedClients/:id"` | Delete inbound depleted clients (-1: all) | +| `POST` | `"/onlines"` | Get Online users ( list of emails ) | \*- The field `clientId` should be filled by: 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) +} @@ -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) |
