diff options
| author | MHSanaei <33454419+MHSanaei@users.noreply.github.com> | 2023-02-28 22:54:29 +0300 |
|---|---|---|
| committer | MHSanaei <33454419+MHSanaei@users.noreply.github.com> | 2023-02-28 22:54:29 +0300 |
| commit | 5317df21f3923bfa771ed6008d5b0f5f8911e498 (patch) | |
| tree | 3109ee9abe5bf8cf24eef806f033c6d0e5dd160f /web/controller | |
| parent | 1a4ba4afd64531c466e5e4a0af7b45bcb3247339 (diff) | |
ip limit + export links
Diffstat (limited to 'web/controller')
| -rw-r--r-- | web/controller/inbound.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/web/controller/inbound.go b/web/controller/inbound.go index 96c7ba18..8ec90ed4 100644 --- a/web/controller/inbound.go +++ b/web/controller/inbound.go @@ -31,6 +31,8 @@ func (a *InboundController) initRouter(g *gin.RouterGroup) { g.POST("/add", a.addInbound) g.POST("/del/:id", a.delInbound) g.POST("/update/:id", a.updateInbound) + g.POST("/clientIps/:email", a.getClientIps) + g.POST("/clearClientIps/:email", a.clearClientIps) g.POST("/resetClientTraffic/:email", a.resetClientTraffic) } @@ -122,7 +124,26 @@ func (a *InboundController) updateInbound(c *gin.Context) { a.xrayService.SetToNeedRestart() } } +func (a *InboundController) getClientIps(c *gin.Context) { + email := c.Param("email") + ips , err := a.inboundService.GetInboundClientIps(email) + if err != nil { + jsonObj(c, "No IP Record", nil) + return + } + jsonObj(c, ips, nil) +} +func (a *InboundController) clearClientIps(c *gin.Context) { + email := c.Param("email") + + err := a.inboundService.ClearClientIps(email) + if err != nil { + jsonMsg(c, "修改", err) + return + } + jsonMsg(c, "Log Cleared", nil) +} func (a *InboundController) resetClientTraffic(c *gin.Context) { email := c.Param("email") |
