diff --git a/nezha-fronted/src/assets/stylus/main.scss b/nezha-fronted/src/assets/stylus/main.scss index 3a17b877d..6075dc3d5 100644 --- a/nezha-fronted/src/assets/stylus/main.scss +++ b/nezha-fronted/src/assets/stylus/main.scss @@ -1395,10 +1395,10 @@ li{ .nz-submenu .el-menu--popup .el-menu-item .menu-item-active{ color:$global-text-color-active !important; } -.el-icon-setting:before { - content: "\E6CA"; - color: #BA3939; -} +//.el-icon-setting:before { +// content: "\E6CA"; +// color: #BA3939; +//} .el-dropdown-menu__item:focus, .el-dropdown-menu__item:not(.is-disabled):hover, diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index 2fc798ce7..58ae52b43 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -574,7 +574,13 @@ const cn = { cabinetNum: "机柜数量", assets: "资产", remark: "备注", - cabinets: "机柜" + cabinets: "机柜", + traffic:{ + title:'流量配置', + add:'添加', + direction:'方向', + tags:'标签' + } }, model: { model: "资产模型", diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index 3ddb8156f..d695db6c9 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -302,7 +302,8 @@ const en = { url:'Invalid URL', uSize:'Must be number(1 - 47)', requiredIdc:'dc is required', - key:'Invalid key' + key:'Invalid key', + repeat:'Repeat' }, search: { searchTip: 'Enter to search',//'点击或回车执行搜索' @@ -561,6 +562,8 @@ const en = { traffic:{ title:'Traffic Setting', add:'Add', + direction:'Direction', + tags:'Tags' } }, model: { diff --git a/nezha-fronted/src/components/common/rightBox/trafficSetting/subBox.vue b/nezha-fronted/src/components/common/rightBox/trafficSetting/subBox.vue index c6f42a342..af3ad5b47 100644 --- a/nezha-fronted/src/components/common/rightBox/trafficSetting/subBox.vue +++ b/nezha-fronted/src/components/common/rightBox/trafficSetting/subBox.vue @@ -3,27 +3,17 @@
- - -
{{item.key}}:{{item.value}}
-
-
- - = - -
-
- {{$t('validate.key')}} + {{$t('validate.key')}}
- +
@@ -39,9 +29,7 @@ tempTagsObj:[], rowIndex:0, curConfigs:null, - newTag:{key:'',value:''}, - showNewTagInput:true, - newTagInputError:false, + inputKeyErr:[], } }, methods:{ @@ -53,6 +41,7 @@ this.editTagsBox.top = position.top + 25; this.editTagsBox.left = position.left - 48; this.tempTagsObj=[]; + this.inputKeyErr=[]; let obj=null; try{ obj=configs[index]['tags'] @@ -62,14 +51,19 @@ if(obj){ for(let key in obj){ this.tempTagsObj.push({key:key,value:obj[key]}) + this.inputKeyErr.push(false); } } } else { if (!this.editTagsBox.show) { return; } - this.confirmInput(); - this.showNewTagInput=true; + let temp=this.inputKeyErr.find(item=>{ + return item == true; + }) + if(typeof temp != "undefined"){ + return ; + } let tempObj={}; for(let i=0;i{ - this.$refs.tagKeyInput.focus(); - }) - } - }, - editTag:function(tag,index){ - console.log(222) - 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(){ - if(this.showNewTagInput == true){//已经有编辑状态的tag,先保存 - this.confirmInput(); + this.tempTagsObj.push({key:'',value:''}) + this.inputKeyErr.push(false); + }, + validateInput:function(value,index){ + if(!/[a-zA-Z_:][a-zA-Z0-9_:]*/.test(value)){ + this.inputKeyErr.splice(index,1,true) + }else{ + this.inputKeyErr.splice(index,1,false) } - this.newTag={key:'',value:''} - this.showNewTagInput=true; - this.$nextTick(()=>{ - this.$refs.tagKeyInput.focus(); - }) }, - delTag:function(tag,index){ + removeTags:function(index){ this.tempTagsObj.splice(index,1) - }, - clearNewTag:function(){ - this.newTag={key:'',value:''} - this.showNewTagInput=true; } }, } - +