diff --git a/cmd/dashboard/controller/setting.go b/cmd/dashboard/controller/setting.go index 4fd8906..f6588f1 100644 --- a/cmd/dashboard/controller/setting.go +++ b/cmd/dashboard/controller/setting.go @@ -107,6 +107,11 @@ func updateConfig(c *gin.Context) (any, error) { singleton.Conf.AgentRealIPHeader = sf.AgentRealIPHeader singleton.Conf.AgentTLS = sf.AgentTLS singleton.Conf.UserTemplate = sf.UserTemplate + singleton.Conf.CustomLogo = sf.CustomLogo + singleton.Conf.CustomDescription = sf.CustomDescription + singleton.Conf.CustomLinks = sf.CustomLinks + singleton.Conf.BackgroundImageDay = sf.BackgroundImageDay + singleton.Conf.BackgroundImageNight = sf.BackgroundImageNight if err := singleton.Conf.Save(); err != nil { return nil, newGormError("%v", err) diff --git a/model/config.go b/model/config.go index 9e54931..0f9bc84 100644 --- a/model/config.go +++ b/model/config.go @@ -26,6 +26,11 @@ type ConfigForGuests struct { SiteName string `koanf:"site_name" json:"site_name"` CustomCode string `koanf:"custom_code" json:"custom_code,omitempty"` CustomCodeDashboard string `koanf:"custom_code_dashboard" json:"custom_code_dashboard,omitempty"` + CustomLogo string `koanf:"custom_logo" json:"custom_logo,omitempty"` + CustomDescription string `koanf:"custom_description" json:"custom_description,omitempty"` + CustomLinks string `koanf:"custom_links" json:"custom_links,omitempty"` + BackgroundImageDay string `koanf:"background_image_day" json:"background_image_day,omitempty"` + BackgroundImageNight string `koanf:"background_image_night" json:"background_image_night,omitempty"` } type ConfigDashboard struct { diff --git a/model/setting_api.go b/model/setting_api.go index d9ef7d9..f3b849f 100644 --- a/model/setting_api.go +++ b/model/setting_api.go @@ -13,6 +13,11 @@ type SettingForm struct { WebRealIPHeader string `json:"web_real_ip_header,omitempty" validate:"optional"` // 前端真实IP AgentRealIPHeader string `json:"agent_real_ip_header,omitempty" validate:"optional"` // Agent真实IP UserTemplate string `json:"user_template,omitempty" validate:"optional"` + CustomLogo string `json:"custom_logo,omitempty" validate:"optional"` + CustomDescription string `json:"custom_description,omitempty" validate:"optional"` + CustomLinks string `json:"custom_links,omitempty" validate:"optional"` + BackgroundImageDay string `json:"background_image_day,omitempty" validate:"optional"` + BackgroundImageNight string `json:"background_image_night,omitempty" validate:"optional"` AgentTLS bool `json:"tls,omitempty" validate:"optional"` EnableIPChangeNotification bool `json:"enable_ip_change_notification,omitempty" validate:"optional"`