From 48a5733be0aae579e95bea32b95b0e09e920cd52 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Thu, 22 Sep 2022 17:07:22 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-2221=20=20=20fix:=20alert=20rule=20quick=20?= =?UTF-8?q?silence=20=E9=85=8D=E7=BD=AE=E4=BF=A1=E6=81=AF=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/common/mixin/dataList.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nezha-fronted/src/components/common/mixin/dataList.js b/nezha-fronted/src/components/common/mixin/dataList.js index 5701d3552..241ec4bcd 100644 --- a/nezha-fronted/src/components/common/mixin/dataList.js +++ b/nezha-fronted/src/components/common/mixin/dataList.js @@ -308,7 +308,7 @@ export default { let labels = this.$loadsh.cloneDeep(row.labels) if (typeof labels === 'string') labels = JSON.parse(labels) this.objectSilence.matchers = [] - const filterArr = ['alertname', 'severity_id', 'severity', 'rule_type', 'nz_agent_id'] + const filterArr = ['alertname', 'severity_id', 'severity', 'rule_type', 'nz_agent_id', 'rule_id', 'rule_name'] Object.keys(labels).forEach((key, i) => { if (filterArr.indexOf(key) != -1) { return @@ -319,7 +319,8 @@ export default { }) } else if (type === 'alertRule') { this.objectSilence.matchers = [ - { name: 'alertName', value: row.name, regex: 0 } + { name: 'rule_id', value: row.id, regex: 0 }, + { name: 'rule_name', value: row.name, regex: 0 } ] } this.silenceBoxShow = true