diff --git a/nezha-fronted/src/assets/css/common.scss b/nezha-fronted/src/assets/css/common.scss index 09de77b31..a64d39daa 100644 --- a/nezha-fronted/src/assets/css/common.scss +++ b/nezha-fronted/src/assets/css/common.scss @@ -283,10 +283,18 @@ td .nz-icon-gear:before { border-color: $--border-color-light-hover; } } + #elementQuery{ + border: 1px solid $--border-color-light; + } .el-input__inner:hover { border-color: $--border-color-light-hover; } } +.query-input-active.el-input{ + #elementQuery{ + border: 1px solid $--border-color-light !important; + } +} .sub-box.detail-view-sub-box { .top-tools.top-tools--sub { padding: 0 15px 0 0; diff --git a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue index cb41a0457..893d8fa7a 100644 --- a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue +++ b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue @@ -37,11 +37,12 @@ - - - - - + + + + + + @@ -92,6 +93,7 @@ import terminalLogTab from './tabs/terminalLogTab' import assetTab from '@/components/common/bottomBox/tabs/assetTab' import { fromRoute } from '@/components/common/js/constants' import LogBottomTab from '@/components/common/bottomBox/tabs/logBottomTab' +import processBottomTab from '@/components/common/bottomBox/tabs/processBottomTab' import scrapeEndpoint from '@/components/common/bottomBox/tabs/scrapeEndpoint' import IpDetails from '@/components/common/bottomBox/tabs/IpDetails' import recordRuleEvalLog from '@/components/common/bottomBox/tabs/recordRuleEvalLog' @@ -103,6 +105,7 @@ export default { components: { scrapeEndpoint, LogBottomTab, + processBottomTab, cabinetTab, alertMessageTab, endpointTab, @@ -135,22 +138,21 @@ export default { obj: { immediate: true, handler (n) { - if ((this.from === fromRoute.asset) && n) { - const assetSub = { prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: false } - if (n.childrenNum) { - if (!this.tabs.asset.panel.find(item => item.prop === assetSub.prop)) { - this.tabs.asset.panel.push(assetSub) - this.tabs.asset.alertMessage.push(assetSub) - this.tabs.asset.endpoint.push(assetSub) - this.tabs.asset.log.push(assetSub) - } - } else if (this.tabs.asset.panel.find(item => item.prop === assetSub.prop)) { - this.tabs.asset.panel = this.tabs.asset.panel.filter(item => item.prop !== assetSub.prop) - this.tabs.asset.alertMessage = this.tabs.asset.alertMessage.filter(item => item.prop !== assetSub.prop) - this.tabs.asset.endpoint = this.tabs.asset.endpoint.filter(item => item.prop !== assetSub.prop) - this.tabs.asset.log = this.tabs.asset.log.filter(item => item.prop !== assetSub.prop) - } - } + // if ((this.from === fromRoute.asset) && n) { + // const assetSub = { prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: false } + // if (n.childrenNum) { + // if (!this.tabs.asset.panel.find(item => item.prop === assetSub.prop)) { + // this.tabs.asset.panel.push(assetSub) + // this.tabs.asset.alertMessage.push(assetSub) + // this.tabs.asset.endpoint.push(assetSub) + // this.tabs.asset.log.push(assetSub) + // } + // } else if (this.tabs.asset.panel.find(item => item.prop === assetSub.prop)) { + // this.tabs.asset.panel = this.tabs.asset.panel.filter(item => item.prop !== assetSub.prop) + // this.tabs.asset.alertMessage = this.tabs.asset.alertMessage.filter(item => item.prop !== assetSub.prop) + // this.tabs.asset.endpoint = this.tabs.asset.endpoint.filter(item => item.prop !== assetSub.prop) + // this.tabs.asset.log = this.tabs.asset.log.filter(item => item.prop !== assetSub.prop) + // } } } }, @@ -183,37 +185,43 @@ export default { // module tab }, asset: { - panel: [ - { prop: 'panelTab', name: this.$t('overall.dashboard'), active: true }, - { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, - { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, - { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false } - ], - alertMessage: [ - { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false }, - { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: true }, - { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, - { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false } - ], - endpoint: [ - { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false }, - { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, - { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: true }, - { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false } - ], - log: [ - { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false }, - { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, - { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, - { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: true } - ], - alertMessageSub: [ - { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false }, - { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, - { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, - { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false }, - { prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: true } + assetTabTitle: [ + { prop: 'panelTab', name: this.$t('overall.dashboard') }, + { prop: 'alertMessageTab', name: this.$t('overall.alert') }, + { prop: 'endpointTab', name: this.$t('asset.endpoint') }, + { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label') } ] + // panel: [ + // { prop: 'panelTab', name: this.$t('overall.dashboard'), active: true }, + // { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, + // { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, + // { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false } + // ], + // alertMessage: [ + // { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false }, + // { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: true }, + // { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, + // { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false } + // ], + // endpoint: [ + // { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false }, + // { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, + // { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: true }, + // { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false } + // ], + // log: [ + // { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false }, + // { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, + // { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, + // { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: true } + // ], + // alertMessageSub: [ + // { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false }, + // { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, + // { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, + // { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false }, + // { prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: true }, + // ] }, module: { moduleTabTitle: [ @@ -284,6 +292,23 @@ export default { const config = this.obj.configs.find(c => c.type === 'logs') return config && config.enable === 1 }, + assetTabs () { + const hasSub = this.obj && this.obj.childrenNum + const hasProcess = this.obj && this.obj.clientState == '1' + const tabs = [ + { prop: 'panelTab', name: this.$t('overall.dashboard') }, + { prop: 'alertMessageTab', name: this.$t('overall.alert') }, + { prop: 'endpointTab', name: this.$t('asset.endpoint') }, + { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label') } + ] + if (hasSub) { + tabs.push({ prop: 'assetSubTab', name: this.$t('overall.assetSubTab') }) + } + if (hasProcess) { + tabs.push({ prop: 'process', name: this.$t('overall.process') }) + } + return tabs + }, endpointTabs () { const config = this.obj.configs.find(c => c.type === 'logs') const hasLog = config && config.enable === 1 diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/processBottomTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/processBottomTab.vue new file mode 100644 index 000000000..9fb1efeae --- /dev/null +++ b/nezha-fronted/src/components/common/bottomBox/tabs/processBottomTab.vue @@ -0,0 +1,181 @@ + + + diff --git a/nezha-fronted/src/components/common/mixin/routerPathParams.js b/nezha-fronted/src/components/common/mixin/routerPathParams.js index 92a58a3c2..02d900ed1 100644 --- a/nezha-fronted/src/components/common/mixin/routerPathParams.js +++ b/nezha-fronted/src/components/common/mixin/routerPathParams.js @@ -86,7 +86,8 @@ export default { id: this.bottomBox.object.id, name: this.bottomBox.object.name, configs: this.bottomBox.object.configs ? this.bottomBox.object.configs.map(item => { return { type: item.type, enable: item.enable } }) : '', - childrenNum: this.bottomBox.object.childrenNum || '' + childrenNum: this.bottomBox.object.childrenNum || '', + clientState: this.bottomBox.object.clientState || '' }) this.$router.replace({ path: path, query: params }).catch(err => {}) } else if (from === 'nzDetailList' && this.detailViewRightObj) { @@ -95,7 +96,8 @@ export default { id: this.detailViewRightObj.id, name: this.detailViewRightObj.name, configs: this.detailViewRightObj.configs ? this.detailViewRightObj.configs.map(item => { return { type: item.type, enable: item.enable } }) : '', - childrenNum: this.detailViewRightObj.childrenNum || '' + childrenNum: this.detailViewRightObj.childrenNum || '', + clientState: this.bottomBox.object.clientState || '' }) this.$router.replace({ path: path, query: params }).catch(err => {}) } else if (from === 'bottomBox' && this.targetTab) { diff --git a/nezha-fronted/src/components/common/table/asset/assetProcessTable.vue b/nezha-fronted/src/components/common/table/asset/assetProcessTable.vue new file mode 100644 index 000000000..a88ca74b7 --- /dev/null +++ b/nezha-fronted/src/components/common/table/asset/assetProcessTable.vue @@ -0,0 +1,191 @@ + + + + +