diff --git a/nezha-fronted/src/assets/css/components/index.scss b/nezha-fronted/src/assets/css/components/index.scss index 03f09cb9e..a59876e03 100644 --- a/nezha-fronted/src/assets/css/components/index.scss +++ b/nezha-fronted/src/assets/css/components/index.scss @@ -41,6 +41,7 @@ @import './common/rightBox/addEndpointBox.scss'; @import './common/rightBox/alertRuleBox.scss'; @import './common/rightBox/alertSilenceBox.scss'; +@import './common/rightBox/recordRuleBox.scss'; @import './common/rightBox/assetStateBox.scss'; @import './common/rightBox/batchAddEndpoint.scss'; @import './common/rightBox/batchModifyEndpoint.scss'; diff --git a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue index f7fd18fae..c24077f29 100644 --- a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue +++ b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue @@ -62,6 +62,8 @@ + + @@ -89,6 +91,7 @@ import { fromRoute } from '@/components/common/js/constants' import LogBottomTab from '@/components/common/bottomBox/tabs/logBottomTab' import scrapeEndpoint from '@/components/common/bottomBox/tabs/scrapeEndpoint' import IpDetails from '@/components/common/bottomBox/tabs/IpDetails' +import recordRuleEvalLog from '@/components/common/bottomBox/tabs/recordRuleEvalLog' export default { name: 'bottomBox', @@ -110,7 +113,8 @@ export default { assetTab, assetSubTab, alertRuleEvalLog, - IpDetails + IpDetails, + recordRuleEvalLog }, props: { isFullScreen: Boolean, // 是否全屏 @@ -119,7 +123,7 @@ export default { from: String, // 来自哪个页面 tabList: Array, // 动态页签列表 targetTab: String, // 展示哪个页签 - sign:[Number,String], //pickTime历史记录的唯一标识 + sign: [Number, String] // pickTime历史记录的唯一标识 }, watch: { obj: { @@ -257,6 +261,9 @@ export default { ipam: [ { prop: 'ipam', name: this.$t('ipam.subnet.ipDetails'), active: true } ], + recordRule: [ + { prop: 'recordRule', name: this.$t('overall.alertRuleEvalLog'), active: true } + ], alertSilence: [ { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: true } ] diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/recordRuleEvalLog.vue b/nezha-fronted/src/components/common/bottomBox/tabs/recordRuleEvalLog.vue new file mode 100644 index 000000000..9ea14396d --- /dev/null +++ b/nezha-fronted/src/components/common/bottomBox/tabs/recordRuleEvalLog.vue @@ -0,0 +1,121 @@ + + + {{obj.name}} + + + + + + + + + + diff --git a/nezha-fronted/src/components/common/js/constants.js b/nezha-fronted/src/components/common/js/constants.js index 8b863410f..7af43fe57 100644 --- a/nezha-fronted/src/components/common/js/constants.js +++ b/nezha-fronted/src/components/common/js/constants.js @@ -360,6 +360,7 @@ export const fromRoute = { expressionTemplate: 'expressionTemplate', user: 'user', agent: 'agent', + recordRule: 'recordRule', dc: 'dc', role: 'role', project: 'project', diff --git a/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue b/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue index e1aa13dd6..d9601b1a6 100644 --- a/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue +++ b/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue @@ -335,6 +335,8 @@ export default { url = '/ipam/subnet/template' } else if (this.importUrl.indexOf('ipam/ip') > -1) { url = '/ipam/ip/template' + } else if (this.importUrl.indexOf('record/rule') > -1) { + url = '/record/rule/template' } if (!url) { console.error('no interface support') diff --git a/nezha-fronted/src/components/common/table/settings/recordRuleTable.vue b/nezha-fronted/src/components/common/table/settings/recordRuleTable.vue new file mode 100644 index 000000000..370b43f59 --- /dev/null +++ b/nezha-fronted/src/components/common/table/settings/recordRuleTable.vue @@ -0,0 +1,208 @@ + + + + + + + + {{ item.label }} + + + + + + {{scope.row.name ? scope.row.name : '-'}} + + + + + {{ + scope.row[item.prop] || "-" + }} + - + + + + + {{ $t("overall.option") }} + + + + + + + + + {{$t('overall.edit')}} + {{$t('overall.duplicate')}} + {{$t('overall.delete')}} + + + + + + + + + + No results found + + + + + + + + + diff --git a/nezha-fronted/src/components/page/config/recordRule.vue b/nezha-fronted/src/components/page/config/recordRule.vue new file mode 100644 index 000000000..0c48aa6eb --- /dev/null +++ b/nezha-fronted/src/components/page/config/recordRule.vue @@ -0,0 +1,132 @@ + + + + + + + + + + + + { + $refs.dataList.showBottomBox(targetTab, object); + } + " + > + + + + + + + + + + + + + diff --git a/nezha-fronted/src/router/index.js b/nezha-fronted/src/router/index.js index a8569bb4d..80f1a11e6 100644 --- a/nezha-fronted/src/router/index.js +++ b/nezha-fronted/src/router/index.js @@ -64,6 +64,10 @@ export default new Router({ path: '/agent', component: resolve => require(['@/components/page/config/agent'], resolve) }, + { + path: '/recordRule', + component: resolve => require(['@/components/page/config/recordRule'], resolve) + }, { path: '/assetType', component: resolve => require(['@/components/page/config/assetType'], resolve)