@@ -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: {