From bb04fb852c5cd7419f6d19ca44dcddf9db305943 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 16 Nov 2021 10:23:35 +0800 Subject: [PATCH 01/84] =?UTF-8?q?NEZ-1248=20=20fix=EF=BC=9A=20=E5=88=87?= =?UTF-8?q?=E6=8D=A2=20Panel=20=E5=90=8E=EF=BC=8C=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=9C=AA=E5=88=B7=E6=96=B0=EF=BC=8C=E9=80=A0?= =?UTF-8?q?=E6=88=90=20chart=20=E8=AF=B7=E6=B1=82=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E4=B8=BA=E4=B9=8B=E5=89=8D=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/page/dashboard/panel.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nezha-fronted/src/components/page/dashboard/panel.vue b/nezha-fronted/src/components/page/dashboard/panel.vue index 8771ac079..245e44eeb 100644 --- a/nezha-fronted/src/components/page/dashboard/panel.vue +++ b/nezha-fronted/src/components/page/dashboard/panel.vue @@ -246,13 +246,14 @@ export default { this.showPanel = val this.showPanel.type = 'dashboard' this.filter.panelId = this.showPanel.id + this.dateChange() // let curTime = this.$refs.calendarPanel.getCurrentTime(); - const curTime = this.searchTime - this.filter.start_time = bus.timeFormate(curTime[0], 'yyyy-MM-dd hh:mm:ss') - this.filter.end_time = bus.timeFormate(curTime[1], 'yyyy-MM-dd hh:mm:ss') - // this.$refs.chartList.initCurrentRecordNum(); + // const curTime = this.searchTime + // this.filter.start_time = bus.timeFormate(curTime[0], 'yyyy-MM-dd hh:mm:ss') + // this.filter.end_time = bus.timeFormate(curTime[1], 'yyyy-MM-dd hh:mm:ss') + // // this.$refs.chartList.initCurrentRecordNum(); + // this.getData(this.filter) this.$refs.chartList.cleanData() - this.getData(this.filter) }, del (u) { From 8c76cdcf114d95a7e770ab6367b2f18cac4564c4 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 16 Nov 2021 10:24:52 +0800 Subject: [PATCH 02/84] =?UTF-8?q?NEZ-1249=20fix:=20Dashboard=20explore=20?= =?UTF-8?q?=E7=82=B9=E5=87=BB=20=E6=8A=98=E7=BA=BF=E5=9B=BE=20=E4=B8=8B?= =?UTF-8?q?=E6=96=B9=E6=A0=87=E7=AD=BE=E8=BF=9B=E8=A1=8C=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E7=BA=BF=E4=B8=8A=E6=98=BE=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=20label=20=E5=86=85=E5=AE=B9=E5=92=8C=E9=80=89=E4=B8=AD?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/page/dashboard/overview/chart.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nezha-fronted/src/components/page/dashboard/overview/chart.vue b/nezha-fronted/src/components/page/dashboard/overview/chart.vue index 9857b331b..6afe9776e 100644 --- a/nezha-fronted/src/components/page/dashboard/overview/chart.vue +++ b/nezha-fronted/src/components/page/dashboard/overview/chart.vue @@ -417,7 +417,7 @@ export default { let str = '
' params instanceof Array || (params = [params]) params.forEach((item, i) => { - const alias = this.queryAlias(i) + const alias = this.queryAlias(item.seriesIndex) if (i === 0 && alias.indexOf('Previous ') === -1) { const value = item.data[0] const tData = new Date(value) From 632db04db6f39faec60535c964e2bce117f1fbdf Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 16 Nov 2021 13:33:06 +0800 Subject: [PATCH 03/84] =?UTF-8?q?NEZ-1247=20fix:=20Chart=20perview=20?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=89=8D=E7=AB=AF=E6=98=BE=E7=A4=BA=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=8C=83=E5=9B=B4=E4=B8=8E=E4=BC=A0=E5=8F=82=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/charts/chartPreview.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/nezha-fronted/src/components/charts/chartPreview.vue b/nezha-fronted/src/components/charts/chartPreview.vue index cab83c95d..f67512486 100644 --- a/nezha-fronted/src/components/charts/chartPreview.vue +++ b/nezha-fronted/src/components/charts/chartPreview.vue @@ -358,6 +358,7 @@ export default { }, initDialog () { // 此时初始化,才能获得screenShowArea对象,否则此对象为undefined,无法初始化图表 + this.$refs.pickTime.$refs.timePicker.setCustomTime() const chartType = this.chart.type if (chartType === 'table') { // From 18a896d7767f2566e1982a8c625b9f049cbb8f88 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 16 Nov 2021 15:31:29 +0800 Subject: [PATCH 04/84] =?UTF-8?q?NEZ-1246=20fix:=20Chart=20perview=20?= =?UTF-8?q?=E6=97=B6=E5=B9=B6=E6=9C=AA=E5=B8=A6=20=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=20nullType=20=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/charts/chartPreview.vue | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/nezha-fronted/src/components/charts/chartPreview.vue b/nezha-fronted/src/components/charts/chartPreview.vue index f67512486..99c8278e8 100644 --- a/nezha-fronted/src/components/charts/chartPreview.vue +++ b/nezha-fronted/src/components/charts/chartPreview.vue @@ -422,7 +422,12 @@ export default { // if(chartItem.type === 'table'&&chartItem.param&&chartItem.param.last == 1){ // return this.$get('/prom/api/v1/query_range?query=' + query + "&start=" + this.$stringTimeParseToUnix(endTime) + "&end=" + this.$stringTimeParseToUnix(endTime) + '&step=' + step); // } - return this.$get('/prom/api/v1/query_range?query=' + query + '&start=' + this.$stringTimeParseToUnix(startTime) + '&end=' + this.$stringTimeParseToUnix(endTime) + '&step=' + step) + let str = '' + if ((chartItem.type === 'line' || chartItem.type === 'bar' || chartItem.type === 'stackArea' || chartItem.type === 'table') && chartItem.param) { // 如果是这三个 默认给null + chartItem.param.nullType = chartItem.param.nullType || 'null' + str += '&nullType=' + chartItem.param.nullType + } + return this.$get('/prom/api/v1/query_range?query=' + query + '&start=' + this.$stringTimeParseToUnix(startTime) + '&end=' + this.$stringTimeParseToUnix(endTime) + '&step=' + step + str) }) // 一个图表的所有element单独获取数据 axios.all(axiosArr).then((res) => { @@ -1658,10 +1663,15 @@ export default { axiosArr = this.chart.elements.map((ele) => { const filterItem = ele const query = filterItem.expression - if (chartItem.type === 'table' && chartItem.param && chartItem.param.last == 1) { - return this.$get('/prom/api/v1/query_range?query=' + query + '&start=' + this.$stringTimeParseToUnix(endTime) + '&end=' + this.$stringTimeParseToUnix(endTime) + '&step=' + step) + let str = '' + if ((chartItem.type === 'line' || chartItem.type === 'bar' || chartItem.type === 'stackArea' || chartItem.type === 'table') && chartItem.param) { // 如果是这三个 默认给null + chartItem.param.nullType = chartItem.param.nullType || 'null' + str += '&nullType=' + chartItem.param.nullType } - return this.$get('/prom/api/v1/query_range?query=' + query + '&start=' + this.$stringTimeParseToUnix(startTime) + '&end=' + this.$stringTimeParseToUnix(endTime) + '&step=' + step) + if (chartItem.type === 'table' && chartItem.param && chartItem.param.last == 1) { + return this.$get('/prom/api/v1/query_range?query=' + query + '&start=' + this.$stringTimeParseToUnix(endTime) + '&end=' + this.$stringTimeParseToUnix(endTime) + '&step=' + step + str) + } + return this.$get('/prom/api/v1/query_range?query=' + query + '&start=' + this.$stringTimeParseToUnix(startTime) + '&end=' + this.$stringTimeParseToUnix(endTime) + '&step=' + step + str) }) // 一个图表 axios.all(axiosArr).then(res => { From 78d56bedf1aa09bdf7933e20e2de6624c130c1fb Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 16 Nov 2021 15:32:09 +0800 Subject: [PATCH 05/84] =?UTF-8?q?NEZ-1253=20fix:=20Chart=20Previous=20?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E4=B8=80=E5=B0=8F=E6=97=B6=E5=AF=B9=E6=AF=94?= =?UTF-8?q?=E6=95=B0=E5=80=BC=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/charts/line-chart-block.vue | 10 ++++++---- .../src/components/page/dashboard/overview/chart.vue | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/nezha-fronted/src/components/charts/line-chart-block.vue b/nezha-fronted/src/components/charts/line-chart-block.vue index c0bb07d05..46cff7ab0 100644 --- a/nezha-fronted/src/components/charts/line-chart-block.vue +++ b/nezha-fronted/src/components/charts/line-chart-block.vue @@ -790,13 +790,14 @@ export default { } const val = formatScientificNotation(item.data[1], paramsDot) sum += self.numberWithEConvent(val) + str += '
' str += `
${tip ? (tip.alias ? tip.alias : tip.name) : item.seriesName}
` str += '
' str += chartDataFormat.getUnit(chartInfo.unit ? chartInfo.unit : 2).compute(val, null, -1, paramsDot) if (previousItem) { - str += '' - const previousval = formatScientificNotation(item.data[1], paramsDot) + str += '' + const previousval = formatScientificNotation(previousItem.data[1], paramsDot) let minusVal = 0 if (previousval <= val) { minusVal = val - previousval @@ -1266,7 +1267,7 @@ export default { str += '
' str += chartDataFormat.getUnit(chartInfo.unit ? chartInfo.unit : 2).compute(val, null, self.chartDot) if (previousItem) { - str += '' + str += '' const previousval = formatScientificNotation(previousItem.data[1], 2) let minusVal = 0 if (previousval <= val) { @@ -1578,6 +1579,7 @@ export default { this.echartModalStore.showLoading(); } */ + let self = this let axiosArr = [] this.$nextTick(() => { let startTime = bus.timeFormate(this.searchTime[0], 'yyyy-MM-dd hh:mm:ss') @@ -1685,7 +1687,7 @@ export default { label: { distance: this.computeDistance(chartDataFormat.getUnit(this.data.unit ? this.data.unit : 2).compute(this.data.param.threshold)), formatter: function (params) { - return chartDataFormat.getUnit(this.data.unit ? this.data.unit : 2).compute(params.value) + return chartDataFormat.getUnit(self.data ? self.data.unit : 2).compute(params.value) } }, lineStyle: { diff --git a/nezha-fronted/src/components/page/dashboard/overview/chart.vue b/nezha-fronted/src/components/page/dashboard/overview/chart.vue index 6afe9776e..e8a55d15b 100644 --- a/nezha-fronted/src/components/page/dashboard/overview/chart.vue +++ b/nezha-fronted/src/components/page/dashboard/overview/chart.vue @@ -450,7 +450,7 @@ export default { str += chartDataFormat.getUnit(this.unit).compute(val, null, -1, dot) const previousItem = params.find((series) => ('Previous ' + item.seriesName) === series.seriesName) if (previousItem) { - str += '' + str += '' const previousval = formatScientificNotation(previousItem.data[1], dot) let minusVal = 0 if (previousval <= val) { From 81e62990f9f541138aadfe56544314c0205fa546 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 16 Nov 2021 17:30:01 +0800 Subject: [PATCH 06/84] =?UTF-8?q?NEZ-1243=20fix:=20asset=20endpint=20?= =?UTF-8?q?=E5=BA=95=E9=83=A8=E5=BC=B9=E7=AA=97=E6=B7=BB=E5=8A=A0=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/charts/chart-list.vue | 1 - .../src/components/common/bottomBox/tabs/panelTabNew.vue | 8 +++++++- nezha-fronted/src/components/common/searchInput.vue | 1 - 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index fd5dc134e..08b229d0a 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -1515,7 +1515,6 @@ export default { const arr = [] arr.push(this.$get(`/asset/asset/${assetId}`)) arr.push(this.$get(`/asset/asset/feature/${assetId}`)) - console.log(this.$refs['editChart' + chartInfo.id][0]) if (this.$refs['editChart' + chartInfo.id][0]) { this.$refs['editChart' + chartInfo.id][0].showLoad() } diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue index c02d2031b..12be0e6f1 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue @@ -41,6 +41,9 @@
{{ $t('overall.AddByTemplate') }}
+ +
{{ $t('overall.syncChart') }}
+
@@ -74,6 +77,9 @@
{{ $t('overall.AddByTemplate') }}
+ +
{{ $t('overall.syncChart') }}
+
@@ -553,7 +559,7 @@ export default { chartBySync () { this.$post('visual/panel/chart/syncTmpl', { pid: this.obj.id }).then(res => { if (res.code === 200) { - this.getTableData() + this.getTableData(this.obj.id) this.$message.success(this.$t('tip.syncSuccess')) } else { this.$message.error(res.msg) diff --git a/nezha-fronted/src/components/common/searchInput.vue b/nezha-fronted/src/components/common/searchInput.vue index 8c3038538..e37bdad24 100644 --- a/nezha-fronted/src/components/common/searchInput.vue +++ b/nezha-fronted/src/components/common/searchInput.vue @@ -965,7 +965,6 @@ export default { restructure_historyDate () { if (localStorage.getItem('nz-history-' + this.where) !== undefined && localStorage.getItem('nz-history-' + this.where) !== null) { this.history_once = JSON.parse(localStorage.getItem('nz-history-' + this.where)) - console.log(this.history_once) } }, clear_search_list (e) { From 0d190d6b9e667ddf9c12e040238af454c55ac010 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 17 Nov 2021 10:08:21 +0800 Subject: [PATCH 07/84] =?UTF-8?q?NEZ-1257=20fix=EF=BC=9A=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=BF=94=E5=9B=9E=E6=8A=A5=E9=94=99=E4=BA=8B=20?= =?UTF-8?q?=E5=B7=A6=E4=B8=8A=E8=A7=92=E6=98=BE=E7=A4=BA=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bottomBox/tabs/alertMessageTabNew.vue | 27 ++++++++++++++++++- .../components/page/alert/alertMessage.vue | 27 ++++++++++++++++++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue index 48f31c286..c4f80a091 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue @@ -54,6 +54,18 @@ class="line-chart-block-modal nz-dialog endpoint-dialog" width="90%" @close="dialogClose"> + +
{{errorContent}}
+ + + + +
{{$t("project.endpoint.dialogTitle")}}
@@ -203,7 +215,9 @@ export default { logData: [], chartLoading: false, dialogShowText: false, - dialogText: '' + dialogText: '', + isError: false, + errorContent: '' } }, methods: { @@ -323,6 +337,17 @@ export default { } else { this.$message.error(response.data.error) } + } else { + this.$refs.messageChart.endLoading() + this.chartLoading = false + this.isError = true + if (response.msg) { + this.errorContent = response.msg + } else if (response.error) { + this.errorContent = response.error + } else { + this.errorContent = response + } } }) this.$nextTick(() => { diff --git a/nezha-fronted/src/components/page/alert/alertMessage.vue b/nezha-fronted/src/components/page/alert/alertMessage.vue index f55f36565..41348afff 100644 --- a/nezha-fronted/src/components/page/alert/alertMessage.vue +++ b/nezha-fronted/src/components/page/alert/alertMessage.vue @@ -112,6 +112,18 @@ class="line-chart-block-modal nz-dialog endpoint-dialog" width="90%" @close="dialogClose"> + +
{{errorContent}}
+ + + + +
{{$t("project.endpoint.dialogTitle")}}
@@ -350,7 +362,9 @@ export default { { name: 'XLSX', value: 1 }, { name: 'CSV', value: 2 }, { name: 'JSON', value: 3 } - ] + ], + errorContent: '', + isError: false } }, computed: { @@ -574,6 +588,17 @@ export default { } else { this.$message.error(response.data.error) } + } else { + this.$refs.messageChart.endLoading() + this.chartLoading = false + this.isError = true + if (response.msg) { + this.errorContent = response.msg + } else if (response.error) { + this.errorContent = response.error + } else { + this.errorContent = response + } } }) this.$nextTick(() => { From 02802062fdeb157ec818c78728648f2592b77e5b Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 17 Nov 2021 10:08:57 +0800 Subject: [PATCH 08/84] =?UTF-8?q?NEZ-1260=20fix=EF=BC=9A=20Endpoint/Asset?= =?UTF-8?q?=20=E4=B8=8A=E6=96=B9=E5=AF=BC=E8=88=AA=E6=A0=8F=E6=9C=AA?= =?UTF-8?q?=E5=8F=8A=E6=97=B6=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/page/asset/asset.vue | 2 +- .../src/components/page/monitor/endpoint/endpointList.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index a3f328925..c78f05926 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -673,7 +673,7 @@ export default { } this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) - if (this.$route.path === '/asset' && !this.titleSearchList.model.children.length) { + if (this.$route.path === '/asset' && this.titleSearchList) { this.$set(this.searchLabel, 'statistics', 1) }/* else { delete this.searchLabel.statistics diff --git a/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue b/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue index 75740751c..7d231e2a7 100644 --- a/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue +++ b/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue @@ -590,7 +590,7 @@ export default { } this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) - if (this.$route.path === '/monitor/endpoint' && !this.titleSearchList.project.children.length) { + if (this.$route.path === '/monitor/endpoint') { this.$set(this.searchLabel, 'statistics', 1) } const params = { From f9ca30d92f8e422dcf038173351d9b519ff8f240 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 17 Nov 2021 11:29:18 +0800 Subject: [PATCH 09/84] =?UTF-8?q?NEZ-1257=20fix=EF=BC=9A=20=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E8=A1=A8=E8=BE=BE=E6=98=AF=E6=89=80=E6=9C=89=E7=A9=BA?= =?UTF-8?q?=E7=99=BD=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/charts/chart-alert-list.vue | 2 +- .../src/components/common/bottomBox/tabs/alertMessageTabNew.vue | 2 +- nezha-fronted/src/components/page/alert/alertMessage.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nezha-fronted/src/components/charts/chart-alert-list.vue b/nezha-fronted/src/components/charts/chart-alert-list.vue index e7f3deb21..d81ae2f06 100644 --- a/nezha-fronted/src/components/charts/chart-alert-list.vue +++ b/nezha-fronted/src/components/charts/chart-alert-list.vue @@ -740,7 +740,7 @@ export default { this.getAlerScreetList() }, promQueryParamConvert (obj) { - let r = '(' + obj.alertRule.expr.replace(/\"/g, '\'') + ')' + let r = '(' + obj.alertRule.expr.replace(/\"/g, '\'').replace(/\s+/g, '') + ')' let intoLabels = false obj.labels = JSON.parse(obj.labels) if (Object.keys(obj.labels).length > 0) { diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue index c4f80a091..2b5ebe4f7 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue @@ -426,7 +426,7 @@ export default { }, promQueryParamConvert (alert) { const obj = { ...alert } - let r = '(' + obj.alertRule.expr.replace(/\"/g, '\'') + ')' + let r = '(' + obj.alertRule.expr.replace(/\"/g, '\'').replace(/\s+/g, '') + ')' let intoLabels = false obj.labels = JSON.parse(obj.labels) if (Object.keys(obj.labels).length > 0) { diff --git a/nezha-fronted/src/components/page/alert/alertMessage.vue b/nezha-fronted/src/components/page/alert/alertMessage.vue index 41348afff..c9cb3f3be 100644 --- a/nezha-fronted/src/components/page/alert/alertMessage.vue +++ b/nezha-fronted/src/components/page/alert/alertMessage.vue @@ -895,7 +895,7 @@ export default { }, promQueryParamConvert (alert) { const obj = { ...alert } - let r = '(' + obj.alertRule.expr.replace(/\"/g, '\'') + ')' + let r = '(' + obj.alertRule.expr.replace(/\"/g, '\'').replace(/\s+/g, '') + ')' let intoLabels = false obj.labels = JSON.parse(obj.labels) if (Object.keys(obj.labels).length > 0) { From d12051dd08540a3ccf935a2c8ab57e4810d79786 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 17 Nov 2021 11:35:18 +0800 Subject: [PATCH 10/84] =?UTF-8?q?NEZ-1239=20fix=EF=BC=9A=20Alert=20rule=20?= =?UTF-8?q?Evaluation=20interval=20=E5=9B=9E=E6=98=BE=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/rightBox/alertRuleBox.vue | 7 +++++-- nezha-fronted/src/components/page/alert/alertRule.vue | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue index 4eb9cc980..9e7d1d11f 100644 --- a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue @@ -112,7 +112,7 @@ - +