diff --git a/nezha-fronted/src/components/common/searchInput.vue b/nezha-fronted/src/components/common/searchInput.vue
index eed9ca4e8..ef9bfbda5 100644
--- a/nezha-fronted/src/components/common/searchInput.vue
+++ b/nezha-fronted/src/components/common/searchInput.vue
@@ -139,6 +139,16 @@
{{item.name}}
+
@@ -267,6 +277,7 @@ export default {
groupSelect: [],
projectSelect: [],
severitySelect: [],
+ alertTypesSelect: searchSelectInfo.searchMetrics,
moduleSelect: [],
modelSelect: [],
gnameList: [],
@@ -503,6 +514,10 @@ export default {
val.val = selectItem.name
val.valnum = selectItem.id
val.valString = ''
+ } else if (val.type === 'alertTypes' && selectItem.searchType === 'alertTypes') {
+ val.val = selectItem.name
+ val.valnum = selectItem.id
+ val.valString = ''
}
}
// this.select_list.push({type: 'dc', val: selectItem.name, valnum: selectItem.id});
@@ -636,6 +651,7 @@ export default {
this.severitySelect.forEach((item, index) => {
this.$set(item, 'searchType', 'severity')
})
+ console.log(this.severitySelect)
}
})
},
@@ -862,6 +878,8 @@ export default {
objectInfo[val.label] = val.valnum
} else if (val.type === 'severity') {
objectInfo[val.label] = val.valnum
+ } else if (val.type === 'alertTypes') {
+ objectInfo[val.label] = val.valnum
} else if (val.type === 'selectAction') { // 新增日志判断
objectInfo[val.label] = val.valnum
} else if (val.type === 'dc') {
diff --git a/nezha-fronted/src/components/common/searchSelectInfo.vue b/nezha-fronted/src/components/common/searchSelectInfo.vue
index 26188bbec..82c414b9c 100644
--- a/nezha-fronted/src/components/common/searchSelectInfo.vue
+++ b/nezha-fronted/src/components/common/searchSelectInfo.vue
@@ -236,6 +236,23 @@ const searchSelectInfo = { // value: 传给后台的值;label:显示给用
value: 4,
label: i18n.t('config.terminallog.statusItem.unknownError')
}
+ ],
+ searchMetrics: [
+ {
+ id: 1,
+ name: i18n.t('project.metrics.metrics'),
+ searchType: 'alertTypes'
+ },
+ {
+ id: 2,
+ name: i18n.t('overall.logs'),
+ searchType: 'alertTypes'
+ },
+ {
+ id: 3,
+ name: 'SNMP trap',
+ searchType: 'alertTypes'
+ }
]
}
export default searchSelectInfo
diff --git a/nezha-fronted/src/components/page/alert/alertRule.vue b/nezha-fronted/src/components/page/alert/alertRule.vue
index a2a48b4e6..a2b75efd1 100644
--- a/nezha-fronted/src/components/page/alert/alertRule.vue
+++ b/nezha-fronted/src/components/page/alert/alertRule.vue
@@ -155,6 +155,12 @@ export default {
type: 'severity',
label: 'severityIds',
disabled: false
+ }, {
+ id: 5,
+ name: this.$t('overall.type'),
+ type: 'alertTypes',
+ label: 'type',
+ disabled: false
}]
},
searchTime: bus.getTimezontDateRange()