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:
authorAlireza Ahmadi <alireza7@gmail.com>2023-12-04 21:20:46 +0300
committerAlireza Ahmadi <alireza7@gmail.com>2023-12-04 21:20:46 +0300
commit2a8da2ba3cbfbf7ac46e5ba7ba071588f3f2d8b5 (patch)
treee1afd8fc1521abb72bc74256c4540ad1fcce8f51 /web/entity
parenta8b7063647c055988f3768a35af59ca391928b9b (diff)
separate xray page #1286
Diffstat (limited to 'web/entity')
-rw-r--r--web/entity/entity.go69
1 files changed, 30 insertions, 39 deletions
diff --git a/web/entity/entity.go b/web/entity/entity.go
index 1428abe0..1c90305e 100644
--- a/web/entity/entity.go
+++ b/web/entity/entity.go
@@ -2,12 +2,10 @@ package entity
import (
"crypto/tls"
- "encoding/json"
"net"
"strings"
"time"
"x-ui/util/common"
- "x-ui/xray"
)
type Msg struct {
@@ -27,36 +25,35 @@ type Pager struct {
}
type AllSetting struct {
- WebListen string `json:"webListen" form:"webListen"`
- WebDomain string `json:"webDomain" form:"webDomain"`
- WebPort int `json:"webPort" form:"webPort"`
- WebCertFile string `json:"webCertFile" form:"webCertFile"`
- WebKeyFile string `json:"webKeyFile" form:"webKeyFile"`
- WebBasePath string `json:"webBasePath" form:"webBasePath"`
- SessionMaxAge int `json:"sessionMaxAge" form:"sessionMaxAge"`
- ExpireDiff int `json:"expireDiff" form:"expireDiff"`
- TrafficDiff int `json:"trafficDiff" form:"trafficDiff"`
- TgBotEnable bool `json:"tgBotEnable" form:"tgBotEnable"`
- TgBotToken string `json:"tgBotToken" form:"tgBotToken"`
- TgBotChatId string `json:"tgBotChatId" form:"tgBotChatId"`
- TgRunTime string `json:"tgRunTime" form:"tgRunTime"`
- TgBotBackup bool `json:"tgBotBackup" form:"tgBotBackup"`
- TgBotLoginNotify bool `json:"tgBotLoginNotify" form:"tgBotLoginNotify"`
- TgCpu int `json:"tgCpu" form:"tgCpu"`
- TgLang string `json:"tgLang" form:"tgLang"`
- XrayTemplateConfig string `json:"xrayTemplateConfig" form:"xrayTemplateConfig"`
- TimeLocation string `json:"timeLocation" form:"timeLocation"`
- SecretEnable bool `json:"secretEnable" form:"secretEnable"`
- SubEnable bool `json:"subEnable" form:"subEnable"`
- SubListen string `json:"subListen" form:"subListen"`
- SubPort int `json:"subPort" form:"subPort"`
- SubPath string `json:"subPath" form:"subPath"`
- SubDomain string `json:"subDomain" form:"subDomain"`
- SubCertFile string `json:"subCertFile" form:"subCertFile"`
- SubKeyFile string `json:"subKeyFile" form:"subKeyFile"`
- SubUpdates int `json:"subUpdates" form:"subUpdates"`
- SubEncrypt bool `json:"subEncrypt" form:"subEncrypt"`
- SubShowInfo bool `json:"subShowInfo" form:"subShowInfo"`
+ WebListen string `json:"webListen" form:"webListen"`
+ WebDomain string `json:"webDomain" form:"webDomain"`
+ WebPort int `json:"webPort" form:"webPort"`
+ WebCertFile string `json:"webCertFile" form:"webCertFile"`
+ WebKeyFile string `json:"webKeyFile" form:"webKeyFile"`
+ WebBasePath string `json:"webBasePath" form:"webBasePath"`
+ SessionMaxAge int `json:"sessionMaxAge" form:"sessionMaxAge"`
+ ExpireDiff int `json:"expireDiff" form:"expireDiff"`
+ TrafficDiff int `json:"trafficDiff" form:"trafficDiff"`
+ TgBotEnable bool `json:"tgBotEnable" form:"tgBotEnable"`
+ TgBotToken string `json:"tgBotToken" form:"tgBotToken"`
+ TgBotChatId string `json:"tgBotChatId" form:"tgBotChatId"`
+ TgRunTime string `json:"tgRunTime" form:"tgRunTime"`
+ TgBotBackup bool `json:"tgBotBackup" form:"tgBotBackup"`
+ TgBotLoginNotify bool `json:"tgBotLoginNotify" form:"tgBotLoginNotify"`
+ TgCpu int `json:"tgCpu" form:"tgCpu"`
+ TgLang string `json:"tgLang" form:"tgLang"`
+ TimeLocation string `json:"timeLocation" form:"timeLocation"`
+ SecretEnable bool `json:"secretEnable" form:"secretEnable"`
+ SubEnable bool `json:"subEnable" form:"subEnable"`
+ SubListen string `json:"subListen" form:"subListen"`
+ SubPort int `json:"subPort" form:"subPort"`
+ SubPath string `json:"subPath" form:"subPath"`
+ SubDomain string `json:"subDomain" form:"subDomain"`
+ SubCertFile string `json:"subCertFile" form:"subCertFile"`
+ SubKeyFile string `json:"subKeyFile" form:"subKeyFile"`
+ SubUpdates int `json:"subUpdates" form:"subUpdates"`
+ SubEncrypt bool `json:"subEncrypt" form:"subEncrypt"`
+ SubShowInfo bool `json:"subShowInfo" form:"subShowInfo"`
}
func (s *AllSetting) CheckValid() error {
@@ -107,13 +104,7 @@ func (s *AllSetting) CheckValid() error {
s.WebBasePath += "/"
}
- xrayConfig := &xray.Config{}
- err := json.Unmarshal([]byte(s.XrayTemplateConfig), xrayConfig)
- if err != nil {
- return common.NewError("xray template config invalid:", err)
- }
-
- _, err = time.LoadLocation(s.TimeLocation)
+ _, err := time.LoadLocation(s.TimeLocation)
if err != nil {
return common.NewError("time location not exist:", s.TimeLocation)
}