diff --git a/nezha-fronted/src/assets/css/common/tableCommon.scss b/nezha-fronted/src/assets/css/common/tableCommon.scss index 9d9d4f978..a8900510f 100644 --- a/nezha-fronted/src/assets/css/common/tableCommon.scss +++ b/nezha-fronted/src/assets/css/common/tableCommon.scss @@ -76,12 +76,17 @@ color: $--button-gray-color; } } + .top-tool-btn.top-tool-btn--text { + padding: 0 8px; + width: unset; + color: #666; + } .top-tool-btn:hover:not(.nz-btn-disabled) { background-color: $--button-gray-hover-background-color; } - .top-tool-btn:focus:not(.nz-btn-disabled) { + .top-tool-btn:focus:not(.nz-btn-disabled), .top-tool-btn.is-focus { background-color: $--button-gray-hover-background-color; - border-color: #FBCEA4; + border: 1px solid #FBCEA4 !important; i { color: $--button-gray-active-color; } diff --git a/nezha-fronted/src/assets/css/main.scss b/nezha-fronted/src/assets/css/main.scss index 599f0d77e..29d2f18d9 100644 --- a/nezha-fronted/src/assets/css/main.scss +++ b/nezha-fronted/src/assets/css/main.scss @@ -2,4 +2,5 @@ @import './theme.scss'; @import './common.scss'; @import '../stylus/index.scss'; +@import './common/tableCommon.scss'; @import './common/rightBoxCommon.scss'; diff --git a/nezha-fronted/src/assets/stylus/main.scss b/nezha-fronted/src/assets/stylus/main.scss index 336820f7f..db8182056 100644 --- a/nezha-fronted/src/assets/stylus/main.scss +++ b/nezha-fronted/src/assets/stylus/main.scss @@ -359,11 +359,9 @@ li{ font-weight: 500; white-space: nowrap; } -.nz-btn.nz-btn-disabled { +.nz-btn-disabled { background-image: none; - color: #e5e5e5; - background-color: #ffffff; - border-color: #e5e5e5 ; + opacity: .6; cursor: default; } .nz-btn-group { diff --git a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue index 84942c425..0c0ee6476 100644 --- a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue +++ b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue @@ -32,10 +32,9 @@ - - - - + + + @@ -110,6 +109,19 @@ export default { return { fromRoute: fromRoute, tabs: { + terminalLog: { + monitor: [ + { prop: 'monitorTab', name: this.$t('config.terminallog.monitor.monitor'), active: true } + ], + cmd: [ + { prop: 'cmdTab', name: this.$t('config.terminallog.cmd.cmd'), active: true }, + { prop: 'recordTab', name: this.$t('config.terminallog.record.record'), active: false } + ], + record: [ + { prop: 'cmdTab', name: this.$t('config.terminallog.cmd.cmd'), active: false }, + { prop: 'recordTab', name: this.$t('config.terminallog.record.record'), active: true } + ] + }, user: { operationLog: [ { prop: 'operationLogTab', name: this.$t('config.operationlog.operationlog'), active: true }, @@ -202,3 +214,100 @@ export default { } } + diff --git a/nezha-fronted/src/components/common/bottomBox/nzBottomDataList.vue b/nezha-fronted/src/components/common/bottomBox/nzBottomDataList.vue index 1f253f021..b80e04358 100644 --- a/nezha-fronted/src/components/common/bottomBox/nzBottomDataList.vue +++ b/nezha-fronted/src/components/common/bottomBox/nzBottomDataList.vue @@ -22,9 +22,9 @@ - + - - diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/modelTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/modelTab.vue index 042b959d3..3cbdbefb4 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/modelTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/modelTab.vue @@ -103,7 +103,6 @@ export default { - - - - - + + + + + @@ -93,7 +93,7 @@ - + @@ -109,31 +109,48 @@ {{$t('project.topology.exit')}} - - - {{topologyInfo.name}} - - - - - - - - - - - + + + {{topologyInfo.name}} + + + + + + + + + + + + + + + + + + + + + + + + endpoint + + + + + + + @@ -216,21 +233,6 @@ - - - - - - - - - - - - endpoint - - - - - - @@ -2470,8 +2468,6 @@ export default { .project-box { width: 100%; - height: calc(100% - 20px); - margin-top: 10px; position: relative; border-radius: 2px; overflow: hidden; diff --git a/nezha-fronted/src/components/common/project/topologyPrev.vue b/nezha-fronted/src/components/common/project/topologyPrev.vue index 82ef0ceab..294c94366 100644 --- a/nezha-fronted/src/components/common/project/topologyPrev.vue +++ b/nezha-fronted/src/components/common/project/topologyPrev.vue @@ -113,12 +113,12 @@ {{topologyInfo.name}} - - diff --git a/nezha-fronted/src/components/common/searchInput.vue b/nezha-fronted/src/components/common/searchInput.vue index 7c53b8f8c..2912e0ac1 100644 --- a/nezha-fronted/src/components/common/searchInput.vue +++ b/nezha-fronted/src/components/common/searchInput.vue @@ -501,7 +501,7 @@ export default { } }, getDcData () { - this.$get('idc', { pageNo: 1, pageSize: -1 }).then(response => { + this.$get('dc', { pageNo: 1, pageSize: -1 }).then(response => { if (response.code === 200) { this.dcSelect = response.data.list this.dcSelect.forEach((item, index) => { @@ -772,7 +772,7 @@ export default { objectInfo[val.label] = val.val } } - console.log('search obj', objectInfo) + // console.log('search obj', objectInfo) }) this.getHeight() // 搜索完成后存储在本地历史记录中 @@ -1329,13 +1329,13 @@ export default { if (this.$route.path == '/Objects_Objects') { this.schelistget() } - if (this.$route.path == '/promServer') { + if (this.$route.path == '/agent') { this.getDcData() } - if (this.$route.path == '/project' || this.$route.path == '/alertList' || this.$route.path == '/alertConfig') { + if (this.$route.path == '/monitor/project' || this.$route.path == '/alertMessage' || this.$route.path == '/alertRule') { this.getAssetData() } - if (this.$route.path == '/alertList') { + if (this.$route.path == '/alertMessage') { this.getProjectData() this.getModuleData() } diff --git a/nezha-fronted/src/components/common/table/asset/assetTable.vue b/nezha-fronted/src/components/common/table/asset/assetTable.vue index 0062d7f5b..2dedb3fea 100644 --- a/nezha-fronted/src/components/common/table/asset/assetTable.vue +++ b/nezha-fronted/src/components/common/table/asset/assetTable.vue @@ -36,13 +36,13 @@ {{scope.row.type ? scope.row.type.name : '-'}} {{scope.row.state ? scope.row.state.name : '-'}} - {{scope.row.endpointNum ? scope.row.endpointNum : 0}} + {{scope.row.endpointNum ? scope.row.endpointNum : 0}} - {{scope.row.alertNum ? scope.row.alertNum : 0}} + {{scope.row.alertNum ? scope.row.alertNum : 0}} {{scope.row.dc ? scope.row.dc.name : '-'}} diff --git a/nezha-fronted/src/components/common/table/nzDataList.vue b/nezha-fronted/src/components/common/table/nzDataList.vue index d467372c4..9a6f2a24a 100644 --- a/nezha-fronted/src/components/common/table/nzDataList.vue +++ b/nezha-fronted/src/components/common/table/nzDataList.vue @@ -10,19 +10,19 @@ - + - - + - + @@ -87,10 +87,6 @@ export default { }, searchMsg: { type: Object - }, - hasSearch: { - type: Boolean, - default: false } }, data () { @@ -109,7 +105,8 @@ export default { toTopBtnTop: this.$tableHeight.toTopBtnTop, // to-top按钮的top属性 tableHover: false, // 控制滚动条和top按钮同时出现 showCustomTableTitle: false // 自定义列弹框是否显示 - } + }, + showLayout: [] } }, methods: { @@ -145,10 +142,14 @@ export default { 'bottomBox.showSubList': function (n) { const vm = this bottomBoxWindow.showSubListWatch(vm, n) + }, + layout: { + immediate: true, + deep: true, + handler (n) { + this.showLayout = [...n] + } } } } - diff --git a/nezha-fronted/src/components/common/table/settings/terminalLogTable.vue b/nezha-fronted/src/components/common/table/settings/terminalLogTable.vue index da5de2fb2..c740d9184 100644 --- a/nezha-fronted/src/components/common/table/settings/terminalLogTable.vue +++ b/nezha-fronted/src/components/common/table/settings/terminalLogTable.vue @@ -66,7 +66,7 @@ {{$t('overall.option')}} - + … @@ -77,13 +77,13 @@ - + … - {{$t('config.terminallog.record.record')}} + {{$t('config.terminallog.record.record')}} diff --git a/nezha-fronted/src/components/page/alert/alertMessage.vue b/nezha-fronted/src/components/page/alert/alertMessage.vue index 0f3682f44..7285d7677 100644 --- a/nezha-fronted/src/components/page/alert/alertMessage.vue +++ b/nezha-fronted/src/components/page/alert/alertMessage.vue @@ -9,7 +9,9 @@ :custom-table-title.sync="tools.customTableTitle" :from="fromRoute.alertMessage" :layout="['searchInput', 'elementSet']" - :search-msg="searchMsg"> + :search-msg="searchMsg" + @search="search" + > { - ids.push(item.id) - }) - this.deleteBox.ids = ids.join(',') - }, showExportDialog () { this.importBox.show = true }, @@ -561,24 +555,6 @@ export default { reader.readAsText(error.response.data) }) }, - showTagDetail (data, key) { - let open = false - if (key == 'asset' || key == 'project' || key == 'module' || key == 'endpoint' || key == 'datacenter') { - open = true - } - if (open) { - const labelList = [] - const detailList = [] - for (const item in data) { - if (item == 'asset' || item == 'project' || item == 'module' || item == 'endpoint' || item == 'dc') { - labelList.push(item) - detailList.push(data[item]) - } - } - this.bottomBox.showSubList = true - this.tabList = labelList - } - }, search (searchObj) { let orderBy = '' if (this.searchLabel.orderBy) { @@ -598,22 +574,11 @@ export default { if (orderBy) { this.$set(this.searchLabel, 'orderBy', orderBy) } - this.$refs.alertMessageTable.$refs.alertListTable.bodyWrapper.scrollTop = 0 + if (this.$refs.dataTable) { + this.$refs.dataTable.$refs.dataTable.bodyWrapper.scrollTop = 0 + } this.getTableData() }, - fillProject (module) { - this.$get('project', { id: module.projectId }).then(response => { - if (response.code == 200) { - module.project = response.data.list[0] - } - }) - }, - closeViews () { - this.$refs.alertConfigBox.show(false, false) - this.$refs.projectBox.show(false, false) - this.$refs.moduleBox.show(false, false) - this.viewAssetState = false - }, // 数据排序 tableDataSort (item) { let orderBy = '' diff --git a/nezha-fronted/src/components/page/alert/alertRule.vue b/nezha-fronted/src/components/page/alert/alertRule.vue index 03f9fb2e9..c6b09a4d4 100644 --- a/nezha-fronted/src/components/page/alert/alertRule.vue +++ b/nezha-fronted/src/components/page/alert/alertRule.vue @@ -6,7 +6,9 @@ :custom-table-title.sync="tools.customTableTitle" :from="fromRoute.alertRule" :layout="['searchInput', 'elementSet']" - :search-msg="searchMsg"> + :search-msg="searchMsg" + @search="search" + > + :search-msg="searchMsg" + @search="search" + > diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index 2543f874f..739ad7f3e 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -4,10 +4,15 @@ ref="dataList" :api="url" :custom-table-title.sync="tools.customTableTitle" - :has-search="true" - :layout="['searchInput', 'elementSet', 'clickSearch']" - :search-msg="searchMsg"> + :from="fromRoute.asset" + :layout="dataListLayout" + :search-msg="searchMsg" + @search="search" + > + + + { - this.$get('asset/field/meta', { pageSize: -1, search: 1 }).then(response => { + this.$get('asset/field/meta', { pageSize: -1 }).then(response => { if (response.code === 200) { const data = [] - response.data.list.forEach(m => { + const searchableData = response.data.list.filter(d => d.search === 1) + const showData = response.data.list.filter(d => d.display === 1).map(item => { + return { label: item.name, prop: 'Label', show: false, allowed: true, type: 'label' } + }) + searchableData.forEach(m => { if (m.param) { const param = JSON.parse(m.param) if (param.items) { @@ -345,6 +355,19 @@ export default { } }) this.titleSearchList.assetLabel.children = data + setTimeout(() => { + const title = this.tools.customTableTitle + const originalTitle = title.slice(0, this.$refs.dataTable.tableTitle.length) // 原title + const oldLabelTitle = title.slice(this.$refs.dataTable.tableTitle.length, title.length) // 旧labelTitle + + const newLabel = showData.filter(item => { return !oldLabelTitle.find(t => { return item.label === t.label }) }) + const keepLabel = oldLabelTitle.filter(item => showData.find(t => item.label === t.label)) + + let result = originalTitle.concat([{ label: 'Label', show: false, NotSet: true, type: 'title', prop: 'table-label' }]) + + result = result.concat(keepLabel).concat(newLabel) + this.tools.customTableTitle = JSON.parse(JSON.stringify(result)) + }, 200) } resolve() }) diff --git a/nezha-fronted/src/components/page/config/account.vue b/nezha-fronted/src/components/page/config/account.vue deleted file mode 100644 index 8f86f6ddd..000000000 --- a/nezha-fronted/src/components/page/config/account.vue +++ /dev/null @@ -1,502 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - {this.batchDeleteObjs=selection}" - > - - - - - {{item.label}} [Notification] - {{item.label}} - - - - - - - - - - - {{role.i18n?$t(role.i18n):role.name}} - - - - - - - - - {statusChange(scope.row)}"> - - - {{filterTags(item, scope)}} - {{utcTimeToTimezoneStr(scope.row[item.prop])}} - {{scope.row[item.prop]}} - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nezha-fronted/src/components/page/config/agent.vue b/nezha-fronted/src/components/page/config/agent.vue index 96e200fc7..687aed92f 100644 --- a/nezha-fronted/src/components/page/config/agent.vue +++ b/nezha-fronted/src/components/page/config/agent.vue @@ -6,7 +6,9 @@ :custom-table-title.sync="tools.customTableTitle" :from="fromRoute.agent" :layout="['searchInput', 'elementSet']" - :search-msg="searchMsg"> + :search-msg="searchMsg" + @search="search" + > diff --git a/nezha-fronted/src/components/page/config/assetMeta.vue b/nezha-fronted/src/components/page/config/assetMeta.vue index 4ac612dd9..ce16270ce 100644 --- a/nezha-fronted/src/components/page/config/assetMeta.vue +++ b/nezha-fronted/src/components/page/config/assetMeta.vue @@ -6,7 +6,9 @@ :from="fromRoute.assetLabel" :custom-table-title.sync="tools.customTableTitle" :layout="['searchInput', 'elementSet']" - :search-msg="searchMsg"> + :search-msg="searchMsg" + @search="search" + > diff --git a/nezha-fronted/src/components/page/config/assetState.vue b/nezha-fronted/src/components/page/config/assetState.vue index d1a135a14..678330434 100644 --- a/nezha-fronted/src/components/page/config/assetState.vue +++ b/nezha-fronted/src/components/page/config/assetState.vue @@ -7,7 +7,9 @@ :from="fromRoute.assetState" :search-msg="searchMsg" :table-id="tableId" - :table-title="tableTitle"> + :table-title="tableTitle" + @search="search" + > diff --git a/nezha-fronted/src/components/page/config/dc.vue b/nezha-fronted/src/components/page/config/dc.vue index 76727a6f2..65cea87ce 100644 --- a/nezha-fronted/src/components/page/config/dc.vue +++ b/nezha-fronted/src/components/page/config/dc.vue @@ -6,7 +6,9 @@ :layout="['searchInput', 'elementSet']" :custom-table-title.sync="tools.customTableTitle" :from="fromRoute.dc" - :search-msg="searchMsg"> + :search-msg="searchMsg" + @search="search" + > diff --git a/nezha-fronted/src/components/page/config/menus.vue b/nezha-fronted/src/components/page/config/menus.vue index 3a2abf154..1f44d300a 100644 --- a/nezha-fronted/src/components/page/config/menus.vue +++ b/nezha-fronted/src/components/page/config/menus.vue @@ -4,7 +4,9 @@ ref="dataList" :api="url" :custom-table-title.sync="tools.customTableTitle" - :from="fromRoute.menus"> + :from="fromRoute.menus" + @search="search" + > diff --git a/nezha-fronted/src/components/page/config/mib.vue b/nezha-fronted/src/components/page/config/mib.vue index ce6c8703a..88be48342 100644 --- a/nezha-fronted/src/components/page/config/mib.vue +++ b/nezha-fronted/src/components/page/config/mib.vue @@ -1,5 +1,5 @@ - + + :search-msg="searchMsg" + @search="search" + > {{$t("config.mib.mibFiles")}} diff --git a/nezha-fronted/src/components/page/config/roles.vue b/nezha-fronted/src/components/page/config/roles.vue index 7f27549b6..d58f7e65c 100644 --- a/nezha-fronted/src/components/page/config/roles.vue +++ b/nezha-fronted/src/components/page/config/roles.vue @@ -6,7 +6,9 @@ :layout="['searchInput', 'elementSet']" :custom-table-title.sync="tools.customTableTitle" :from="fromRoute.role" - :search-msg="searchMsg"> + :search-msg="searchMsg" + @search="search" + > diff --git a/nezha-fronted/src/components/page/config/template/chartTemp.vue b/nezha-fronted/src/components/page/config/template/chartTemp.vue index a546f2416..8bff85304 100644 --- a/nezha-fronted/src/components/page/config/template/chartTemp.vue +++ b/nezha-fronted/src/components/page/config/template/chartTemp.vue @@ -6,7 +6,9 @@ :layout="['searchInput', 'elementSet']" :custom-table-title.sync="tools.customTableTitle" :from="fromRoute.chartTemp" - :search-msg="searchMsg"> + :search-msg="searchMsg" + @search="search" + > {{$t("config.exprTemp.exprTemp")}} diff --git a/nezha-fronted/src/components/page/config/template/exprTemp.vue b/nezha-fronted/src/components/page/config/template/exprTemp.vue index 9a1f7e311..141f1c303 100644 --- a/nezha-fronted/src/components/page/config/template/exprTemp.vue +++ b/nezha-fronted/src/components/page/config/template/exprTemp.vue @@ -6,7 +6,9 @@ :layout="['searchInput', 'elementSet']" :custom-table-title.sync="tools.customTableTitle" :from="fromRoute.expressionTemplate" - :search-msg="searchMsg"> + :search-msg="searchMsg" + @search="search" + > {{$t("config.exprTemp.exprTemp")}} diff --git a/nezha-fronted/src/components/page/dashboard/chartBox.vue b/nezha-fronted/src/components/page/dashboard/chartBox.vue index f29f736c5..a61a263cf 100644 --- a/nezha-fronted/src/components/page/dashboard/chartBox.vue +++ b/nezha-fronted/src/components/page/dashboard/chartBox.vue @@ -38,6 +38,9 @@ &:first-of-type { padding-top: 0; + .nz-icon-minus-position { + padding-top: 4px; + } } padding: 20px 0; width: 100%; diff --git a/nezha-fronted/src/components/page/dashboard/explore/explore.vue b/nezha-fronted/src/components/page/dashboard/explore/explore.vue index 9f730c2aa..a676b657c 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/explore.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/explore.vue @@ -1,54 +1,41 @@ - - + + + - + + {{$t('dashboard.metricPreview.runQuery')}} - {{$t('dashboard.metric.saveChart')}} - - - - - - ---> + + graph @@ -196,9 +183,8 @@ instance_cpu_time_ns{app="fox", proc="widget", rev="4d3a513", env="prod", job="c - - + @@ -764,9 +750,6 @@ export default { border: 1px solid #c7d0d9; border-radius: 4px; } - .right-margin{ - margin-right: 15px; - } /*外部引用 样式start*/ .doc-content { font-size: 16px; @@ -930,7 +913,7 @@ export default { /*外部引用 样式end*/ -