diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index cf019f37e..c110a1f31 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -103,7 +103,7 @@ const cn = { exportExcelLower: '导出', rollbackImport: '回滚', exportCur: '当前页', - exportAll: '总计', + exportAll: '全部', importFile: '请上传文件', importTip: '只允许xlsx/xls格式文件', importTipImg: '只允许jpg/png格式文件', @@ -1286,7 +1286,16 @@ const cn = { alertRuleInfo: '告警规则', alertNumTrend: '告警数量趋势', affectEntity: '影响' - } + }, + timeout: 'Timeout', + inr: 'Evaluation interval', + autoExpired: 'Automatic expired', + state: '状态', + schedEnable: 'Schedule', + schedDays: 'Effective time', + notifyActive: 'Active Notification', + notifyExpired: 'Expired notification', + trbShot: 'Trouble shooting' }, silence: { name: '名称', @@ -1797,6 +1806,15 @@ const cn = { source: '来源', twoFactorAuthentication: '双因子认证' }, + week:{ + Mon: '周一', + Tue: '周二', + Wed: '周三', + Thu: '周四', + Fri: '周五', + Sat: '周六', + Sun: '周日' + }, ...zhLocale } diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index 336d0c302..2375178ec 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -1289,7 +1289,16 @@ const en = { alertRuleInfo: 'Alert rule information', alertNumTrend: 'Alert num trend', affectEntity: 'Affect entity' - } + }, + timeout: 'Timeout', + inr: 'Evaluation interval ', + autoExpired: 'Automatic expired', + state: 'State', + schedEnable: 'Schedule', + schedDays: 'Effective time', + notifyActive: 'Active Notification', + notifyExpired: 'Expired notification', + trbShot: 'Trouble shooting' }, silence: { name: 'Name', @@ -1679,6 +1688,15 @@ const en = { source: 'Source', twoFactorAuthentication: 'Two-Factor Authentication' }, + week: { + Mon: 'Monday', + Tue: 'Tuesday', + Wed: 'Wednesday', + Thu: 'Thursday', + Fri: 'Friday', + Sat: 'Saturday', + Sun: 'Sunday' + }, ...enLocale } diff --git a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue index d88cb41c7..50de4dc1f 100644 --- a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue @@ -15,9 +15,10 @@ - + - + + + + + + + + {{item.name}} + + + + + + {{scope.row[item.prop]}} @@ -184,6 +197,30 @@ export default { minWidth: 100, sortable: 'custom' } + ], + weekList: [ + { + value: 1, + label: this.$t('week.Sun') + }, { + value: 2, + label: this.$t('week.Mon') + }, { + value: 3, + label: this.$t('week.Tue') + }, { + value: 4, + label: this.$t('week.Wed') + }, { + value: 5, + label: this.$t('week.Thu') + }, { + value: 6, + label: this.$t('week.Fri') + }, { + value: 7, + label: this.$t('week.Sat') + } ] } }, @@ -198,6 +235,18 @@ export default { } else { return value } + }, + weekStr (weekstr) { + const arr = weekstr.split(',') + let str = '' + arr.forEach((item, index) => { + if (index === arr.length - 1) { + str += this.weekList[item - 1].label + } else { + str += this.weekList[item - 1].label + ', ' + } + }) + return str } } } diff --git a/nezha-fronted/src/components/page/alert/alertRule.vue b/nezha-fronted/src/components/page/alert/alertRule.vue index ef548be6a..84617c45c 100644 --- a/nezha-fronted/src/components/page/alert/alertRule.vue +++ b/nezha-fronted/src/components/page/alert/alertRule.vue @@ -97,6 +97,7 @@ export default { alertName: '', linkObject: { id: '', name: '' }, expr: '', + state: 1, type: 1, unit: 2, operator: '>', @@ -104,7 +105,18 @@ export default { severityId: '', summary: '', description: '', - method: [] + method: [], + name: '', + threshold: '', + receiver: [], + autoExpired: 1, + schedEnable: 0, + schedDays: '', + schedStime: '00:00', + schedEtime: '23:59', + notifyActive: 1, + notifyExpired: 1, + trbShot: '' }, blankSilenceObject: { id: '', @@ -199,6 +211,7 @@ export default { this.object = { ...response.data, method: response.data.method ? response.data.method.split(',').map(item => Number(item)) : [], + schedDays: response.data.schedDays ? response.data.schedDays.split(',').map(item => Number(item)) : [], receiverShow: response.data.receiver ? response.data.receiver.split(',').map(item => Number(item)) : [] } if (copyFlag) { diff --git a/nezha-fronted/src/components/page/config/agent.vue b/nezha-fronted/src/components/page/config/agent.vue index 8062daea5..71ab5103f 100644 --- a/nezha-fronted/src/components/page/config/agent.vue +++ b/nezha-fronted/src/components/page/config/agent.vue @@ -126,7 +126,7 @@ export default { blankObject: { id: '', host: '', - port: 9090, + port: 10090, dc: { id: '', name: '', location: '' } }, agent: agent, diff --git a/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue b/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue index ad3ee7f3d..d3fc29dcb 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue @@ -610,6 +610,9 @@ export default {