From 13de2c6ca0d9101d247a81aa06dddbf338441703 Mon Sep 17 00:00:00 2001 From: surbiks <43953720+surbiks@users.noreply.github.com> Date: Wed, 7 Feb 2024 11:25:31 +0330 Subject: add outbound traffic reset (#1767) --- web/controller/xray_setting.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'web/controller') 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) +} -- cgit v1.2.3