diff --git a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue index fe74149b4..9f85d5978 100644 --- a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue +++ b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue @@ -56,6 +56,8 @@ + + @@ -170,6 +172,11 @@ export default { { prop: 'panel', name: 'Template preview' } ] }, + alertRule: { + alertRule: [ + { prop: 'alertRuleAlertMessage', name: 'Alerts' } + ] + }, dc: { cabinet: [ { prop: 'cabinet', name: this.$t('config.dc.cabinets'), active: true }, diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue index ba9eae76a..8bd0bbd70 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue @@ -294,12 +294,15 @@ export default { delete this.searchLabel.endAt } this.tools.loading = true + console.log(this.obj,123123123123) if (this.from === fromRoute.module) { this.searchLabel.moduleIds = this.obj.id } else if (this.from === fromRoute.endpoint) { this.searchLabel.endpointIds = this.obj.id } else if (this.from === fromRoute.asset) { this.searchLabel.assetIds = this.obj.id + } else if (this.from === fromRoute.alertRule) { + this.searchLabel.ruleIds = this.obj.id } this.$get(this.url, this.searchLabel).then(response => { this.tools.loading = false diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index fc7fdfd65..85ec00914 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -1057,6 +1057,7 @@ const cn = { alertList: '告警信息', alertConfig: '告警规则', alertName: '告警名称', + method: 'Method', severity: '等级', description: '描述', summary: '概要', diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index 3630cd1c3..6cebee967 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -1075,6 +1075,7 @@ const en = { alertMessage: 'Alert message', // "告警信息" alertRule: 'Alert rule', // "告警规则" alertName: 'Name', // "告警名称" + method: 'Method', // "告警名称" severity: 'Priority', // "等级" description: 'Description', // "描述" summary: 'Summary', // "概要" diff --git a/nezha-fronted/src/components/common/rightBox/alertSilenceBox.vue b/nezha-fronted/src/components/common/rightBox/alertSilenceBox.vue index 2715614f7..2adb2daec 100644 --- a/nezha-fronted/src/components/common/rightBox/alertSilenceBox.vue +++ b/nezha-fronted/src/components/common/rightBox/alertSilenceBox.vue @@ -2,7 +2,7 @@
-
{{editAlertSilence.id ? $t("alert.silence.edit") + " ID:" + editAlertSilence.id : $t("alert.silence.create")}}
+
{{editAlertSilence.id ? $t("alert.silence.edit") : $t("alert.silence.create")}}
diff --git a/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue b/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue index 4d342e698..5c826a57e 100644 --- a/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue +++ b/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue @@ -57,7 +57,7 @@ fixed="right">
{{$t('overall.option')}}
- +
@@ -92,6 +92,11 @@ export default { prop: 'name', show: true, sortable: 'custom' + }, + { + label: this.$t('alert.method'), + prop: 'method', + show: true, }, { label: this.$t('alert.config.expr'), prop: 'expr', diff --git a/nezha-fronted/src/components/common/table/alert/alertSilenceTable.vue b/nezha-fronted/src/components/common/table/alert/alertSilenceTable.vue index 2e83fb479..b45163cb7 100644 --- a/nezha-fronted/src/components/common/table/alert/alertSilenceTable.vue +++ b/nezha-fronted/src/components/common/table/alert/alertSilenceTable.vue @@ -121,6 +121,12 @@ export default { show: true, width: 80, sortable: 'custom' + }, + { + label: 'Name', + prop: 'name', + show: true, + width: 150 }, { label: 'Matchers', prop: 'matchers', @@ -138,7 +144,7 @@ export default { show: true, width: 120 }, { - label: 'Reason', + label: this.$t('alert.silence.reason'), prop: 'reason', show: true, width: 120 diff --git a/nezha-fronted/src/components/common/table/settings/endpointTable.vue b/nezha-fronted/src/components/common/table/settings/endpointTable.vue index 05eb5f00e..497af9eec 100644 --- a/nezha-fronted/src/components/common/table/settings/endpointTable.vue +++ b/nezha-fronted/src/components/common/table/settings/endpointTable.vue @@ -49,7 +49,7 @@ diff --git a/nezha-fronted/src/components/page/alert/alertMessage.vue b/nezha-fronted/src/components/page/alert/alertMessage.vue index 8f183578f..d4cc2bfeb 100644 --- a/nezha-fronted/src/components/page/alert/alertMessage.vue +++ b/nezha-fronted/src/components/page/alert/alertMessage.vue @@ -120,22 +120,22 @@ export default { mixins: [dataListMixin], data () { return { - tablist:[ + tablist: [ { - state:'1', - name:'Active' + state: '1', + name: 'Active' }, { - state:'2', - name:'Silebt' + state: '2', + name: 'Silebt' }, { - state:'3', - name:'Expired' + state: '3', + name: 'Expired' } ], - isActive:0, - ind:0, + isActive: 0, + ind: 0, url: 'alert/message', // 导出相关 importBox: { show: false, title: this.$t('overall.exportExcel') }, @@ -376,13 +376,13 @@ export default { } }, getTableData (ind) { - if(ind ==undefined){ - ind=this.ind - }else{ - this.ind =ind + if (ind == undefined) { + ind = this.ind + } else { + this.ind = ind } - const ii =ind+1 - this.isActive=ind + const ii = ind + 1 + this.isActive = ind this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) if (this.searchTime && this.searchTime.length > 1) { @@ -393,11 +393,11 @@ export default { delete this.searchLabel.endAt } this.tools.loading = true - if(ind===0 || ind ===1 || ind ===2){ + if (ind === 0 || ind === 1 || ind === 2) { delete this.searchLabel.startAt delete this.searchLabel.endAt } - this.$get(this.url+'?state='+ii, this.searchLabel).then(response => { + this.$get(this.url + '?state=' + ii, this.searchLabel).then(response => { console.log(this.searchLabel) this.tools.loading = false if (response.code == 200) { @@ -613,7 +613,7 @@ export default { this.$refs.dataTable.$refs.dataTable.bodyWrapper.scrollTop = 0 } this.getTableData() - }, + } } } diff --git a/nezha-fronted/src/components/page/alert/alertRule.vue b/nezha-fronted/src/components/page/alert/alertRule.vue index 241c22339..280d3343d 100644 --- a/nezha-fronted/src/components/page/alert/alertRule.vue +++ b/nezha-fronted/src/components/page/alert/alertRule.vue @@ -119,7 +119,7 @@ export default { if (!this.hasButton('alertMessage_view')) { return } - this.$refs.dataList.showBottomBox('alertMessage', alertRule) + this.$refs.dataList.showBottomBox('alertRuleAlertMessage', alertRule) }, getTableData () { this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) diff --git a/nezha-fronted/static/config.json b/nezha-fronted/static/config.json index 66c3c57ef..0ae1c38e3 100644 --- a/nezha-fronted/static/config.json +++ b/nezha-fronted/static/config.json @@ -1 +1 @@ -{"baseUrl":"http://192.168.40.42:8080/nz-admin/", "version": "1.2.2020.11.10.14.10"} +{"baseUrl":"http://192.168.40.42:8080/nz-admin/", "version": "2.0.2021.05.08.18.07"}