From b749bb6fc349dc939e3ec0cacf33fb68aa96af28 Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Thu, 9 Sep 2021 10:32:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=20alertRuleBox=20?= =?UTF-8?q?type=20=E4=B8=8B=E6=8B=89=E9=80=89=E6=8B=A9=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/table/settings/profileTable.vue | 67 ------------------- 1 file changed, 67 deletions(-) delete mode 100644 nezha-fronted/src/components/common/table/settings/profileTable.vue diff --git a/nezha-fronted/src/components/common/table/settings/profileTable.vue b/nezha-fronted/src/components/common/table/settings/profileTable.vue deleted file mode 100644 index e4272f88d..000000000 --- a/nezha-fronted/src/components/common/table/settings/profileTable.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - From e8935693ab6fad0dd0ac18c2e7b2d4b5c953551c Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Thu, 9 Sep 2021 10:33:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/rightBox/alertRuleBox.vue | 37 ++++++++----------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue index 0b793f473..8bfca974c 100644 --- a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue @@ -20,7 +20,7 @@ { if (valid) { @@ -574,19 +571,18 @@ export default { } }, selectAlertRuleMetric (val) { - if (val === 'Metrics') { - this.MetricsType = 1 // type = 1 + if (val === 1) { this.showMetrics = true - this.showSnmpTrap = true // showSnmptrap 为 true 时显示 expr,threshold,unit + this.showSnmpTrap = true // showSnmpTrap 为 true 时显示 expr,threshold,unit this.$refs.alertRuleForm.clearValidate('expr') // 移除from表单的 expr 验证 - } else if (val === 'Logs') { + } else if (val === 2) { this.showMetrics = false // showMetrics 为 false 时,展示 Logs label - this.showSnmpTrap = true // showSnmptrap 为 true 时显示 expr,threshold,unit - this.MetricsType = 2 // type = 2 + this.showSnmpTrap = true // showSnmpTrap 为 true 时显示 expr,threshold,unit + // this.editAlertRule.type = 2 this.$refs.alertRuleForm.clearValidate('expr') // 移除from表单的 expr 验证 - } else if (val === 'SNMP trap') { + } else if (val === 3) { this.showSnmpTrap = false // showSnmpTrap 为 false 时,展示 OID - this.MetricsType = 3 // type = 3 + // this.editAlertRule.type = 3 } }, afterInitRich () { @@ -609,16 +605,13 @@ export default { this.expressions = [this.editAlertRule.expr] this.showTypeSelect = true // 当 edit 时禁用 type下拉框 if (n.type === 1) { - this.fromData.status = 'Metrics' - this.MetricsType = 1 // 默认保存 type + this.editAlertRule.type = 1 } else if (n.type === 2) { - this.fromData.status = 'Logs' this.showMetrics = false // showMetrics 为 false 时,展示 Logs label - this.MetricsType = 2 // 默认保存 type + this.editAlertRule.type = 2 } else if (n.type === 3) { - this.fromData.status = 'SNMP trap' this.showSnmpTrap = false // showSnmpTrap 为 false 时,展示 OID - this.MetricsType = 3 // 默认保存 type + this.editAlertRule.type = 3 return } this.$nextTick(() => {