mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
WIP: 补全各模块的通知分组设置
This commit is contained in:
@@ -20,10 +20,11 @@ type CycleTransferStats struct {
|
||||
|
||||
type AlertRule struct {
|
||||
Common
|
||||
Name string
|
||||
RulesRaw string
|
||||
Enable *bool
|
||||
Rules []Rule `gorm:"-" json:"-"`
|
||||
Name string
|
||||
RulesRaw string
|
||||
Enable *bool
|
||||
NotificationTag string // 该报警规则所在的通知组
|
||||
Rules []Rule `gorm:"-" json:"-"`
|
||||
}
|
||||
|
||||
func (r *AlertRule) BeforeSave(tx *gorm.DB) error {
|
||||
|
||||
@@ -71,13 +71,12 @@ type Config struct {
|
||||
ProxyGRPCPort uint
|
||||
TLS bool
|
||||
|
||||
// IP变更提醒
|
||||
EnableIPChangeNotification bool
|
||||
IPChangeNotificationTag string
|
||||
EnablePlainIPInNotification bool
|
||||
|
||||
// IP变更提醒
|
||||
Cover uint8 // 覆盖范围(0:提醒未被 IgnoredIPNotification 包含的所有服务器; 1:仅提醒被 IgnoredIPNotification 包含的服务器;)
|
||||
IgnoredIPNotification string // 特定服务器IP(多个服务器用逗号分隔)
|
||||
Cover uint8 // 覆盖范围(0:提醒未被 IgnoredIPNotification 包含的所有服务器; 1:仅提醒被 IgnoredIPNotification 包含的服务器;)
|
||||
IgnoredIPNotification string // 特定服务器IP(多个服务器用逗号分隔)
|
||||
|
||||
v *viper.Viper
|
||||
IgnoredIPNotificationServerIDs map[uint64]bool // [ServerID] -> bool(值为true代表当前ServerID在特定服务器列表内)
|
||||
|
||||
@@ -38,13 +38,14 @@ const (
|
||||
|
||||
type Monitor struct {
|
||||
Common
|
||||
Name string
|
||||
Type uint8
|
||||
Target string
|
||||
SkipServersRaw string
|
||||
Duration uint64
|
||||
Notify bool
|
||||
Cover uint8
|
||||
Name string
|
||||
Type uint8
|
||||
Target string
|
||||
SkipServersRaw string
|
||||
Duration uint64
|
||||
Notify bool
|
||||
NotificationTag string // 当前服务监控所属的通知组
|
||||
Cover uint8
|
||||
|
||||
SkipServers map[uint64]bool `gorm:"-" json:"-"`
|
||||
CronJobID cron.EntryID `gorm:"-" json:"-"`
|
||||
|
||||
Reference in New Issue
Block a user