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-08 19:18:51 +0300
committerAlireza Ahmadi <alireza7@gmail.com>2023-12-08 19:18:51 +0300
commit5e47b4e94925c2272a7f0a4cc355cede72c671a4 (patch)
tree1cc0b2f5c8cea380b65c6d8bb1294e9c5eeb83a7 /web/entity/entity.go
parent549f230221d7139270efefd76ac81f37e1a747f9 (diff)
pagination and sub URI support #1300
Diffstat (limited to 'web/entity/entity.go')
-rw-r--r--web/entity/entity.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/web/entity/entity.go b/web/entity/entity.go
index 2c7b39ca..94f0171f 100644
--- a/web/entity/entity.go
+++ b/web/entity/entity.go
@@ -22,6 +22,7 @@ type AllSetting struct {
WebKeyFile string `json:"webKeyFile" form:"webKeyFile"`
WebBasePath string `json:"webBasePath" form:"webBasePath"`
SessionMaxAge int `json:"sessionMaxAge" form:"sessionMaxAge"`
+ PageSize int `json:"pageSize" form:"pageSize"`
ExpireDiff int `json:"expireDiff" form:"expireDiff"`
TrafficDiff int `json:"trafficDiff" form:"trafficDiff"`
TgBotEnable bool `json:"tgBotEnable" form:"tgBotEnable"`
@@ -44,6 +45,7 @@ type AllSetting struct {
SubUpdates int `json:"subUpdates" form:"subUpdates"`
SubEncrypt bool `json:"subEncrypt" form:"subEncrypt"`
SubShowInfo bool `json:"subShowInfo" form:"subShowInfo"`
+ SubURI string `json:"subURI" form:"subURI"`
}
func (s *AllSetting) CheckValid() error {
@@ -93,6 +95,12 @@ func (s *AllSetting) CheckValid() error {
if !strings.HasSuffix(s.WebBasePath, "/") {
s.WebBasePath += "/"
}
+ if !strings.HasPrefix(s.SubPath, "/") {
+ s.SubPath = "/" + s.SubPath
+ }
+ if !strings.HasSuffix(s.SubPath, "/") {
+ s.SubPath += "/"
+ }
_, err := time.LoadLocation(s.TimeLocation)
if err != nil {