Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsurbiks <43953720+surbiks@users.noreply.github.com>2024-02-07 10:55:31 +0300
committerGitHub <noreply@github.com>2024-02-07 10:55:31 +0300
commit13de2c6ca0d9101d247a81aa06dddbf338441703 (patch)
treef1310e123568c42425790c33fdc67dd6eedf5b3e /web/controller
parent6cf29d5145bea39f731410e15472606223e0d7c0 (diff)
add outbound traffic reset (#1767)
Diffstat (limited to 'web/controller')
-rw-r--r--web/controller/xray_setting.go11
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)
+}