7745e7a2d4
build-winui / winui (push) Waiting to run
新增数据库同步 Job API、持久化状态、实时输出、最新任务恢复,以及系统日志聚合接口。 管理端优化:日志中心、运维实时状态框、同步输出自动滚动、仪表盘“输出”列、真实延迟空态、本地 favicon/avatar。 新增 server/unified-management/assets/favicon.ico 和 developer-avatar.png,并接好 /favicon.ico、/admin/favicon.ico、/setup/favicon.ico、/assets/*。 WinUI 随机放映室卡片优先显示子接口原始 Description。 Inno 安装器输出框改为选区末尾 + SendMessage 滚动到底部。
49 lines
1.5 KiB
Go
49 lines
1.5 KiB
Go
package config
|
|
|
|
import "strings"
|
|
|
|
type SafeBrandingConfig struct {
|
|
SiteIconURL string `json:"siteIconUrl"`
|
|
DeveloperAvatarURL string `json:"developerAvatarUrl"`
|
|
DeveloperName string `json:"developerName"`
|
|
FeedbackEmail string `json:"feedbackEmail"`
|
|
}
|
|
|
|
func SafeBranding(cfg BrandingConfig) SafeBrandingConfig {
|
|
return SafeBrandingConfig{
|
|
SiteIconURL: strings.TrimSpace(cfg.SiteIconURL),
|
|
DeveloperAvatarURL: strings.TrimSpace(cfg.DeveloperAvatarURL),
|
|
DeveloperName: strings.TrimSpace(firstNonEmpty(cfg.DeveloperName, "YMhut")),
|
|
FeedbackEmail: strings.TrimSpace(firstNonEmpty(cfg.FeedbackEmail, "support@ymhut.cn")),
|
|
}
|
|
}
|
|
|
|
func NormalizeBranding(current BrandingConfig, incoming BrandingConfig) BrandingConfig {
|
|
next := current
|
|
if value := strings.TrimSpace(incoming.SiteIconURL); value != "" {
|
|
next.SiteIconURL = value
|
|
}
|
|
if value := strings.TrimSpace(incoming.DeveloperAvatarURL); value != "" {
|
|
next.DeveloperAvatarURL = value
|
|
}
|
|
if value := strings.TrimSpace(incoming.DeveloperName); value != "" {
|
|
next.DeveloperName = value
|
|
}
|
|
if value := strings.TrimSpace(incoming.FeedbackEmail); value != "" {
|
|
next.FeedbackEmail = value
|
|
}
|
|
if next.SiteIconURL == "" {
|
|
next.SiteIconURL = "/assets/favicon.ico"
|
|
}
|
|
if next.DeveloperAvatarURL == "" {
|
|
next.DeveloperAvatarURL = "/assets/developer-avatar.png"
|
|
}
|
|
if next.DeveloperName == "" {
|
|
next.DeveloperName = "YMhut"
|
|
}
|
|
if next.FeedbackEmail == "" {
|
|
next.FeedbackEmail = "support@ymhut.cn"
|
|
}
|
|
return next
|
|
}
|