diff --git a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue
index 63af3fe3d..f0f439dc3 100644
--- a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue
+++ b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue
@@ -99,6 +99,16 @@
+
+
+
+
diff --git a/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue b/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue
index fa5b0bcc3..1a863e99c 100644
--- a/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue
+++ b/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue
@@ -54,6 +54,16 @@
{{user.username}}
+
+ {$emit('statusChange', scope.row)}"
+ />
+
{{scope.row[item.prop]}}
-
@@ -70,9 +80,9 @@
- {{$t('overall.edit')}}
- {{$t('overall.delete')}}
- {{$t('overall.duplicate')}}
+ {{$t('overall.edit')}}
+ {{$t('overall.delete')}}
+ {{$t('overall.duplicate')}}
{{$t('overall.silenceAlert')}}
@@ -156,6 +166,12 @@ export default {
prop: 'method',
show: false,
minWidth: 100
+ }, {
+ label: this.$t('config.dc.state'),
+ prop: 'state',
+ show: true,
+ minWidth: 100,
+ sortable: 'custom'
}
]
}
diff --git a/nezha-fronted/src/components/page/alert/alertRule.vue b/nezha-fronted/src/components/page/alert/alertRule.vue
index b56826f70..983522962 100644
--- a/nezha-fronted/src/components/page/alert/alertRule.vue
+++ b/nezha-fronted/src/components/page/alert/alertRule.vue
@@ -49,6 +49,7 @@
@queryMessage="queryMessage"
@reload="getTableData"
@addSilence="addSilence"
+ @statusChange='statusChange'
@selectionChange="selectionChange"
@showBottomBox="(targetTab, object) => { $refs.dataList.showBottomBox(targetTab, object) }">
@@ -179,6 +180,18 @@ export default {
}
})
},
+ statusChange (alertRule) {
+ const params = { ...alertRule, severity: null }
+ this.$put(this.url, params).then(response => {
+ if (response.code === 200) {
+ this.rightBox.show = false
+ this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
+ } else {
+ this.$message.error(response.msg)
+ }
+ this.getTableData()
+ })
+ },
edit (u, copyFlag) {
this.$get(`${this.url}/${u.id}`).then(response => {
if (response.code === 200) {