update alert severity

This commit is contained in:
liugq 2022-07-11 14:47:23 +08:00
parent 7864a482b7
commit a7cc47ec0b
2 changed files with 6 additions and 4 deletions

View File

@ -71,7 +71,9 @@ type ConditionResultItem struct {
type Severity string
var SeverityWeights = map[string]int{
"warning": 1,
"error": 2,
"critical": 3,
"info": 1,
"low": 2,
"medium": 3,
"high": 4,
"critical": 5,
}

View File

@ -132,7 +132,7 @@ func (h *AlertAPI) getAlertMessageStats(w http.ResponseWriter, req *http.Request
}
}
}
for _, status := range []string{"warning", "error", "critical"} {
for _, status := range []string{"info", "low","medium","high", "critical"} {
if _, ok := statusCounts[status]; !ok {
statusCounts[status] = 0
}