diff --git a/cmd/dashboard/controller/setting.go b/cmd/dashboard/controller/setting.go index b890073..531d64d 100644 --- a/cmd/dashboard/controller/setting.go +++ b/cmd/dashboard/controller/setting.go @@ -2,6 +2,7 @@ package controller import ( "errors" + "strings" "github.com/gin-gonic/gin" @@ -39,6 +40,8 @@ func listConfig(c *gin.Context) (model.SettingResponse, error) { } } + conf.Config.Language = strings.Replace(conf.Config.Language, "_", "-", -1) + return conf, nil } @@ -70,7 +73,9 @@ func updateConfig(c *gin.Context) (any, error) { if !userTemplateValid { return nil, errors.New("invalid user template") } - singleton.Conf.Language = sf.Language + + singleton.Conf.Language = strings.Replace(sf.Language, "-", "_", -1) + singleton.Conf.EnableIPChangeNotification = sf.EnableIPChangeNotification singleton.Conf.EnablePlainIPInNotification = sf.EnablePlainIPInNotification singleton.Conf.Cover = sf.Cover diff --git a/model/config.go b/model/config.go index 4befbb2..6fcda34 100644 --- a/model/config.go +++ b/model/config.go @@ -79,12 +79,11 @@ func (c *Config) Read(path string, frontendTemplates []FrontendTemplate) error { if err != nil { return err } - if c.ListenPort == 0 { c.ListenPort = 8008 } if c.Language == "" { - c.Language = "zh_CN" + c.Language = "en_US" } if c.Location == "" { c.Location = "Asia/Shanghai" diff --git a/service/singleton/frontend-templates.yaml b/service/singleton/frontend-templates.yaml index 45e29a2..2ca4952 100644 --- a/service/singleton/frontend-templates.yaml +++ b/service/singleton/frontend-templates.yaml @@ -2,14 +2,14 @@ name: "OfficialAdmin" repository: "https://github.com/nezhahq/admin-frontend" author: "nezhahq" - version: "v1.1.7" + version: "v1.1.8" isadmin: true isofficial: true - path: "user-dist" name: "Official" repository: "https://github.com/hamster1963/nezha-dash-v1" author: "hamster1963" - version: "v1.2.8" + version: "v1.3.1" isofficial: true - path: "nazhua-dist" name: "Nazhua"