diff --git a/nezha-fronted/src/components/common/exportXLSX.vue b/nezha-fronted/src/components/common/exportXLSX.vue index fdeb0ce3f..c376552f7 100644 --- a/nezha-fronted/src/components/common/exportXLSX.vue +++ b/nezha-fronted/src/components/common/exportXLSX.vue @@ -29,7 +29,7 @@ - - @@ -183,6 +183,7 @@ save() { this.$refs.mibForm.validate((valid) => { if (valid) { + this.prevent_opt.save=true; let form = new FormData(); form.append('name',this.editMib.name); form.append('remark',this.editMib.remark); @@ -196,6 +197,7 @@ }else{ this.$message.error(response.msg); } + this.prevent_opt.save=false; }) }else{ form.append('id',this.editMib.id); @@ -206,8 +208,11 @@ }else{ this.$message.error(response.msg); } + this.prevent_opt.save=false; }) } + }else{ + this.prevent_opt.save=false; } }) }, diff --git a/nezha-fronted/src/components/common/rightBox/modelBox.vue b/nezha-fronted/src/components/common/rightBox/modelBox.vue index 69d6ba598..bbed611c7 100644 --- a/nezha-fronted/src/components/common/rightBox/modelBox.vue +++ b/nezha-fronted/src/components/common/rightBox/modelBox.vue @@ -76,7 +76,7 @@ - @@ -150,6 +150,7 @@ save() { this.$refs.modelForm.validate((valid) => { if (valid) { + this.prevent_opt.save = true; let errMsg = []; //vendor和type如果是新记录,需要先请求后台新增,再获取code let vendorReady; @@ -182,6 +183,7 @@ } else { this.$message.error(response.msg); } + this.prevent_opt.save=false; }); } else { this.$post('model', this.editModel).then(response => { @@ -192,6 +194,7 @@ } else { this.$message.error(response.msg); } + this.prevent_opt.save=false; }); } }); diff --git a/nezha-fronted/src/components/common/rightBox/moduleBox.vue b/nezha-fronted/src/components/common/rightBox/moduleBox.vue index 6b7a8823d..092481a30 100644 --- a/nezha-fronted/src/components/common/rightBox/moduleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/moduleBox.vue @@ -308,7 +308,7 @@ - @@ -537,6 +537,7 @@ this.editModule.labels = this.labelsToJson(this.editModule.labelModule); this.$refs.moduleForm.validate((valid) => { if (valid) { + this.prevent_opt.save=true; if (this.editModule.type.toLowerCase() == 'snmp') { this.parseSnmpParam(this.editModule); } else { @@ -554,6 +555,7 @@ } else { this.$message.error(response.msg); } + this.prevent_opt.save=false; }); } else { this.$post('module', this.editModule).then(response => { @@ -564,6 +566,7 @@ } else { this.$message.error(response.msg); } + this.prevent_opt.save=false; }); } } else { diff --git a/nezha-fronted/src/components/common/rightBox/panelBox.vue b/nezha-fronted/src/components/common/rightBox/panelBox.vue index b3a35180d..4da68889c 100644 --- a/nezha-fronted/src/components/common/rightBox/panelBox.vue +++ b/nezha-fronted/src/components/common/rightBox/panelBox.vue @@ -29,7 +29,7 @@ - @@ -83,6 +83,7 @@ save: function() { this.$refs.panelForm.validate((valid) => { if (valid) { + this.prevent_opt.save=true; if (this.panel.id) { this.$put('panel', this.panel).then(response => { if (response.code === 200) { @@ -92,6 +93,7 @@ } else { this.$message.error(response.msg); } + this.prevent_opt.save=false; }); } else { this.$post('panel', this.panel).then(response => { @@ -102,6 +104,7 @@ } else { this.$message.error(response.msg); } + this.prevent_opt.save=false; }); } } else { diff --git a/nezha-fronted/src/components/common/rightBox/projectBox.vue b/nezha-fronted/src/components/common/rightBox/projectBox.vue index 3b6a2a681..b3f0778e3 100644 --- a/nezha-fronted/src/components/common/rightBox/projectBox.vue +++ b/nezha-fronted/src/components/common/rightBox/projectBox.vue @@ -28,7 +28,7 @@ - @@ -66,6 +66,7 @@ save() { this.$refs['projectForm'].validate((valid) => { if (valid) { + this.prevent_opt.save=true; if (this.editProject.id) { this.$put('project', this.editProject).then(response => { if (response.code === 200) { @@ -76,6 +77,7 @@ } else { this.$message.error(response.msg); } + this.prevent_opt.save=false; }); } else { this.$post('project', this.editProject).then(response => { @@ -86,6 +88,7 @@ } else { this.$message.error(response.msg); } + this.prevent_opt.save=false; }); } } else { diff --git a/nezha-fronted/src/components/common/rightBox/promServerBox.vue b/nezha-fronted/src/components/common/rightBox/promServerBox.vue index d0b98921d..914541ddd 100644 --- a/nezha-fronted/src/components/common/rightBox/promServerBox.vue +++ b/nezha-fronted/src/components/common/rightBox/promServerBox.vue @@ -58,7 +58,7 @@ {{$t('overall.cancel')}} @@ -107,6 +107,7 @@ save() { this.$refs.promServerForm.validate(valid => { if (valid) { + this.prevent_opt.save=true; if (this.editPromServer.id) { this.$put('promServer', this.editPromServer).then(response => { if (response.code === 200) { @@ -115,6 +116,7 @@ } else { this.$message.error(response.msg); } + this.prevent_opt.save=false; }); } else { this.$post('promServer', this.editPromServer).then(response => { @@ -124,6 +126,7 @@ } else { this.$message.error(response.msg); } + this.prevent_opt.save=false; }); } } else { diff --git a/nezha-fronted/src/components/common/rightBox/roleBox.vue b/nezha-fronted/src/components/common/rightBox/roleBox.vue index 1a8efd06b..25741fc24 100644 --- a/nezha-fronted/src/components/common/rightBox/roleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/roleBox.vue @@ -51,7 +51,7 @@ id="roles-esc"> {{$t('overall.cancel')}} - @@ -92,6 +92,7 @@ save() { this.$refs.roleForm.validate(valid => { if (valid) { + this.prevent_opt.save=true; if (this.editRole.id) { this.$put('sys/role', this.editRole).then(response => { if (response.code === 200) { @@ -100,6 +101,7 @@ } else { this.$message.error(response.msg); } + this.prevent_opt.save=false; }); } else { this.$post('sys/role', this.editRole).then(response => { @@ -109,6 +111,7 @@ } else { this.$message.error(response.msg); } + this.prevent_opt.save=false; }); } } else { diff --git a/nezha-fronted/src/components/page/dashboard/chartBox.vue b/nezha-fronted/src/components/page/dashboard/chartBox.vue index 0be5facc1..6d18cfc00 100644 --- a/nezha-fronted/src/components/page/dashboard/chartBox.vue +++ b/nezha-fronted/src/components/page/dashboard/chartBox.vue @@ -475,7 +475,7 @@ - @@ -514,6 +514,9 @@ mixins: [rz], data() { return { + optionBtn:{ + save:false, + }, editChart: {}, statisticsList: this.$CONSTANTS.statisticsList, @@ -876,6 +879,7 @@ this.$message.error(response); } } + this.prevent_opt.save=false }); } }) @@ -896,6 +900,7 @@ this.$message.error(response2); } } + this.prevent_opt.save=false }); }, // 获取每个tag组件内部校验后数据,点击生成图表时触发 @@ -1001,6 +1006,7 @@ this.confirmAdd(); }, confirmAdd() { + this.prevent_opt.save=true this.elementTarget = []; // 初始化清空参数 if(this.editChart.type!=='url'&&this.editChart.type != 'text'){ /*if(this.editChart.type == 'alertList'){ diff --git a/nezha-fronted/src/components/page/dashboard/explore/explore.vue b/nezha-fronted/src/components/page/dashboard/explore/explore.vue index 235aef34c..4ff669d75 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/explore.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/explore.vue @@ -311,6 +311,9 @@ instance_cpu_time_ns{app="fox", proc="widget", rev="4d3a513", env="prod", job="c let promqlIndex=promqlInputIndexs[index]; if (response.data&&response.status == 'success') { let data = response.data.result; + if((!data||data.length<1)&&response.data.message){ + + } data.forEach((result, i) => { let seriesItem = { name: '',