管理界面设置和用户界面设置可以修改时区

This commit is contained in:
刘祥超
2022-03-26 10:23:03 +08:00
parent 68f0b2efc3
commit 4699d1c2ee
7 changed files with 152 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ package userui
import (
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/actions"
"io"
@@ -24,6 +25,15 @@ func (this *IndexAction) RunGet(params struct{}) {
}
this.Data["config"] = config
// 时区
this.Data["timeZoneGroups"] = nodeconfigs.FindAllTimeZoneGroups()
this.Data["timeZoneLocations"] = nodeconfigs.FindAllTimeZoneLocations()
if len(config.TimeZone) == 0 {
config.TimeZone = nodeconfigs.DefaultTimeZoneLocation
}
this.Data["timeZoneLocation"] = nodeconfigs.FindTimeZoneLocation(config.TimeZone)
this.Show()
}
@@ -36,6 +46,7 @@ func (this *IndexAction) RunPost(params struct {
ShowFinance bool
FaviconFile *actions.File
LogoFile *actions.File
TimeZone string
Must *actions.Must
CSRF *actionutils.CSRF
@@ -57,6 +68,7 @@ func (this *IndexAction) RunPost(params struct {
config.ShowVersion = params.ShowVersion
config.Version = params.Version
config.ShowFinance = params.ShowFinance
config.TimeZone = params.TimeZone
// 上传Favicon文件
if params.FaviconFile != nil {