diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js
index c9cf7466f..92edd4ada 100644
--- a/nezha-fronted/src/components/common/language/en.js
+++ b/nezha-fronted/src/components/common/language/en.js
@@ -301,7 +301,8 @@ const en = {
port:'Invalid port',
url:'Invalid URL',
uSize:'Must be number(1 - 47)',
- requiredIdc:'dc is required'
+ requiredIdc:'dc is required',
+ key:'Invalid key'
},
search: {
searchTip: 'Enter to search',//'点击或回车执行搜索'
diff --git a/nezha-fronted/src/components/common/rightBox/trafficSetting/subBox.vue b/nezha-fronted/src/components/common/rightBox/trafficSetting/subBox.vue
index e058be6c3..be756613d 100644
--- a/nezha-fronted/src/components/common/rightBox/trafficSetting/subBox.vue
+++ b/nezha-fronted/src/components/common/rightBox/trafficSetting/subBox.vue
@@ -3,16 +3,27 @@
-
+
+
+ {{item.key}}:{{item.value}}
+
+
+
+ =
+
+
+
+ {{$t('validate.key')}}
-
+
@@ -28,6 +39,9 @@
tempTagsObj:[],
rowIndex:0,
curConfigs:null,
+ newTag:{key:'',value:''},
+ showNewTagInput:true,
+ newTagInputError:false,
}
},
methods:{
@@ -41,7 +55,7 @@
this.tempTagsObj=[];
let obj=null;
try{
- obj=JSON.parse(configs[index]['tags'])
+ obj=configs[index]['tags']
}catch (e) {
}
@@ -54,40 +68,89 @@
if (!this.editTagsBox.show) {
return;
}
- for (let i = 0; i < this.tempTagsObj.length; i++) {
- if (!this.tempTagsObj[i].key || !this.tempTagsObj[i].value) {
- this.tempTagsObj.splice(i, 1);
- i--;
+ this.confirmInput();
+ this.showNewTagInput=true;
+ let tempObj={};
+ for(let i=0;i
{
+ this.$refs.tagKeyInput.focus();
+ })
+ }
+ },
+ editTag:function(tag,index){
+ if(this.showNewTagInput == true){//已经有编辑状态的tag,先保存
+ this.confirmInput();
+ }
+ this.tempTagsObj.splice(index,1);
+ this.newTag=Object.assign({},tag)
+ this.showNewTagInput=true;
+ this.$nextTick(()=>{
+ this.$refs.tagKeyInput.focus();
+ })
},
addTags:function(){
- this.tempTagsObj.push({key:'',value:''})
+ if(this.showNewTagInput == true){//已经有编辑状态的tag,先保存
+ this.confirmInput();
+ }
+ this.newTag={key:'',value:''}
+ this.showNewTagInput=true;
+ this.$nextTick(()=>{
+ this.$refs.tagKeyInput.focus();
+ })
},
- removeTags:function(index){
+ delTag:function(tag,index){
this.tempTagsObj.splice(index,1)
+ },
+ clearNewTag:function(){
+ this.newTag={key:'',value:''}
+ this.showNewTagInput=true;
}
},
}
-
+
diff --git a/nezha-fronted/src/components/page/config/dc.vue b/nezha-fronted/src/components/page/config/dc.vue
index ffa308352..154738a0e 100644
--- a/nezha-fronted/src/components/page/config/dc.vue
+++ b/nezha-fronted/src/components/page/config/dc.vue
@@ -308,8 +308,8 @@
configTraffic: function (u) {
let tempDc = JSON.parse(JSON.stringify(u));
this.currentDc = tempDc;
- console.log(this.currentDc)
setTimeout(()=>{
+
this.$refs.trafficBox.show(true, true);
},200)
},
diff --git a/nezha-fronted/src/components/page/dashboard/explore/explore.vue b/nezha-fronted/src/components/page/dashboard/explore/explore.vue
index 6f2c2bd7e..fca093806 100644
--- a/nezha-fronted/src/components/page/dashboard/explore/explore.vue
+++ b/nezha-fronted/src/components/page/dashboard/explore/explore.vue
@@ -284,6 +284,7 @@ instance_cpu_time_ns{app="fox", proc="widget", rev="4d3a513", env="prod", job="c
let legend = [];
if (res.length > 0) {
res.forEach((response, index) => {
+ let promqlIndex=promqlInputIndexs[index];
if (response.data.status == 'success') {
let data = response.data.data.result;
data.forEach((result, i) => {
@@ -312,8 +313,9 @@ instance_cpu_time_ns{app="fox", proc="widget", rev="4d3a513", env="prod", job="c
series.push(seriesItem);
legend.push({name: seriesItem.name, alias: null, isGray: false});
})
+
+ this.$refs['promql-'+promqlIndex][0].setError('')
}else{
- let promqlIndex=promqlInputIndexs[index];
console.log(response)
this.$refs['promql-'+promqlIndex][0].setError(response.data.error)
}
diff --git a/nezha-fronted/src/components/page/project/project.vue b/nezha-fronted/src/components/page/project/project.vue
index 69e207857..83a55c6f0 100644
--- a/nezha-fronted/src/components/page/project/project.vue
+++ b/nezha-fronted/src/components/page/project/project.vue
@@ -463,12 +463,11 @@
this.currentProject=project;
// this.$store.commit('setProject',this.currentProject)
}
- this.currentModule={};
-
// this.$refs.projectLeft.setActiveNames([]);
}else{
this.currentProjectTitle=this.currentProject.name+"-"+this.currentProject.id
}
+ this.currentModule={};
},
getAllModuleList:function(){
this.$get('module', { pageSize: -1, pageNo: 1}).then(response => {
@@ -500,6 +499,7 @@
this.$refs.projectSearch.clearSearch();
this.showSubList = false;
this.selectedEndpoints=[];
+ this.currentProject={};
},
//弹出endpoint编辑页