[xray] easy routing rules

This commit is contained in:
Alireza Ahmadi
2023-11-20 22:49:25 +01:00
parent 878e5507e6
commit 54197993db
8 changed files with 582 additions and 51 deletions

View File

@@ -9,6 +9,7 @@ import (
type XraySettingController struct {
XraySettingService service.XraySettingService
SettingService service.SettingService
InboundService service.InboundService
}
func NewXraySettingController(g *gin.RouterGroup) *XraySettingController {
@@ -31,7 +32,13 @@ func (a *XraySettingController) getXraySetting(c *gin.Context) {
jsonMsg(c, I18nWeb(c, "pages.settings.toasts.getSettings"), err)
return
}
jsonObj(c, xraySetting, nil)
inboundTags, err := a.InboundService.GetInboundTags()
if err != nil {
jsonMsg(c, I18nWeb(c, "pages.settings.toasts.getSettings"), err)
return
}
xrayResponse := "{ \"xraySetting\": " + xraySetting + ", \"inboundTags\": " + inboundTags + " }"
jsonObj(c, xrayResponse, nil)
}
func (a *XraySettingController) updateSetting(c *gin.Context) {