mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 04:30:05 +00:00
WIP: 通知方式分组 支持将不同的报警|监控|计划任务的通知 发送到指定的通知分组
This commit is contained in:
@@ -72,6 +72,7 @@ type Config struct {
|
||||
TLS bool
|
||||
|
||||
EnableIPChangeNotification bool
|
||||
IPChangeNotificationTag string
|
||||
EnablePlainIPInNotification bool
|
||||
|
||||
// IP变更提醒
|
||||
@@ -102,6 +103,9 @@ func (c *Config) Read(path string) error {
|
||||
if c.GRPCPort == 0 {
|
||||
c.GRPCPort = 5555
|
||||
}
|
||||
if c.EnableIPChangeNotification && c.IPChangeNotificationTag == "" {
|
||||
c.IPChangeNotificationTag = "default"
|
||||
}
|
||||
|
||||
c.updateIgnoredIPNotificationID()
|
||||
return nil
|
||||
|
||||
@@ -15,14 +15,15 @@ const (
|
||||
|
||||
type Cron struct {
|
||||
Common
|
||||
Name string
|
||||
Scheduler string //分钟 小时 天 月 星期
|
||||
Command string
|
||||
Servers []uint64 `gorm:"-"`
|
||||
PushSuccessful bool // 推送成功的通知
|
||||
LastExecutedAt time.Time // 最后一次执行时间
|
||||
LastResult bool // 最后一次执行结果
|
||||
Cover uint8 // 计划任务覆盖范围 (0:仅覆盖特定服务器 1:仅忽略特定服务器)
|
||||
Name string
|
||||
Scheduler string //分钟 小时 天 月 星期
|
||||
Command string
|
||||
Servers []uint64 `gorm:"-"`
|
||||
PushSuccessful bool // 推送成功的通知
|
||||
NotificationTag string // 指定通知方式的分组
|
||||
LastExecutedAt time.Time // 最后一次执行时间
|
||||
LastResult bool // 最后一次执行结果
|
||||
Cover uint8 // 计划任务覆盖范围 (0:仅覆盖特定服务器 1:仅忽略特定服务器)
|
||||
|
||||
CronJobID cron.EntryID `gorm:"-"`
|
||||
ServersRaw string
|
||||
|
||||
@@ -28,6 +28,7 @@ const (
|
||||
type Notification struct {
|
||||
Common
|
||||
Name string
|
||||
Tag string // 分组名
|
||||
URL string
|
||||
RequestMethod int
|
||||
RequestType int
|
||||
|
||||
Reference in New Issue
Block a user