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()