From 3d50bd6caa0484632875625e3c443fadb567ea67 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 19 Oct 2022 10:02:12 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9log=20pipeline=20?= =?UTF-8?q?labels=20=E5=88=A0=E9=99=A4=E6=97=A0=E6=95=88=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/rightBox/editEndpointBoxNew.vue | 8 ++++---- .../src/components/common/rightBox/moduleBox.vue | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/nezha-fronted/src/components/common/rightBox/editEndpointBoxNew.vue b/nezha-fronted/src/components/common/rightBox/editEndpointBoxNew.vue index 031858800..6d7a2cade 100644 --- a/nezha-fronted/src/components/common/rightBox/editEndpointBoxNew.vue +++ b/nezha-fronted/src/components/common/rightBox/editEndpointBoxNew.vue @@ -590,7 +590,7 @@ - + - +
@@ -1572,9 +1572,9 @@ export default { }, delPipelineItem (logsIndex, pipelineIndex, itemIndex) { const val = this.editEndpoint.configs[1].config[logsIndex].pipeline[pipelineIndex].type - if (val === 'json') { + if (val === 'json' && this.editEndpoint.configs[1].config[logsIndex].pipeline[pipelineIndex].expressions.length > 1) { this.editEndpoint.configs[1].config[logsIndex].pipeline[pipelineIndex].expressions.splice(itemIndex, 1) - } else if (val === 'labels') { + } else if (val === 'labels' && this.editEndpoint.configs[1].config[logsIndex].pipeline[pipelineIndex].labels.length > 1) { this.editEndpoint.configs[1].config[logsIndex].pipeline[pipelineIndex].labels.splice(itemIndex, 1) } this.$refs.moduleForm.clearValidate() diff --git a/nezha-fronted/src/components/common/rightBox/moduleBox.vue b/nezha-fronted/src/components/common/rightBox/moduleBox.vue index bbb2af8a6..ccada9084 100644 --- a/nezha-fronted/src/components/common/rightBox/moduleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/moduleBox.vue @@ -572,7 +572,7 @@ - +
- +
@@ -1554,9 +1554,9 @@ export default { }, delPipelineItem (logsIndex, pipelineIndex, itemIndex) { const val = this.editModule.configs[1].config[logsIndex].pipeline[pipelineIndex].type - if (val === 'json') { + if (val === 'json' && this.editModule.configs[1].config[logsIndex].pipeline[pipelineIndex].expressions.length > 1) { this.editModule.configs[1].config[logsIndex].pipeline[pipelineIndex].expressions.splice(itemIndex, 1) - } else if (val === 'labels') { + } else if (val === 'labels' && this.editModule.configs[1].config[logsIndex].pipeline[pipelineIndex].labels.length > 1) { this.editModule.configs[1].config[logsIndex].pipeline[pipelineIndex].labels.splice(itemIndex, 1) } this.$refs.moduleForm.clearValidate()