From fa237b9723b1e4c49aaa6b5ffb8a72e1ba82a2df Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Wed, 25 Aug 2021 10:39:26 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-929=20fix:=20explore=20metrics,logs=20?= =?UTF-8?q?=E5=88=87=E6=8D=A2=20=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/popBox/topToolMoreOptions.vue | 4 +- .../page/dashboard/explore/exploreItem.vue | 83 ++++++++++++++++--- 2 files changed, 73 insertions(+), 14 deletions(-) diff --git a/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue b/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue index e90cefc24..ef4e0323b 100644 --- a/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue +++ b/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue @@ -4,7 +4,7 @@ - +
{{panelLock ? $t("overall.locked") : $t("overall.unlocked")}}
@@ -102,7 +102,7 @@ export default { props: { size: { type: String, - default: 'small' + default: 'medium' }, exportUrl: { type: String, default: '' }, params: { type: Object }, diff --git a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue index 4bf433feb..2fe748e98 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue @@ -8,16 +8,33 @@
-
- - - - -
+ + + + + + + + + + + + + + + + {{selectValue}} + + + + {{item.label}} + + + +
@@ -327,13 +344,17 @@ export default { searchMetrics: [ { value: 'Metrics', - label: this.$t('project.metrics.metrics') + label: this.$t('project.metrics.metrics'), + icon: 'nz-icon nz-icon-Metrics' }, { value: 'Logs', - label: this.$t('overall.logs') + label: this.$t('overall.logs'), + icon: 'nz-icon nz-icon-logs' } ], + selectValue: '', + selectIcon: '', fromData: { status: '' }, @@ -463,8 +484,30 @@ export default { this.queryMetrics() this.promqlKeys.push(getUUID()) this.fromData.status = this.searchMetrics[0].label + this.selectMetricsLogs() }, methods: { + selectMetricsLogs (val, icon) { + if (this.selectValue === 'Metrics') { + this.selectValue = val + this.selectIcon = icon + this.showMetrics = val === 'Metrics' + this.showIntroduce = true + this.resetExpression() + } else if (this.selectValue === 'Logs') { + this.selectValue = val + this.selectIcon = icon + this.showMetrics = val === 'Metrics' + this.showIntroduce = true + this.resetExpression() + } else { + this.selectValue = 'Metrics' + this.selectIcon = 'nz-icon nz-icon-Metrics' + this.showMetrics = 'Metrics' + this.showIntroduce = true + this.resetExpression() + } + }, changeType (value) { this.showMetrics = value === 'Metrics' this.showIntroduce = true @@ -1108,6 +1151,22 @@ export default {