From 907f361813ee021065c44b4a62e8bb646a0ec219 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 22 Mar 2022 15:32:07 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-1705=20fix=EF=BC=9A=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E5=90=8C=E6=97=B6=E5=BC=80=E5=90=AF=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E6=97=B6=E9=97=B4=E4=B8=8E=E5=A0=86=E6=A0=88=E5=9B=BE?= =?UTF-8?q?=E5=90=8E=E6=9F=A5=E7=9C=8B=E5=9B=BE=E8=A1=A8=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=95=B0=E6=8D=AE=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/chart/chart/legend.vue | 2 +- .../components/common/bottomBox/tabs/alertMessageTabNew.vue | 4 ++-- nezha-fronted/src/components/page/alert/alertMessage.vue | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/nezha-fronted/src/components/chart/chart/legend.vue b/nezha-fronted/src/components/chart/chart/legend.vue index cfb4dff47..5f87d3ae6 100644 --- a/nezha-fronted/src/components/chart/chart/legend.vue +++ b/nezha-fronted/src/components/chart/chart/legend.vue @@ -216,7 +216,7 @@ export default { getMaxValue (dataArg, chartInfo) { let maxValue = 0 let minValue = 0 - if (chartInfo.unit && dataArg.length > 0) { + if (dataArg.length > 0) { maxValue = 0 minValue = 0 for (let j = 0; j < dataArg.length; j++) { diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue index 0edfa4fb6..d0b71ba7a 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue @@ -621,7 +621,7 @@ export default { } chartInfo.elements[0].expression = this.currentMsg.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, '') chartInfo.elements[0].filter = encodeURIComponent(decodeURIComponent(this.promQueryParamLabels(this.currentMsg.labels))) - chartInfo.unit = this.currentMsg.unit + chartInfo.unit = this.currentMsg.alertRule.unit this.showFullscreen(true, chartInfo) } else if (this.currentMsg.alertRule.type === 2) { const chartInfo = lodash.cloneDeep(logData) @@ -635,7 +635,7 @@ export default { } chartInfo.elements[0].expression = encodeURIComponent(this.currentMsg.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, '')) chartInfo.elements[0].filter = encodeURIComponent(decodeURIComponent(this.promQueryParamLabels(this.currentMsg.labels))) - chartInfo.unit = this.currentMsg.unit + chartInfo.unit = this.currentMsg.alertRule.unit this.showFullscreen(true, chartInfo) } }, diff --git a/nezha-fronted/src/components/page/alert/alertMessage.vue b/nezha-fronted/src/components/page/alert/alertMessage.vue index 0793ceee0..989cfda62 100644 --- a/nezha-fronted/src/components/page/alert/alertMessage.vue +++ b/nezha-fronted/src/components/page/alert/alertMessage.vue @@ -595,7 +595,8 @@ export default { } chartInfo.elements[0].expression = this.currentMsg.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, '') chartInfo.elements[0].filter = encodeURIComponent(decodeURIComponent(this.promQueryParamLabels(this.currentMsg.labels))) - chartInfo.unit = this.currentMsg.unit + chartInfo.unit = this.currentMsg.alertRule.unit + console.log(chartInfo.unit) this.showFullscreen(true, chartInfo) } else if (this.currentMsg.alertRule.type === 2) { const chartInfo = lodash.cloneDeep(logData) @@ -609,7 +610,7 @@ export default { } chartInfo.elements[0].expression = encodeURIComponent(this.currentMsg.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, '')) chartInfo.elements[0].filter = encodeURIComponent(decodeURIComponent(this.promQueryParamLabels(this.currentMsg.labels))) - chartInfo.unit = this.currentMsg.unit + chartInfo.unit = this.currentMsg.alertRule.unit this.showFullscreen(true, chartInfo) } },