diff options
Diffstat (limited to 'web/controller/xray_setting.go')
| -rw-r--r-- | web/controller/xray_setting.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/web/controller/xray_setting.go b/web/controller/xray_setting.go index 430cc77b..28f55b54 100644 --- a/web/controller/xray_setting.go +++ b/web/controller/xray_setting.go @@ -29,6 +29,7 @@ func (a *XraySettingController) initRouter(g *gin.RouterGroup) { g.GET("/getDefaultJsonConfig", a.getDefaultXrayConfig) g.POST("/warp/:action", a.warp) g.GET("/getOutboundsTraffic", a.getOutboundsTraffic) + g.POST("/resetOutboundsTraffic", a.resetOutboundsTraffic) } func (a *XraySettingController) getXraySetting(c *gin.Context) { @@ -95,3 +96,13 @@ func (a *XraySettingController) getOutboundsTraffic(c *gin.Context) { } jsonObj(c, outboundsTraffic, nil) } + +func (a *XraySettingController) resetOutboundsTraffic(c *gin.Context) { + tag := c.PostForm("tag") + err := a.OutboundService.ResetOutboundTraffic(tag) + if err != nil { + jsonMsg(c, "Error in reset outbound traffics", err) + return + } + jsonObj(c, "", nil) +} |
