code refactor
This commit is contained in:
parent
106345ff49
commit
2cd9f50357
|
@ -68,6 +68,10 @@ func (e *AlertCurEvent) GenCardTitle(rules []*AggrRule) string {
|
|||
if rule.Type == "tagkey" {
|
||||
arr[i] = e.GetTagValue(rule.Value)
|
||||
}
|
||||
|
||||
if len(arr[i]) == 0 {
|
||||
arr[i] = "Null"
|
||||
}
|
||||
}
|
||||
return strings.Join(arr, "::")
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package router
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
|
@ -47,9 +46,6 @@ func alertCurEventsCard(c *gin.Context) {
|
|||
list, err := models.AlertCurEventGets(busiGroupId, stime, etime, severity, clusters, query, 10000, 0)
|
||||
ginx.Dangerous(err)
|
||||
|
||||
fmt.Println(">>>> len:", len(list))
|
||||
fmt.Println(">>>> list", list)
|
||||
|
||||
cardCount := make(map[string]int)
|
||||
for _, event := range list {
|
||||
title := event.GenCardTitle(rules)
|
||||
|
@ -63,8 +59,6 @@ func alertCurEventsCard(c *gin.Context) {
|
|||
|
||||
sort.Strings(titles)
|
||||
|
||||
fmt.Println(">>>> titles:", titles)
|
||||
|
||||
cards := make([]AlertCard, len(titles))
|
||||
for i := 0; i < len(titles); i++ {
|
||||
cards[i] = AlertCard{
|
||||
|
|
Loading…
Reference in New Issue