From 5e47b4e94925c2272a7f0a4cc355cede72c671a4 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Fri, 8 Dec 2023 17:18:51 +0100 Subject: pagination and sub URI support #1300 --- web/entity/entity.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'web/entity') 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 { -- cgit v1.2.3