format min, max to adapter frontend

This commit is contained in:
liugq 2023-08-09 19:06:08 +08:00
parent 60210619ca
commit ba99e26a3a
1 changed files with 6 additions and 0 deletions

View File

@ -937,6 +937,12 @@ func newParameterCtx(rule *alerting.Rule, checkResults *alerting.ConditionResult
if checkResults.QueryResult != nil {
min = checkResults.QueryResult.Min
max = checkResults.QueryResult.Max
if v, ok := min.(int64); ok {
min = time.Unix(v/1000, v%1000 * 1e5).UTC().Format("2006-01-02T15:04:05.999Z")
}
if v, ok := max.(int64); ok {
max = time.Unix(v/1000, v%1000 * 1e5).UTC().Format("2006-01-02T15:04:05.999Z")
}
}
paramsCtx := util.MapStr{
alerting2.ParamRuleID: rule.ID,