update setting api (#17)
This commit is contained in:
parent
885330e948
commit
a590d3a56e
@ -61,6 +61,7 @@ func updateConfig(c *gin.Context) (any, error) {
|
|||||||
singleton.Conf.DNSServers = sf.CustomNameservers
|
singleton.Conf.DNSServers = sf.CustomNameservers
|
||||||
singleton.Conf.CustomCode = sf.CustomCode
|
singleton.Conf.CustomCode = sf.CustomCode
|
||||||
singleton.Conf.CustomCodeDashboard = sf.CustomCodeDashboard
|
singleton.Conf.CustomCodeDashboard = sf.CustomCodeDashboard
|
||||||
|
singleton.Conf.RealIPHeader = sf.RealIPHeader
|
||||||
|
|
||||||
if err := singleton.Conf.Save(); err != nil {
|
if err := singleton.Conf.Save(); err != nil {
|
||||||
return nil, newGormError("%v", err)
|
return nil, newGormError("%v", err)
|
||||||
|
@ -5,11 +5,12 @@ type SettingForm struct {
|
|||||||
IgnoredIPNotification string `json:"ignored_ip_notification,omitempty" validate:"optional"`
|
IgnoredIPNotification string `json:"ignored_ip_notification,omitempty" validate:"optional"`
|
||||||
IPChangeNotificationGroupID uint64 `json:"ip_change_notification_group_id,omitempty"` // IP变更提醒的通知组
|
IPChangeNotificationGroupID uint64 `json:"ip_change_notification_group_id,omitempty"` // IP变更提醒的通知组
|
||||||
Cover uint8 `json:"cover,omitempty"`
|
Cover uint8 `json:"cover,omitempty"`
|
||||||
SiteName string `json:"site_name,omitempty"`
|
SiteName string `json:"site_name,omitempty" minLength:"1"`
|
||||||
Language string `json:"language,omitempty"`
|
Language string `json:"language,omitempty" minLength:"2"`
|
||||||
InstallHost string `json:"install_host,omitempty" validate:"optional"`
|
InstallHost string `json:"install_host,omitempty" validate:"optional"`
|
||||||
CustomCode string `json:"custom_code,omitempty" validate:"optional"`
|
CustomCode string `json:"custom_code,omitempty" validate:"optional"`
|
||||||
CustomCodeDashboard string `json:"custom_code_dashboard,omitempty" validate:"optional"`
|
CustomCodeDashboard string `json:"custom_code_dashboard,omitempty" validate:"optional"`
|
||||||
|
RealIPHeader string `json:"real_ip_header,omitempty" validate:"optional"` // 真实IP
|
||||||
|
|
||||||
EnableIPChangeNotification bool `json:"enable_ip_change_notification,omitempty" validate:"optional"`
|
EnableIPChangeNotification bool `json:"enable_ip_change_notification,omitempty" validate:"optional"`
|
||||||
EnablePlainIPInNotification bool `json:"enable_plain_ip_in_notification,omitempty" validate:"optional"`
|
EnablePlainIPInNotification bool `json:"enable_plain_ip_in_notification,omitempty" validate:"optional"`
|
||||||
|
Loading…
Reference in New Issue
Block a user