get event message list with default order by updated

This commit is contained in:
liugq 2023-08-29 16:00:44 +08:00
parent df477c1485
commit 74415b97e7
2 changed files with 3 additions and 3 deletions

View File

@ -260,11 +260,11 @@ func (h *AlertAPI) searchAlertMessage(w http.ResponseWriter, req *http.Request,
if sort != "" {
sortParts := strings.Split(sort, ",")
if len(sortParts) == 2 && sortParts[1] != "created" {
if len(sortParts) == 2 && sortParts[1] != "updated" {
sortBuilder.WriteString(fmt.Sprintf(`{"%s":{ "order": "%s"}},`, sortParts[0], sortParts[1]))
}
}
sortBuilder.WriteString(`{"created":{ "order": "desc"}}`)
sortBuilder.WriteString(`{"updated":{ "order": "desc"}}`)
if status != "" {
mustBuilder.WriteString(",")

View File

@ -671,7 +671,7 @@ func (engine *Engine) Do(rule *alerting.Rule) error {
conditionResults := checkResults.ResultItems
var paramsCtx map[string]interface{}
if len(conditionResults) == 0 {
alertItem.Priority = "info"
alertItem.Priority = ""
if checkResults.QueryResult.Nodata {
alertItem.State = alerting.AlertStateNodata
}