diff --git a/src/main/resources/sql/20181006/update_ip_addr_region.sql b/src/main/resources/sql/20181006/update_ip_addr_region.sql new file mode 100644 index 000000000..970efd49c --- /dev/null +++ b/src/main/resources/sql/20181006/update_ip_addr_region.sql @@ -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'; \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp index ef33c596c..5cdd5e4fe 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp @@ -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"); + } + } } } diff --git a/src/main/webapp/static/global/scripts/ipRegion.js b/src/main/webapp/static/global/scripts/ipRegion.js index 94e4b3477..3037d5fc4 100644 --- a/src/main/webapp/static/global/scripts/ipRegion.js +++ b/src/main/webapp/static/global/scripts/ipRegion.js @@ -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"); + } } } }