update
This commit is contained in:
1 parent
0690285147
commit
5618cd2738
154 files changed
+5021
-3161
No files matched your search
@@ -15,30 +15,30 @@ import (
|
||||
|
||||
// CreateSilenceRequest 创建静默规则请求
|
||||
type CreateSilenceRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
Description string `json:"description"`
|
||||
RuleIDs []uint `json:"rule_ids"`
|
||||
TargetIDs []uint `json:"target_ids"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
Description string `json:"description"`
|
||||
RuleIDs []uint `json:"rule_ids"`
|
||||
TargetIDs []uint `json:"target_ids"`
|
||||
Matchers []model.AlertSilenceMatcher `json:"matchers"`
|
||||
SilenceType string `json:"silence_type"`
|
||||
StartTime string `json:"start_time"`
|
||||
EndTime string `json:"end_time" binding:"required"`
|
||||
Weekdays []int `json:"weekdays"`
|
||||
Status *int `json:"status"`
|
||||
SilenceType string `json:"silence_type"`
|
||||
StartTime string `json:"start_time"`
|
||||
EndTime string `json:"end_time" binding:"required"`
|
||||
Weekdays []int `json:"weekdays"`
|
||||
Status *int `json:"status"`
|
||||
}
|
||||
|
||||
// UpdateSilenceRequest 更新静默规则请求
|
||||
type UpdateSilenceRequest struct {
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
RuleIDs []uint `json:"rule_ids"`
|
||||
TargetIDs []uint `json:"target_ids"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
RuleIDs []uint `json:"rule_ids"`
|
||||
TargetIDs []uint `json:"target_ids"`
|
||||
Matchers []model.AlertSilenceMatcher `json:"matchers"`
|
||||
SilenceType string `json:"silence_type"`
|
||||
StartTime string `json:"start_time"`
|
||||
EndTime string `json:"end_time"`
|
||||
Weekdays []int `json:"weekdays"`
|
||||
Status *int `json:"status"`
|
||||
SilenceType string `json:"silence_type"`
|
||||
StartTime string `json:"start_time"`
|
||||
EndTime string `json:"end_time"`
|
||||
Weekdays []int `json:"weekdays"`
|
||||
Status *int `json:"status"`
|
||||
}
|
||||
|
||||
// ListSilences GET /alerts/silences
|
||||
@@ -60,11 +60,11 @@ func (h *AlertHandler) ListSilences(c *gin.Context) {
|
||||
// 解析 JSON 字段为前端友好的格式
|
||||
type SilenceWithParsed struct {
|
||||
model.AlertSilence
|
||||
RuleIDList []uint `json:"rule_id_list"`
|
||||
TargetIDList []uint `json:"target_id_list"`
|
||||
MatcherList []model.AlertSilenceMatcher `json:"matcher_list"`
|
||||
WeekdayList []int `json:"weekday_list"`
|
||||
IsActive bool `json:"is_active"`
|
||||
RuleIDList []uint `json:"rule_id_list"`
|
||||
TargetIDList []uint `json:"target_id_list"`
|
||||
MatcherList []model.AlertSilenceMatcher `json:"matcher_list"`
|
||||
WeekdayList []int `json:"weekday_list"`
|
||||
IsActive bool `json:"is_active"`
|
||||
}
|
||||
|
||||
var result []SilenceWithParsed
|
||||
|
||||
Reference in new issue
Block a user