NEZ-1257 fix: 去除表达是所有空白字符

This commit is contained in:
zhangyu
2021-11-17 11:29:18 +08:00
parent 02802062fd
commit f9ca30d92f
3 changed files with 3 additions and 3 deletions

View File

@@ -426,7 +426,7 @@ export default {
},
promQueryParamConvert (alert) {
const obj = { ...alert }
let r = '(' + obj.alertRule.expr.replace(/\"/g, '\'') + ')'
let r = '(' + obj.alertRule.expr.replace(/\"/g, '\'').replace(/\s+/g, '') + ')'
let intoLabels = false
obj.labels = JSON.parse(obj.labels)
if (Object.keys(obj.labels).length > 0) {