diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp index 6a9d20eec..ba0e4e494 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp @@ -132,11 +132,20 @@ - + + + + + + + + + +
-

+ <%--

@@ -146,7 +155,7 @@ -

+ --%>
diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index 9c2a95215..4786ccfbf 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -1,14 +1,4 @@ $(function(){ - $.ipcommon=function(){ - return {}; - } - $.extend($.ipcommon, { - ipType:[], - ipPattern:[], - portPattern:[], - protocol:[], - direction:[] - }); $("input[name$='isCaseSenstive']").on("change",function(){ setIsHexBin(this); }); @@ -425,7 +415,6 @@ $(function(){ window.history.back(); return false; }); - initCommIpVal(); //去掉首尾空格 $("input,textarea").on("blur",function(){ var val=$(this).val(); @@ -752,7 +741,11 @@ var setIsHexBin=function(obj){ $("input[name='"+profix+"isCaseSenstive'][value=1]").prop("checked",false); $("input[name='"+profix+"isCaseSenstive'][value=1]").parent().addClass("hidden"); }else{ - $("input[name='"+profix+"isCaseSenstive'][value=1]").parent().removeClass("hidden"); + var configHex=$("input[name='"+profix+"configHex']").val(); + configHex=","+configHex+","; + if(configHex.indexOf(",2,") > -1){ + $("input[name='"+profix+"isCaseSenstive'][value=1]").parent().removeClass("hidden"); + } } var isCaseSenstive=$("input[name='"+profix+"isCaseSenstive']:checked").val(); //设置isHexbin下拉框的值 @@ -1283,7 +1276,7 @@ var viewAreaInfo=function(path,areaEffectiveIds,compileId){ var title=""; if(data.areaIsps.length > 0){ title=$.validator.messages.area;//+" "+$.validator.messages.isp; - html+=""; + html+="
"; html+=""; html+="";/* + "";*/ @@ -1302,7 +1295,7 @@ var viewAreaInfo=function(path,areaEffectiveIds,compileId){ } if(data.areaIps.length > 0){ title=$.validator.messages.area+" ip"; - html+="
"+$.validator.messages.area+""+$.validator.messages.isp+"
"; + html+="
"; html+=""; html+="" + "" + @@ -1675,185 +1668,6 @@ var setHexCaseSenstive=function(){ }); } -/** - * ip默认选项处理 - */ -var initCommIpVal=function(){ - var action,regionCode,serviceType,ipPortShow,ipType, - ipPattern,portPattern,direction,protocol,regionType; - if($("input[name$='action']:checked").length>0){ - regionCode=$("input[name$='action']:checked").attr("regionCode"); - action=$("input[name$='action']:checked").val(); - }else{ - regionCode=$("input[name$='action']").attr("regionCode"); - action=$("input[name$='action']").val(); - } - if(regionCode){ - if(regionCode.indexOf(",")==-1){ - $("#cfgRegionCode"+regionCode).attr("name","cfgRegionCode"); - $("#cfgType"+regionCode).attr("name","cfgType"); - }else{ - var _region=''; - var regionArr=regionCode.split(','); - $("input[name$='cfgRegionCode'][regionType='1']").each(function(){ - for(var re in regionArr){ - if($(this).val()==regionArr[re]){ - _region=regionArr[re]; - break; - } - } - }); - if(_region!=''){ - regionCode=_region; - } - } - } - if(regionCode){//IP域大于1个,根据action获取ip属性 - ipPortShow=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPortShow"), - ipType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipType"), - ipPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPattern"), - portPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("portPattern"), - direction=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("direction"), - protocol=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("protocol"), - regionType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("regionType"); - }else{//IP域只有一个,获取regionType为1的 - ipPortShow=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipPortShow"), - ipType=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipType"), - ipPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipPattern"), - portPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("portPattern"), - direction=$("input[name$='cfgRegionCode'][regionType='1']").attr("direction"), - protocol=$("input[name$='cfgRegionCode'][regionType='1']").attr("protocol"), - regionType=$("input[name$='cfgRegionCode'][regionType='1']").attr("regionType"); - } - //ip,端口处理 - if(ipPortShow){ - if(ipPortShow.indexOf('1')>-1){//展示源IP,端口 - $("input[name$='srcIpAddress']").parents(".form-group").removeClass("hidden"); - $("input[name$='srcPort']").parents(".form-group").removeClass("hidden"); - }else{ - $("input[name$='srcIpAddress']").parents(".form-group").addClass("hidden"); - $("input[name$='srcPort']").parents(".form-group").addClass("hidden"); - } - if(ipPortShow.indexOf('2')>-1){//展示目的IP,端口 - $("input[name$='destIpAddress']").parents(".form-group").removeClass("hidden"); - $("input[name$='destPort']").parents(".form-group").removeClass("hidden"); - }else{ - $("input[name$='destIpAddress']").parents(".form-group").addClass("hidden"); - $("input[name$='destPort']").parents(".form-group").addClass("hidden"); - } - } - //ip类型处理 - if(ipType){ - var arr=ipType.split(','); - $.ipcommon.ipType=$("select[name$='ipType'] option"); - $("select[name$='ipType'] option").each(function(){ - var has=false; - for(var type in arr){ - if($(this).val()==arr[type]){ - has=true; - if($(this).attr("disabled")){ - $(this).removeAttr("disabled") - } - break; - } - } - if(!has){ - $(this).remove(); - } - }); - }else{ - $.ipcommon.ipType=[]; - } - //ip格式处理 - if(ipPattern){ - arr=ipPattern.split(','); - $.ipcommon.ipPattern=$("select[name$='ipPattern'] option"); - $("select[name$='ipPattern'] option").each(function(){ - var has=false; - for(var type in arr){ - if($(this).val()==arr[type]){ - has=true; - if($(this).attr("disabled")){ - $(this).removeAttr("disabled") - } - break; - } - } - if(!has){ - $(this).remove(); - } - }); - }else{ - $.ipcommon.ipPattern=[]; - } - //端口格式处理 - if(portPattern){ - arr=portPattern.split(','); - $.ipcommon.portPattern=$("select[name$='portPattern'] option"); - $("select[name$='portPattern'] option").each(function(){ - var has=false; - for(var type in arr){ - if($(this).val()==arr[type]){ - has=true; - if($(this).attr("disabled")){ - $(this).removeAttr("disabled") - } - break; - } - } - if(!has){ - $(this).remove(); - } - }); - }else{ - $.ipcommon.portPattern=[]; - } - //方向处理 - if(direction){ - arr=direction.split(','); - $.ipcommon.direction=$("select[name$='direction'] option"); - $("select[name$='direction'] option").each(function(){ - var has=false; - for(var type in arr){ - if($(this).val()==arr[type]){ - has=true; - if($(this).attr("disabled")){ - $(this).removeAttr("disabled") - } - break; - } - } - if(!has){ - $(this).remove(); - } - }); - }else{ - $.ipcommon.direction=[]; - } - //协议处理 - if(protocol){ - arr=protocol.split(','); - $.ipcommon.protocol=$("select[name$='protocol'] option"); - $("select[name$='protocol'] option").each(function(){ - var has=false; - for(var type in arr){ - if($(this).val()==arr[type]){ - has=true; - if($(this).attr("disabled")){ - $(this).removeAttr("disabled") - } - break; - } - } - if(!has){ - $(this).remove(); - } - }); - }else{ - $.ipcommon.protocol=[]; - } -} - function heightDiv(type){ var hei=document.documentElement.clientHeight;
"+$.validator.messages.ip_type+""+$.validator.messages.ip_pattern+"