diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index 86e350836..e2d51f924 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -1287,8 +1287,10 @@ const cn = { alertNumTrend: '告警数量趋势', affectEntity: '影响' }, - timeout: 'Timeout', + timeout: 'Timeout(s)', inr: 'Evaluation interval', + inrPlaceholder: 'Default global scrape interval', + inrError: 'Evaluation Interval cannot be less than 15', autoExpired: 'Automatic expired', state: '状态', schedEnable: 'Schedule', diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index 992bda6e7..3cfdd170d 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -1290,8 +1290,10 @@ const en = { alertNumTrend: 'Alert num trend', affectEntity: 'Affect entity' }, - timeout: 'Timeout', + timeout: 'Timeout(s)', inr: 'Evaluation interval ', + inrPlaceholder: 'Default global scrape interval', + inrError: 'Evaluation Interval cannot be less than 15', autoExpired: 'Automatic expired', state: 'State', schedEnable: 'Schedule', diff --git a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue index 5c167abc3..5529e3e2c 100644 --- a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue @@ -40,7 +40,7 @@
{{item.name}}
-
{{item.remark}}
+
{{item.remark}}
@@ -110,11 +110,14 @@ - + - - + + @@ -143,6 +146,7 @@ + @@ -371,6 +375,13 @@ export default { callback() } } + const nzInr = (rule, value, callback) => { + if (value < 15) { + callback(new Error(this.$t('alert.config.inrError'))) + } else { + callback() + } + } return { promqlCount: 1, promqlKeys: [0], @@ -402,10 +413,6 @@ export default { { required: true, message: this.$t('validate.required'), trigger: 'change' }, { validator: nzOid, trigger: 'blur' } ], - last: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' }, - { type: 'number', message: this.$t('validate.number') } - ], severityId: [ { required: true, message: this.$t('validate.required'), trigger: 'change' } ], @@ -414,6 +421,9 @@ export default { ], operator: [ { required: true, message: this.$t('validate.required'), trigger: 'blur' } + ], + inr: [ + { validator: nzInr, trigger: 'blur' } ] }, operators: [ @@ -704,5 +714,12 @@ export default { .severity-item{ color: #999999; font-size: 12px; + max-width: 120px; + overflow: hidden; + } + .text-ellipsis{ + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap } diff --git a/nezha-fronted/src/components/page/alert/alertMessage.vue b/nezha-fronted/src/components/page/alert/alertMessage.vue index 7026332b1..0c10ef6dd 100644 --- a/nezha-fronted/src/components/page/alert/alertMessage.vue +++ b/nezha-fronted/src/components/page/alert/alertMessage.vue @@ -92,7 +92,7 @@
{{$t("project.endpoint.dialogTitle")}}
- +
@@ -492,7 +492,6 @@ export default { const end = this.searchTimeDialog[1] ? this.searchTimeDialog[1] : bus.computeTimezoneTime(new Date().getTime()) this.expressions = [this.currentMsg.alertRule.expr] this.$get('/logs/loki/api/v1/query_range?format=1&query=' + this.currentMsg.alertRule.expr + '&start=' + this.$stringTimeParseToUnix(start) + '&end=' + this.$stringTimeParseToUnix(end) + '&limit=' + limit).then(res => { - console.log(res) this.chartLoading = false const logData = [res.data] this.resultType = res.data.resultType diff --git a/nezha-fronted/src/components/page/alert/alertRule.vue b/nezha-fronted/src/components/page/alert/alertRule.vue index 84617c45c..a2a48b4e6 100644 --- a/nezha-fronted/src/components/page/alert/alertRule.vue +++ b/nezha-fronted/src/components/page/alert/alertRule.vue @@ -114,8 +114,9 @@ export default { schedDays: '', schedStime: '00:00', schedEtime: '23:59', - notifyActive: 1, - notifyExpired: 1, + notifyActive: 0, + notifyExpired: 0, + timeout: 300, trbShot: '' }, blankSilenceObject: {