mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
update ws & settings api (#547)
This commit is contained in:
@@ -127,6 +127,21 @@ func (h *Host) PB() *pb.Host {
|
||||
}
|
||||
}
|
||||
|
||||
// Filter returns a new instance of Host with some fields redacted.
|
||||
func (h *Host) Filter() *Host {
|
||||
return &Host{
|
||||
Platform: h.Platform,
|
||||
CPU: h.CPU,
|
||||
MemTotal: h.MemTotal,
|
||||
DiskTotal: h.DiskTotal,
|
||||
SwapTotal: h.SwapTotal,
|
||||
Arch: h.Arch,
|
||||
Virtualization: h.Virtualization,
|
||||
BootTime: h.BootTime,
|
||||
GPU: h.GPU,
|
||||
}
|
||||
}
|
||||
|
||||
func PB2Host(h *pb.Host) Host {
|
||||
return Host{
|
||||
Platform: h.GetPlatform(),
|
||||
|
||||
@@ -12,6 +12,13 @@ type SettingForm struct {
|
||||
CustomCodeDashboard string `json:"custom_code_dashboard,omitempty" validate:"optional"`
|
||||
RealIPHeader string `json:"real_ip_header,omitempty" validate:"optional"` // 真实IP
|
||||
|
||||
TLS bool `json:"tls,omitempty" validate:"optional"`
|
||||
EnableIPChangeNotification bool `json:"enable_ip_change_notification,omitempty" validate:"optional"`
|
||||
EnablePlainIPInNotification bool `json:"enable_plain_ip_in_notification,omitempty" validate:"optional"`
|
||||
}
|
||||
|
||||
type SettingResponse struct {
|
||||
Config
|
||||
|
||||
Version string `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user