调整协议字段取值

This commit is contained in:
wangxin
2018-10-06 23:10:54 +08:00
parent 210ba71901
commit 34d56b814e
3 changed files with 40 additions and 7 deletions

View File

@@ -0,0 +1,2 @@
UPDATE function_region_dict SET config_protocol='6,17,1,8,15' WHERE function_id=5 AND config_region_value='INLINE_IP_CB';
UPDATE function_region_dict SET config_protocol='6,17' WHERE function_id=5 AND config_region_value='LIMIT_IP';

View File

@@ -325,7 +325,7 @@ var processAction=function(configType,obj){
//先清空,再添加
o.find("select[name$='protocol']").empty();
$.ipcommon.protocol.each(function(){
if($(this).attr("value")==0||$(this).attr("value")==6){
if($(this).attr("value")==6){
o.find("select[name$='protocol']").append($(this));
}
})
@@ -365,7 +365,13 @@ var processAction=function(configType,obj){
if(o.find("select[name$='protocol'] option[value='"+selectedProtocol+"']").length>0){
o.find("select[name$='protocol']").selectpicker("val",selectedProtocol);
}else{
o.find("select[name$='protocol']").selectpicker("val",0);
if(o.find("select[name$='protocol'] option[value=0]").length>0){
o.find("select[name$='protocol']").selectpicker("val",0);
}else{
o.find("select[name$='protocol']").get(0).selectedIndex=0;
o.find("select[name$='protocol']").selectpicker("refresh");
}
}
}
}

View File

@@ -287,7 +287,12 @@ var changeIPVal=function(obj){
if(o.find("select[name$='ipType'] option[value='"+ipTypeVal+"']").length>0){
o.find("select[name$='ipType']").selectpicker("val",ipTypeVal);
}else{
o.find("select[name$='ipType']").selectpicker("val",4);
if(o.find("select[name$='ipType'] option[value=4]").length>0){
o.find("select[name$='ipType']").selectpicker("val",4);
}else{
o.find("select[name$='ipType']").get(0).selectedIndex=0;
o.find("select[name$='ipType']").selectpicker("refresh");
}
}
}
@@ -310,7 +315,12 @@ var changeIPVal=function(obj){
if(o.find("select[name$='ipPattern'] option[value='"+ipPatternVal+"']").length>0){
o.find("select[name$='ipPattern']").selectpicker("val",ipPatternVal);
}else{
o.find("select[name$='ipPattern']").selectpicker("val",1);
if(o.find("select[name$='ipPattern'] option[value=1]").length>0){
o.find("select[name$='ipPattern']").selectpicker("val",1);
}else{
o.find("select[name$='ipPattern']").get(0).selectedIndex=0;
o.find("select[name$='ipPattern']").selectpicker("refresh");
}
}
}
//端口格式处理
@@ -332,7 +342,12 @@ var changeIPVal=function(obj){
if(o.find("select[name$='portPattern'] option[value='"+portPatternVal+"']").length>0){
o.find("select[name$='portPattern']").selectpicker("val",portPatternVal);
}else{
o.find("select[name$='portPattern']").selectpicker("val",1);
if(o.find("select[name$='portPattern'] option[value=1]").length>0){
o.find("select[name$='portPattern']").selectpicker("val",1);
}else{
o.find("select[name$='portPattern']").get(0).selectedIndex=0;
o.find("select[name$='portPattern']").selectpicker("refresh");
}
}
}
//方向处理
@@ -354,7 +369,12 @@ var changeIPVal=function(obj){
if(o.find("select[name$='direction'] option[value='"+directionVal+"']").length>0){
o.find("select[name$='direction']").selectpicker("val",directionVal);
}else{
o.find("select[name$='direction']").selectpicker("val",0);
if(o.find("select[name$='direction'] option[value=0]").length>0){
o.find("select[name$='direction']").selectpicker("val",0);
}else{
o.find("select[name$='direction']").get(0).selectedIndex=0;
o.find("select[name$='direction']").selectpicker("refresh");
}
}
}
//协议处理
@@ -376,7 +396,12 @@ var changeIPVal=function(obj){
if(o.find("select[name$='protocol'] option[value='"+protocolVal+"']").length>0){
o.find("select[name$='protocol']").selectpicker("val",protocolVal);
}else{
o.find("select[name$='protocol']").selectpicker("val",0);
if(o.find("select[name$='protocol'] option[value=0]").length>0){
o.find("select[name$='protocol']").selectpicker("val",0);
}else{
o.find("select[name$='protocol']").get(0).selectedIndex=0;
o.find("select[name$='protocol']").selectpicker("refresh");
}
}
}
}