fix: 修复 alert rule 部分问题
This commit is contained in:
@@ -394,24 +394,17 @@ export default {
|
|||||||
},
|
},
|
||||||
selectAlertRuleMetric (val) {
|
selectAlertRuleMetric (val) {
|
||||||
if (val === 'Metrics') {
|
if (val === 'Metrics') {
|
||||||
// showMetrics 为 true 时,展示 Metrics
|
this.MetricsType = 1 // type = 1
|
||||||
this.showMetrics = true
|
this.showSnmpTrap = true // showSnmptrap 为 true 时显示 expr,thershold,unit
|
||||||
// type = 1
|
this.$refs.alertRuleForm.clearValidate('expr') // 移除from表单的 expr 验证
|
||||||
this.MetricsType = 1
|
|
||||||
// 移除from表单的 expr 验证
|
|
||||||
this.$refs.alertRuleForm.clearValidate('expr')
|
|
||||||
} else if (val === 'Logs') {
|
} else if (val === 'Logs') {
|
||||||
// showMetrics 为 false 时,展示 Logs label
|
this.showMetrics = false // showMetrics 为 false 时,展示 Logs label
|
||||||
this.showMetrics = false
|
this.showSnmpTrap = true // showSnmptrap 为 true 时显示 expr,thershold,unit
|
||||||
// type = 2
|
this.MetricsType = 2 // type = 2
|
||||||
this.MetricsType = 2
|
this.$refs.alertRuleForm.clearValidate('expr') // 移除from表单的 expr 验证
|
||||||
// 移除from表单的 expr 验证
|
|
||||||
this.$refs.alertRuleForm.clearValidate('expr')
|
|
||||||
} else if (val === 'SNMP trap') {
|
} else if (val === 'SNMP trap') {
|
||||||
// showSnmpTrap 为 false 时,展示 OID
|
this.showSnmpTrap = false // showSnmpTrap 为 false 时,展示 OID
|
||||||
this.showSnmpTrap = false
|
this.MetricsType = 3 // type = 3
|
||||||
// type = 3
|
|
||||||
this.MetricsType = 3
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -429,19 +422,18 @@ export default {
|
|||||||
this.editAlertRule = JSON.parse(JSON.stringify(n))
|
this.editAlertRule = JSON.parse(JSON.stringify(n))
|
||||||
if (this.editAlertRule.id || this.editAlertRule.name) {
|
if (this.editAlertRule.id || this.editAlertRule.name) {
|
||||||
this.expressions = [this.editAlertRule.expr]
|
this.expressions = [this.editAlertRule.expr]
|
||||||
// 当 edit 时禁用 type下拉框
|
this.showTypeSelect = true // 当 edit 时禁用 type下拉框
|
||||||
this.showTypeSelect = true
|
|
||||||
if (n.type === 1) {
|
if (n.type === 1) {
|
||||||
this.fromData.status = 'Metrics'
|
this.fromData.status = 'Metrics'
|
||||||
this.MetricsType = 1
|
this.MetricsType = 1 // 默认保存 type
|
||||||
} else if (n.type === 2) {
|
} else if (n.type === 2) {
|
||||||
this.fromData.status = 'Logs'
|
this.fromData.status = 'Logs'
|
||||||
this.MetricsType = 2
|
this.showMetrics = false // showMetrics 为 false 时,展示 Logs label
|
||||||
|
this.MetricsType = 2 // 默认保存 type
|
||||||
} else if (n.type === 3) {
|
} else if (n.type === 3) {
|
||||||
this.fromData.status = 'SNMP trap'
|
this.fromData.status = 'SNMP trap'
|
||||||
// showSnmpTrap 为 false 时,展示 OID
|
this.showSnmpTrap = false // showSnmpTrap 为 false 时,展示 OID
|
||||||
this.showSnmpTrap = false
|
this.MetricsType = 3 // 默认保存 type
|
||||||
this.MetricsType = 3
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user