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:
authorSaeid <43953720+surbiks@users.noreply.github.com>2024-01-29 23:37:20 +0300
committerGitHub <noreply@github.com>2024-01-29 23:37:20 +0300
commit6c0775b12055e4546cb0fd86e1d8d569d886eefa (patch)
tree8f7ee64e54f83f9c563a178c4afaee10e072eddc /web/controller
parent9fbaede59f87dd9d8b77479a3fb295c3c882630e (diff)
Show outbound traffic in outbounds table (#1711)
* store outbound traffic in database * show outbound traffic in outbounds table * add refresh button
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 09e9115f..430cc77b 100644
--- a/web/controller/xray_setting.go
+++ b/web/controller/xray_setting.go
@@ -10,6 +10,7 @@ type XraySettingController struct {
XraySettingService service.XraySettingService
SettingService service.SettingService
InboundService service.InboundService
+ OutboundService service.OutboundService
XrayService service.XrayService
}
@@ -27,6 +28,7 @@ func (a *XraySettingController) initRouter(g *gin.RouterGroup) {
g.GET("/getXrayResult", a.getXrayResult)
g.GET("/getDefaultJsonConfig", a.getDefaultXrayConfig)
g.POST("/warp/:action", a.warp)
+ g.GET("/getOutboundsTraffic", a.getOutboundsTraffic)
}
func (a *XraySettingController) getXraySetting(c *gin.Context) {
@@ -84,3 +86,12 @@ func (a *XraySettingController) warp(c *gin.Context) {
jsonObj(c, resp, err)
}
+
+func (a *XraySettingController) getOutboundsTraffic(c *gin.Context) {
+ outboundsTraffic, err := a.OutboundService.GetOutboundsTraffic()
+ if err != nil {
+ jsonMsg(c, "Error getting traffics", err)
+ return
+ }
+ jsonObj(c, outboundsTraffic, nil)
+}