diff --git a/nezha-fronted/src/components/charts/chart-bar-statistics.vue b/nezha-fronted/src/components/charts/chart-bar-statistics.vue index 325393ee6..03a458296 100644 --- a/nezha-fronted/src/components/charts/chart-bar-statistics.vue +++ b/nezha-fronted/src/components/charts/chart-bar-statistics.vue @@ -21,6 +21,7 @@ + {{chartData.name}} diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index 6a573e676..fc7fdfd65 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -679,7 +679,7 @@ const cn = { type: 'Agent类型' } }, - agent:{ + agent: { name: '名称', type: '类型', createProm: '创建代理服务', @@ -963,7 +963,7 @@ const cn = { } }, assetType: { - name:'名称', + name: '名称', assetType: '资产类型', parent: '父级', pname: '父级', @@ -1060,6 +1060,7 @@ const cn = { severity: '等级', description: '描述', summary: '概要', + notify: '通知', // "通知方式" startAt: '开始时间', endAt: '结束时间', list: { @@ -1107,7 +1108,7 @@ const cn = { } }, silence: { - name:'名称', + name: '名称', silence: '告警静默', create: '创建告警静默', edit: '修改告警静默', @@ -1121,7 +1122,10 @@ const cn = { module: '模块', endpoint: 'endpoint', asset: '资产', - timeError: '结束时间必须大于开始时间' + timeError: '结束时间必须大于开始时间', + state: '状态', + startTime: '开始时间', + upTime: '更新时间' }, P1Rule: 'P1: 万分紧急,可导致业务瘫痪的告警', P2Rule: 'P2: 重要,需要紧急关注的警报,但还没有影响业务', diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index 08ed86b1f..3630cd1c3 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -1079,6 +1079,7 @@ const en = { description: 'Description', // "描述" summary: 'Summary', // "概要" startAt: 'Start time', // "开始时间" + notify: 'Notification', // "通知方式" endAt: 'End time', // "结束时间" list: { // 表头 @@ -1127,7 +1128,7 @@ const en = { }, }, silence: { - name:'Name', + name: 'Name', silence: 'Alert silence', create: 'New alert silence', edit: 'Edit alert silence', @@ -1141,7 +1142,10 @@ const en = { module: 'module', endpoint: 'endpoint', asset: 'asset', - timeError: 'The end time must be greater than the start time' + timeError: 'The end time must be greater than the start time', + state: 'State', + startTime: 'Start time', + upTime: 'Update Time' }, P1Rule: 'P1: Critical, alert that can cause business paralysis', P2Rule: 'P2: Major, alert that requires urgent attention, but does not affect the business yet', diff --git a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue index 89a3e0a61..c171687eb 100644 --- a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue @@ -78,17 +78,18 @@ popper-class="no-style-class" size="small" value-key="userId" + @change="receiverShowChange" > + :value="item.id"> - + @@ -267,7 +268,7 @@ export default { }) }, getUserList () { - this.$get('sys/user/list', { pageNo: 1, pageSize: -1 }).then(response => { + this.$get('sys/user', { pageNo: 1, pageSize: -1 }).then(response => { if (response.code == 200) { this.userData = response.data.list } @@ -289,6 +290,20 @@ export default { this.notifyData = response.data.list } }) + }, + receiverShowChange (val) { + console.log(val) + if (!val.length) { + this.$refs.alertRuleForm.validateField('method') + } + }, + validateNotify (rule, value, callback) { + console.log(value) + if (this.editAlertRule.receiverShow.length && value.length === 0) { + callback(new Error(this.$t('validate.required'))) + } else { + callback() + } } }, mounted () { diff --git a/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue b/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue index 63810ff21..4d342e698 100644 --- a/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue +++ b/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue @@ -38,7 +38,10 @@ {{scope.row[item.prop].name}}