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:
authormhsanaei <ho3ein.sanaei@gmail.com>2024-07-15 01:21:54 +0300
committermhsanaei <ho3ein.sanaei@gmail.com>2024-07-15 01:21:54 +0300
commitbb9b9100a8c924538f1df9ee5e2843cf1e780a64 (patch)
tree23ac50302407cf02fb96171ddccca845c23cdf8c /web/controller
parent816adfc3ea6ae6474e08fbba6476277e3d99707f (diff)
[warp] enhanced + delete option
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
Diffstat (limited to 'web/controller')
-rw-r--r--web/controller/xray_setting.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/web/controller/xray_setting.go b/web/controller/xray_setting.go
index d0fe9ca3..3391ad3b 100644
--- a/web/controller/xray_setting.go
+++ b/web/controller/xray_setting.go
@@ -12,6 +12,7 @@ type XraySettingController struct {
InboundService service.InboundService
OutboundService service.OutboundService
XrayService service.XrayService
+ WarpService service.WarpService
}
func NewXraySettingController(g *gin.RouterGroup) *XraySettingController {
@@ -72,16 +73,18 @@ func (a *XraySettingController) warp(c *gin.Context) {
var err error
switch action {
case "data":
- resp, err = a.XraySettingService.GetWarp()
+ resp, err = a.WarpService.GetWarpData()
+ case "del":
+ err = a.WarpService.DelWarpData()
case "config":
- resp, err = a.XraySettingService.GetWarpConfig()
+ resp, err = a.WarpService.GetWarpConfig()
case "reg":
skey := c.PostForm("privateKey")
pkey := c.PostForm("publicKey")
- resp, err = a.XraySettingService.RegWarp(skey, pkey)
+ resp, err = a.WarpService.RegWarp(skey, pkey)
case "license":
license := c.PostForm("license")
- resp, err = a.XraySettingService.SetWarpLicense(license)
+ resp, err = a.WarpService.SetWarpLicense(license)
}
jsonObj(c, resp, err)