From 59306f5bf895fca4051bfe70aa59afd6ad0cd782 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 14 Jan 2022 10:04:01 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9=20tooltip?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/bottomBox/tabs/scrapeEndpoint.vue | 13 ++++++++++++- .../common/table/settings/scrapeEndpointTable.vue | 10 +++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/scrapeEndpoint.vue b/nezha-fronted/src/components/common/bottomBox/tabs/scrapeEndpoint.vue index c3737618a..802c43c2e 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/scrapeEndpoint.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/scrapeEndpoint.vue @@ -141,7 +141,17 @@ export default { this.$set(this.searchLabel, 'type', this.obj.type) this.$get(this.url, { ...this.searchLabel }).then(response => { this.tools.loading = false - this.tableData = response.data.activeTargets + this.tableData = response.data.activeTargets.map(item => { + const buildIn = ['asset', 'endpoint', 'module', 'cpu', 'datacenter', 'project', 'parent_asset', 'user'] + buildIn.forEach(label => { + item[label] = { + id: item.labels[label + '_id'], + position: {}, + loading: false + } + }) + return item + }) // this.tableData = scrapeEndpoints[0].data.activeTargets this.detailViewRightObj = this.tableData[0] this.inputDateQuery = this.handlerTableData(this.tableData) @@ -173,6 +183,7 @@ export default { lastError = e.lastError || '' tableDateAll = endpoint + labelsType + lastScrape + lastScrapeDuration + health + lastError + tableDateAll const tableData = { endpoint, labelsType, lastScrape, lastScrapeDuration, health, lastError, tableDateAll } + console.log(tableData) tableDates.push(tableData) }) return tableDates diff --git a/nezha-fronted/src/components/common/table/settings/scrapeEndpointTable.vue b/nezha-fronted/src/components/common/table/settings/scrapeEndpointTable.vue index be9847f0a..bff52bd26 100644 --- a/nezha-fronted/src/components/common/table/settings/scrapeEndpointTable.vue +++ b/nezha-fronted/src/components/common/table/settings/scrapeEndpointTable.vue @@ -39,8 +39,8 @@
{{scope.row[item.prop]}}
+ @mouseenter="labelHover(scope.row, item.label, true, $event)" + @mouseleave="labelHover(scope.row, item.label, false)">