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 576e797db..9dde0f0ae 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ipaddr/ipForm.jsp @@ -27,61 +27,31 @@ } } //hide actions - if(isAsn==1){ + /* if(isAsn==1){ hideAction(0,asnRegionCode); }else{ hideAction(1,asnRegionCode); + } */ + /* $("[class~='boxSolid'][class~='asn']").find(".glyphicon-remove").click();*/ + if($(".action:checked").val()==32){ + $(".subscribeId").find(".glyphicon-remove").click(); + $(".subscribeId").prev("h4").addClass("hidden"); + $(".asnRegionV").find(".glyphicon-remove").click(); + $(".asnRegionV").prev("h4").addClass("hidden"); } - if(isAsn==0){ - $("[class~='glyphicon-plus'][class~='ipPortList']").click(); - $("[class~='boxSolid'][class~='asn']").find(".glyphicon-remove").click(); - /*if(action==32){ - $(".subscribeId").find(".glyphicon-remove").click(); - $(".subscribeId").prev("h4").addClass("hidden"); - }*/ - var regionCodes=$(".action:checked").attr("regionCode").split(","); - $("h4[class*='ipPortListTitle']").each(function(){ - var has=false; - for(var ind in regionCodes){ - if($(this).hasClass("ipPortListTitle"+regionCodes[ind])){ - has=true; - } + var regionCodes=$(".action:checked").attr("regionCode").split(","); + $("h4[class*='ipPortListTitle']").each(function(){ + var has=false; + for(var ind in regionCodes){ + if($(this).hasClass("ipPortListTitle"+regionCodes[ind])){ + has=true; } - if(!has){ - $(this).addClass("hidden"); - } - }); - processAction(isAsn,$(".ipPortList")); - }else{ - $("[class~='glyphicon-plus'][class~='asn']").click(); - $("[class~='boxSolid'][class~='ipPortList']").find(".glyphicon-remove").click(); - processAction(isAsn,$(".asn")); - } - //隐藏显示asn - if($("[name='action']:checked").val()==32||$("[name='action']:checked").val()==64){ - console.log(111); - $("h4.form-section.asn").addClass("hidden"); - }else{ - $("h4.form-section.asn").removeClass("hidden"); - } - $(".glyphicon-plus").on("click",function(){ - if($(this).hasClass("ipPortList")){ - isAsn=0; - hideAction(1,asnRegionCode); - $("[class~='boxSolid'][class~='asn']").find(".glyphicon-remove").click(); } - if($(this).hasClass("asn")){ - isAsn=1; - hideAction(0,asnRegionCode); - $("[class~='boxSolid'][class~='ipPortList']").find(".glyphicon-remove").click(); + if(!has){ + $(this).addClass("hidden"); } }); - //处理asn id - $(".asn").find("input[name='userRegion5']").val($(".asn").find("select[name='userRegion4'] option:selected").attr("asnId")); - $(".asn").find("select[name='userRegion4']").on("change",function(){ - var asnId=$(this).find("option[value='"+$(this).val()+"']").attr("asnId"); - $(this).parents(".row").find("input[name='userRegion5']").val(asnId); - }); + processAction(isAsn,$(".ipPortList")); $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); @@ -110,15 +80,16 @@ $(this).attr("name",'cfgRegionCode'); $("#cfgType"+$(this).val()).attr("name",'cfgType'); } - }); + }); var tabInfo=$(".ipPortList"); if(tabInfo){ tabInfo.find("[name$='cfgType']").val(cfgType); tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode); } - if(isAsn==0){ + + /*if(isAsn==0){ changeIPVal(tabInfo); - } + } */ processAction(isAsn,tabInfo); /* if(tabInfo){ tabInfo.find("[name$='cfgType']").val(cfgType); @@ -127,8 +98,11 @@ if($(this).val()==32||$(this).val()==96){ $(".subscribeId").find(".glyphicon-remove").click(); $(".subscribeId").prev("h4").addClass("hidden"); + $(".asnRegionV").find(".glyphicon-remove").click(); + $(".asnRegionV").prev("h4").addClass("hidden"); }else{ $(".subscribeId").prev("h4").removeClass("hidden"); + $(".asnRegionV").prev("h4").removeClass("hidden"); } //处理ICMP if($(this).val()==32){ @@ -145,17 +119,20 @@ } */ //隐藏显示asn - if($(this).val()==32||$(this).val()==64){ + /* if($(this).val()==32||$(this).val()==64){ $("h4.form-section.asn").addClass("hidden"); }else{ $("h4.form-section.asn").removeClass("hidden"); - } + } */ }); $("#serviceId").val($(".action:checked").attr("serviceId")); $("#protocolId").val($(".action:checked").attr("protocolId")); $(".ratelimitAction").find("input[name='userRegion1']").on("change",function(){ switchRateLimitType(); }) + if($("input[name='cfgId']").val() == null || $("input[name='cfgId']").val() == ''){ + $(".glyphicon-plus").first().click(); + } $("#cfgFrom").validate( { errorPlacement : function(error, element) { @@ -173,14 +150,14 @@ subscribeId=1; } //代表所有业务都隐藏了,提示必须增加一种业务数据 - /* var boxSolidLenth=$(".boxSolid").length; + var boxSolidLenth=$(".boxSolid").length; if($(".boxSolid").hasClass("subscribeId")){ boxSolidLenth=boxSolidLenth-1; } if(boxSolidLenth ==($(".boxSolid.hidden").length-subscribeId)){ top.$.jBox.tip("", ""); return; - } */ + } //代表所有区域都隐藏了,提示必须增加个区域信息 if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){ if($("#areaIsp").hasClass("hidden")) $("#areaIp").find(".glyphicon-plus").click(); @@ -219,10 +196,10 @@ flag=flag1; } if(flag){ - if(isAsn==0){ + /* if(isAsn==0){ $("input[name='userRegion4']").attr("disabled",true); $("input[name='userRegion5']").attr("disabled",true); - } + } */ $("input[name$='userRegion1']").attr("disabled",false); $("input[name$='exprType']").attr("disabled",false); //将disable属性的元素删除 @@ -327,12 +304,12 @@ var processAction=function(configType,obj){ var selectedProtocol=o.find("select[name$='protocol'] option:selected").attr("value"); if(action==32){ //先清空,再添加 - /* o.find("select[name$='protocol']").empty(); + o.find("select[name$='protocol']").empty(); $.ipcommon.protocol.each(function(){ - if($(this).attr("value")==0||$(this).attr("value")==6||$(this).attr("value")==17||$(this).attr("value")==1||$(this).attr("value")==8||$(this).attr("value")==15){ + if($(this).attr("value")==6||$(this).attr("value")==17||$(this).attr("value")==1||$(this).attr("value")==50||$(this).attr("value")==15||$(this).attr("value")==51){ o.find("select[name$='protocol']").append($(this)); } - }) */ + }) $(".ratelimitAction").addClass("hidden"); $(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true); }else if(action==16){ @@ -347,12 +324,12 @@ var processAction=function(configType,obj){ $(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true); }else if(action==64){ //先清空,再添加 - /* o.find("select[name$='protocol']").empty(); + o.find("select[name$='protocol']").empty(); $.ipcommon.protocol.each(function(){ - if($(this).attr("value")==0||$(this).attr("value")==6||$(this).attr("value")==17){ + if($(this).attr("value")==6||$(this).attr("value")==17){ o.find("select[name$='protocol']").append($(this)); } - }) */ + }) $(".ratelimitAction").removeClass("hidden"); var rateLimitType=$("input[name='userRegion1']:checked").val(); if(rateLimitType == 0){//丢包率 @@ -390,6 +367,8 @@ var processAction=function(configType,obj){ } } + //drop动作不展示asn信息 + } } @@ -697,7 +676,7 @@ var showHideIPSECProtocol=function(obj){ -

+

-
+
<%@include file="/WEB-INF/views/cfg/asnForm.jsp"%>
@@ -719,14 +698,14 @@ var showHideIPSECProtocol=function(obj){ -