更新UI
This commit is contained in:
@@ -72,7 +72,13 @@ type MailConfig struct {
|
||||
}
|
||||
|
||||
type BrandingConfig struct {
|
||||
SiteName string `json:"site_name"`
|
||||
PortalTitle string `json:"portal_title"`
|
||||
PortalSubtitle string `json:"portal_subtitle"`
|
||||
AdminTitle string `json:"admin_title"`
|
||||
AdminSubtitle string `json:"admin_subtitle"`
|
||||
SiteIconURL string `json:"site_icon_url"`
|
||||
LogoURL string `json:"logo_url"`
|
||||
DeveloperAvatarURL string `json:"developer_avatar_url"`
|
||||
DeveloperName string `json:"developer_name"`
|
||||
FeedbackEmail string `json:"feedback_email"`
|
||||
@@ -163,7 +169,13 @@ func defaults(root string) *Config {
|
||||
TimeoutSeconds: 20,
|
||||
},
|
||||
Branding: BrandingConfig{
|
||||
SiteName: "YMhut Box",
|
||||
PortalTitle: "YMhut Box 统一服务门户",
|
||||
PortalSubtitle: "统一发布、反馈与接口源状态门户",
|
||||
AdminTitle: "YMhut 统一管理台",
|
||||
AdminSubtitle: "发布、反馈、接口源与系统运维",
|
||||
SiteIconURL: "/assets/favicon.ico",
|
||||
LogoURL: "/assets/favicon.ico",
|
||||
DeveloperAvatarURL: "/assets/developer-avatar.png",
|
||||
DeveloperName: "YMhut",
|
||||
FeedbackEmail: "support@ymhut.cn",
|
||||
@@ -276,6 +288,24 @@ func applyEnv(cfg *Config) {
|
||||
if value := os.Getenv("YMHUT_BRAND_ICON_URL"); value != "" {
|
||||
cfg.Branding.SiteIconURL = value
|
||||
}
|
||||
if value := os.Getenv("YMHUT_BRAND_SITE_NAME"); value != "" {
|
||||
cfg.Branding.SiteName = value
|
||||
}
|
||||
if value := os.Getenv("YMHUT_BRAND_PORTAL_TITLE"); value != "" {
|
||||
cfg.Branding.PortalTitle = value
|
||||
}
|
||||
if value := os.Getenv("YMHUT_BRAND_PORTAL_SUBTITLE"); value != "" {
|
||||
cfg.Branding.PortalSubtitle = value
|
||||
}
|
||||
if value := os.Getenv("YMHUT_BRAND_ADMIN_TITLE"); value != "" {
|
||||
cfg.Branding.AdminTitle = value
|
||||
}
|
||||
if value := os.Getenv("YMHUT_BRAND_ADMIN_SUBTITLE"); value != "" {
|
||||
cfg.Branding.AdminSubtitle = value
|
||||
}
|
||||
if value := os.Getenv("YMHUT_BRAND_LOGO_URL"); value != "" {
|
||||
cfg.Branding.LogoURL = value
|
||||
}
|
||||
if value := os.Getenv("YMHUT_BRAND_DEVELOPER_AVATAR_URL"); value != "" {
|
||||
cfg.Branding.DeveloperAvatarURL = value
|
||||
}
|
||||
@@ -453,9 +483,27 @@ func normalize(root string, cfg *Config) {
|
||||
if cfg.Mail.TimeoutSeconds <= 0 {
|
||||
cfg.Mail.TimeoutSeconds = 20
|
||||
}
|
||||
if cfg.Branding.SiteName == "" {
|
||||
cfg.Branding.SiteName = "YMhut Box"
|
||||
}
|
||||
if cfg.Branding.PortalTitle == "" {
|
||||
cfg.Branding.PortalTitle = cfg.Branding.SiteName + " 统一服务门户"
|
||||
}
|
||||
if cfg.Branding.PortalSubtitle == "" {
|
||||
cfg.Branding.PortalSubtitle = "统一发布、反馈与接口源状态门户"
|
||||
}
|
||||
if cfg.Branding.AdminTitle == "" {
|
||||
cfg.Branding.AdminTitle = "YMhut 统一管理台"
|
||||
}
|
||||
if cfg.Branding.AdminSubtitle == "" {
|
||||
cfg.Branding.AdminSubtitle = "发布、反馈、接口源与系统运维"
|
||||
}
|
||||
if cfg.Branding.SiteIconURL == "" {
|
||||
cfg.Branding.SiteIconURL = "/assets/favicon.ico"
|
||||
}
|
||||
if cfg.Branding.LogoURL == "" {
|
||||
cfg.Branding.LogoURL = cfg.Branding.SiteIconURL
|
||||
}
|
||||
if cfg.Branding.DeveloperAvatarURL == "" {
|
||||
cfg.Branding.DeveloperAvatarURL = "/assets/developer-avatar.png"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user