diff --git a/web/assets/js/model/models.js b/web/assets/js/model/models.js index 9a5dcc85..e1a766dc 100644 --- a/web/assets/js/model/models.js +++ b/web/assets/js/model/models.js @@ -168,6 +168,7 @@ class AllSetting { constructor(data) { this.webListen = ""; + this.webDomain = ""; this.webPort = 2053; this.webCertFile = ""; this.webKeyFile = ""; @@ -187,7 +188,7 @@ class AllSetting { this.subEnable = false; this.subListen = ""; this.subPort = "2096"; - this.subPath = "sub/"; + this.subPath = "/sub/"; this.subDomain = ""; this.subCertFile = ""; this.subKeyFile = ""; diff --git a/web/controller/inbound.go b/web/controller/inbound.go index 5ce58d53..815f1788 100644 --- a/web/controller/inbound.go +++ b/web/controller/inbound.go @@ -65,6 +65,7 @@ func (a *InboundController) getInbounds(c *gin.Context) { } jsonObj(c, inbounds, nil) } + func (a *InboundController) getInbound(c *gin.Context) { id, err := strconv.Atoi(c.Param("id")) if err != nil { @@ -168,6 +169,7 @@ func (a *InboundController) clearClientIps(c *gin.Context) { } jsonMsg(c, "Log Cleared", nil) } + func (a *InboundController) addInboundClient(c *gin.Context) { data := &model.Inbound{} err := c.ShouldBind(data) diff --git a/web/entity/entity.go b/web/entity/entity.go index 0bfbfd2a..d5e90108 100644 --- a/web/entity/entity.go +++ b/web/entity/entity.go @@ -28,6 +28,7 @@ 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"` diff --git a/web/global/hashStorage.go b/web/global/hashStorage.go index 9dfea169..5d8135ee 100644 --- a/web/global/hashStorage.go +++ b/web/global/hashStorage.go @@ -18,7 +18,6 @@ type HashStorage struct { sync.RWMutex Data map[string]HashEntry Expiration time.Duration - } func NewHashStorage(expiration time.Duration) *HashStorage { @@ -46,7 +45,6 @@ func (h *HashStorage) SaveHash(query string) string { return md5HashString } - func (h *HashStorage) GetValue(hash string) (string, bool) { h.RLock() defer h.RUnlock() diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html index d78533a1..e7d865f6 100644 --- a/web/html/xui/settings.html +++ b/web/html/xui/settings.html @@ -91,6 +91,7 @@ + @@ -391,9 +392,9 @@ + - diff --git a/web/service/inbound.go b/web/service/inbound.go index 6a182fcf..11522ad2 100644 --- a/web/service/inbound.go +++ b/web/service/inbound.go @@ -1185,6 +1185,7 @@ func (s *InboundService) GetInboundClientIps(clientEmail string) (string, error) } return InboundClientIps.Ips, nil } + func (s *InboundService) ClearClientIps(clientEmail string) error { db := database.GetDB() diff --git a/web/service/setting.go b/web/service/setting.go index 593b23be..677ccbb2 100644 --- a/web/service/setting.go +++ b/web/service/setting.go @@ -24,6 +24,7 @@ var xrayTemplateConfig string var defaultValueMap = map[string]string{ "xrayTemplateConfig": xrayTemplateConfig, "webListen": "", + "webDomain": "", "webPort": "2053", "webCertFile": "", "webKeyFile": "", @@ -44,7 +45,7 @@ var defaultValueMap = map[string]string{ "subEnable": "false", "subListen": "", "subPort": "2096", - "subPath": "sub/", + "subPath": "/sub/", "subDomain": "", "subCertFile": "", "subKeyFile": "", @@ -225,6 +226,10 @@ func (s *SettingService) GetListen() (string, error) { return s.getString("webListen") } +func (s *SettingService) GetWebDomain() (string, error) { + return s.getString("webDomain") +} + func (s *SettingService) GetTgBotToken() (string, error) { return s.getString("tgBotToken") }