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:
authorMHSanaei <ho3ein.sanaei@gmail.com>2024-02-21 13:47:52 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2024-02-21 13:47:52 +0300
commit03b7a3479394f54a2e793f23f35e0f2b8a4b4a6a (patch)
tree72e4bd1e7201f90bc118b8ee0f2bc86d4718bb97 /web/entity
parentf3eb4f055db80372298d60c073870a5af1431785 (diff)
[sub] json + fragment
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
Diffstat (limited to 'web/entity')
-rw-r--r--web/entity/entity.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/web/entity/entity.go b/web/entity/entity.go
index 8ab06399..06850128 100644
--- a/web/entity/entity.go
+++ b/web/entity/entity.go
@@ -48,6 +48,9 @@ type AllSetting struct {
SubEncrypt bool `json:"subEncrypt" form:"subEncrypt"`
SubShowInfo bool `json:"subShowInfo" form:"subShowInfo"`
SubURI string `json:"subURI" form:"subURI"`
+ SubJsonPath string `json:"subJsonPath" form:"subJsonPath"`
+ SubJsonURI string `json:"subJsonURI" form:"subJsonURI"`
+ SubJsonFragment string `json:"subJsonFragment" form:"subJsonFragment"`
Datepicker string `json:"datepicker" form:"datepicker"`
}
@@ -105,6 +108,13 @@ func (s *AllSetting) CheckValid() error {
s.SubPath += "/"
}
+ if !strings.HasPrefix(s.SubJsonPath, "/") {
+ s.SubJsonPath = "/" + s.SubJsonPath
+ }
+ if !strings.HasSuffix(s.SubJsonPath, "/") {
+ s.SubJsonPath += "/"
+ }
+
_, err := time.LoadLocation(s.TimeLocation)
if err != nil {
return common.NewError("time location not exist:", s.TimeLocation)