From 61d8e0df1cf829e83952093f954f1985f8e0159e Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Thu, 5 Aug 2021 22:25:55 +0800 Subject: [PATCH] NEZ-894 feat: endpoint-logTab --- .../src/assets/css/common/tableCommon.scss | 3 +- .../components/common/bottomBox/bottomBox.vue | 21 +- .../common/bottomBox/nzBottomDataList.vue | 20 +- .../common/bottomBox/tabs/endpointQuery.vue | 3 - .../common/bottomBox/tabs/logBottomTab.vue | 223 +++++++++++++++++ .../common/bottomBox/tabs/modelTab.vue | 91 ------- .../common/bottomBox/tabs/panelTabNew.vue | 12 +- .../src/components/common/pickTime.vue | 10 +- .../common/table/alert/alertMessageTable.vue | 232 +++++++++--------- .../common/table/special/endpointQueryTab.vue | 2 - .../page/dashboard/explore/exploreItem.vue | 5 +- .../page/dashboard/explore/logTab.vue | 8 +- 12 files changed, 394 insertions(+), 236 deletions(-) create mode 100644 nezha-fronted/src/components/common/bottomBox/tabs/logBottomTab.vue diff --git a/nezha-fronted/src/assets/css/common/tableCommon.scss b/nezha-fronted/src/assets/css/common/tableCommon.scss index 041859def..08058d1c4 100644 --- a/nezha-fronted/src/assets/css/common/tableCommon.scss +++ b/nezha-fronted/src/assets/css/common/tableCommon.scss @@ -194,8 +194,7 @@ height: calc(100% - 58px); .el-table:not(.chart-table) { - position: absolute; - width: calc(100% - 40px); + width: 100%; border: 1px solid $--right-box-border-color; border-bottom: none; diff --git a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue index 8f24c2d7c..1180f79db 100644 --- a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue +++ b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue @@ -47,7 +47,8 @@ - + + @@ -76,10 +77,12 @@ import operationLogTab from './tabs/operationLogTab' 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' export default { name: 'bottomBox', components: { + LogBottomTab, cabinetTab, alertMessageTab, endpointTab, @@ -186,6 +189,7 @@ export default { endpointTabTitle: [ { prop: 'panelTab', name: this.$t('overall.detail') }, { prop: 'endpointQuery', name: 'Query' }, + { prop: 'log', name: 'Log' }, { prop: 'endpointAlertMessage', name: this.$t('overall.alert') } ] }, @@ -283,12 +287,15 @@ export default { } .sub-container { padding: 10px; - height: 100%; + height: calc(100% - 64px); background-color: #f6f6f6; overflow-y: auto; &>div { background-color: white; } + &>.nz-table2 { + padding-top: 20px !important; + } } .sub-top-tools .top-tool-btn-txt .nz-icon{ display: inline-block; @@ -321,7 +328,7 @@ export default { height: 100%; background-color: #f6f6f6; - .nz-table2 { + &>.nz-table2 { height: calc(100% - 92px); padding: 20px 20px 0; } @@ -346,6 +353,14 @@ export default { padding-bottom: 10px; height: calc(100% - 30px); } +.bottom-log { + padding: 15px; +} +.bottom-common { + padding: 20px; + height: 100%; + box-sizing: border-box; +} .chart-temp{ height: calc(100% - 20px); overflow-y: auto; diff --git a/nezha-fronted/src/components/common/bottomBox/nzBottomDataList.vue b/nezha-fronted/src/components/common/bottomBox/nzBottomDataList.vue index b922b58c5..dc53a4da2 100644 --- a/nezha-fronted/src/components/common/bottomBox/nzBottomDataList.vue +++ b/nezha-fronted/src/components/common/bottomBox/nzBottomDataList.vue @@ -34,7 +34,7 @@ >
-
+
@@ -89,6 +89,24 @@ export default { computed: { bottomHeaderTitle () { return this.title || this.$t('overall.name') + }, + subContentClass () { + const className = [] + switch (this.targetTab) { + case 'panel': + className.push('bottom-panel') + break + case 'log': { + className.push('bottom-log') + break + } + default: { + className.push('nz-table2') + break + } + } + this.from === fromRoute.chartTemp && className.push('chart-temp') + return className.join(' ') } }, data () { diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/endpointQuery.vue b/nezha-fronted/src/components/common/bottomBox/tabs/endpointQuery.vue index 4b9f1b112..11e1a5a16 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/endpointQuery.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/endpointQuery.vue @@ -222,9 +222,6 @@ export default { width: 100%; height: 100%; } - /deep/ .nz-table2{ - padding: 0 !important; - } /deep/ .sub-container { box-sizing: border-box; } diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/logBottomTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/logBottomTab.vue new file mode 100644 index 000000000..6cb9cb0e7 --- /dev/null +++ b/nezha-fronted/src/components/common/bottomBox/tabs/logBottomTab.vue @@ -0,0 +1,223 @@ + + + + + diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/modelTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/modelTab.vue index 3cbdbefb4..f1f0fe185 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/modelTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/modelTab.vue @@ -101,94 +101,3 @@ export default { } } - - diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue index 3d73ff0de..f01ba357c 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue @@ -584,11 +584,9 @@ export default { } }, beforeDestroy () { - document.querySelector('#tableList').removeEventListener('mouseenter', this.tableListEnter) - document.querySelector('#tableList').removeEventListener('mouseleave', this.tableListLeave) - if (this.scrollbarWrap) { - this.scrollbarWrap.removeEventListener('scroll', bus.debounce) - }; + document.querySelector('#tableList') && document.querySelector('#tableList').removeEventListener('mouseenter', this.tableListEnter) + document.querySelector('#tableList') && document.querySelector('#tableList').removeEventListener('mouseleave', this.tableListLeave) + this.scrollbarWrap && this.scrollbarWrap.removeEventListener('scroll', bus.debounce) } } @@ -659,7 +657,9 @@ export default { /* begin-chart list*/ .table-list { overflow-y: auto; - height: calc(100% - 56px); + height: 100%; + padding: 20px 0; + box-sizing: border-box; } .box-content { diff --git a/nezha-fronted/src/components/common/pickTime.vue b/nezha-fronted/src/components/common/pickTime.vue index 7d113738e..2de7409c6 100644 --- a/nezha-fronted/src/components/common/pickTime.vue +++ b/nezha-fronted/src/components/common/pickTime.vue @@ -169,7 +169,11 @@ export default { .interval-refresh { display: flex; } - .select-refresh-time-label{ - margin-left: 5px; - } +.select-refresh-time-label{ + margin-left: 5px; +} +.time-picker { + padding-left: 8px; + display: flex; +} diff --git a/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue b/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue index 784acfbf0..3ce52e074 100644 --- a/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue +++ b/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue @@ -2,127 +2,125 @@ @import '../../../charts/chart';