Browse Source

Add tgLang option

Hamidreza Ghavami 1 year ago
parent
commit
4831c2f1b2

+ 1 - 0
web/assets/js/model/models.js

@@ -181,6 +181,7 @@ class AllSetting {
         this.tgRunTime = "@daily";
         this.tgRunTime = "@daily";
         this.tgBotBackup = false;
         this.tgBotBackup = false;
         this.tgCpu = "";
         this.tgCpu = "";
+        this.tgLang = "";
         this.xrayTemplateConfig = "";
         this.xrayTemplateConfig = "";
         this.secretEnable = false;
         this.secretEnable = false;
 
 

+ 1 - 0
web/entity/entity.go

@@ -41,6 +41,7 @@ type AllSetting struct {
 	TgRunTime          string `json:"tgRunTime" form:"tgRunTime"`
 	TgRunTime          string `json:"tgRunTime" form:"tgRunTime"`
 	TgBotBackup        bool   `json:"tgBotBackup" form:"tgBotBackup"`
 	TgBotBackup        bool   `json:"tgBotBackup" form:"tgBotBackup"`
 	TgCpu              int    `json:"tgCpu" form:"tgCpu"`
 	TgCpu              int    `json:"tgCpu" form:"tgCpu"`
+	TgLang             string `json:"tgLang" form:"tgLang"`
 	XrayTemplateConfig string `json:"xrayTemplateConfig" form:"xrayTemplateConfig"`
 	XrayTemplateConfig string `json:"xrayTemplateConfig" form:"xrayTemplateConfig"`
 	TimeLocation       string `json:"timeLocation" form:"timeLocation"`
 	TimeLocation       string `json:"timeLocation" form:"timeLocation"`
 	SecretEnable       bool   `json:"secretEnable" form:"secretEnable"`
 	SecretEnable       bool   `json:"secretEnable" form:"secretEnable"`

+ 0 - 0
web/network/autp_https_conn.go → web/network/auto_https_conn.go


+ 5 - 0
web/service/setting.go

@@ -39,6 +39,7 @@ var defaultValueMap = map[string]string{
 	"tgRunTime":          "@daily",
 	"tgRunTime":          "@daily",
 	"tgBotBackup":        "false",
 	"tgBotBackup":        "false",
 	"tgCpu":              "0",
 	"tgCpu":              "0",
+	"tgLang":             "en-US",
 	"secretEnable":       "false",
 	"secretEnable":       "false",
 }
 }
 
 
@@ -256,6 +257,10 @@ func (s *SettingService) GetTgCpu() (int, error) {
 	return s.getInt("tgCpu")
 	return s.getInt("tgCpu")
 }
 }
 
 
+func (s *SettingService) GetTgLang() (string, error) {
+	return s.getString("tgLang")
+}
+
 func (s *SettingService) GetPort() (int, error) {
 func (s *SettingService) GetPort() (int, error) {
 	return s.getInt("webPort")
 	return s.getInt("webPort")
 }
 }