mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-09-20 18:20:12 +00:00
feat(service): replace EnableShowInService with HideForGuest
Mirror the server HideForGuest flag on services: rename the field (dropping the gorm default), invert userCanViewService so a service is visible to guests by default and hidden only when HideForGuest is set, and flip the public-stats filter in servicesentinel accordingly. Update the visibility and permission-matrix tests to the new semantics.
This commit is contained in:
+1
-1
@@ -216,7 +216,7 @@ type Service struct {
|
||||
Cover uint8 `json:"cover"`
|
||||
|
||||
EnableTriggerTask bool `gorm:"default: false" json:"enable_trigger_task,omitempty"`
|
||||
EnableShowInService bool `gorm:"default: false" json:"enable_show_in_service,omitempty"`
|
||||
HideForGuest bool `json:"hide_for_guest,omitempty"` // 对游客隐藏
|
||||
FailTriggerTasksRaw string `gorm:"default:'[]'" json:"-"`
|
||||
RecoverTriggerTasksRaw string `gorm:"default:'[]'" json:"-"`
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ type ServiceForm struct {
|
||||
MaxLatency float32 `json:"max_latency,omitempty" default:"0.0"`
|
||||
LatencyNotify bool `json:"latency_notify,omitempty" validate:"optional"`
|
||||
EnableTriggerTask bool `json:"enable_trigger_task,omitempty" validate:"optional"`
|
||||
EnableShowInService bool `json:"enable_show_in_service,omitempty" validate:"optional"`
|
||||
HideForGuest bool `json:"hide_for_guest,omitempty" validate:"optional"`
|
||||
FailTriggerTasks []uint64 `json:"fail_trigger_tasks,omitempty"`
|
||||
RecoverTriggerTasks []uint64 `json:"recover_trigger_tasks,omitempty"`
|
||||
SkipServers map[uint64]bool `json:"skip_servers,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user