Merge branch 'develop' of https://git.mesalab.cn/K18_NTCS_WEB/NTC.git into develop

This commit is contained in:
leijun
2019-01-16 19:04:15 +08:00

View File

@@ -27,61 +27,31 @@
} }
} }
//hide actions //hide actions
if(isAsn==1){ /* if(isAsn==1){
hideAction(0,asnRegionCode); hideAction(0,asnRegionCode);
}else{ }else{
hideAction(1,asnRegionCode); 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){ var regionCodes=$(".action:checked").attr("regionCode").split(",");
$("[class~='glyphicon-plus'][class~='ipPortList']").click(); $("h4[class*='ipPortListTitle']").each(function(){
$("[class~='boxSolid'][class~='asn']").find(".glyphicon-remove").click(); var has=false;
/*if(action==32){ for(var ind in regionCodes){
$(".subscribeId").find(".glyphicon-remove").click(); if($(this).hasClass("ipPortListTitle"+regionCodes[ind])){
$(".subscribeId").prev("h4").addClass("hidden"); 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")){ if(!has){
isAsn=1; $(this).addClass("hidden");
hideAction(0,asnRegionCode);
$("[class~='boxSolid'][class~='ipPortList']").find(".glyphicon-remove").click();
} }
}); });
//处理asn id processAction(isAsn,$(".ipPortList"));
$(".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);
});
$(".action").on("change", function() { $(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId")); $("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId")); $("#protocolId").val($(this).attr("protocolId"));
@@ -110,15 +80,16 @@
$(this).attr("name",'cfgRegionCode'); $(this).attr("name",'cfgRegionCode');
$("#cfgType"+$(this).val()).attr("name",'cfgType'); $("#cfgType"+$(this).val()).attr("name",'cfgType');
} }
}); });
var tabInfo=$(".ipPortList"); var tabInfo=$(".ipPortList");
if(tabInfo){ if(tabInfo){
tabInfo.find("[name$='cfgType']").val(cfgType); tabInfo.find("[name$='cfgType']").val(cfgType);
tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode); tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode);
} }
if(isAsn==0){
/*if(isAsn==0){
changeIPVal(tabInfo); changeIPVal(tabInfo);
} } */
processAction(isAsn,tabInfo); processAction(isAsn,tabInfo);
/* if(tabInfo){ /* if(tabInfo){
tabInfo.find("[name$='cfgType']").val(cfgType); tabInfo.find("[name$='cfgType']").val(cfgType);
@@ -127,8 +98,11 @@
if($(this).val()==32||$(this).val()==96){ if($(this).val()==32||$(this).val()==96){
$(".subscribeId").find(".glyphicon-remove").click(); $(".subscribeId").find(".glyphicon-remove").click();
$(".subscribeId").prev("h4").addClass("hidden"); $(".subscribeId").prev("h4").addClass("hidden");
$(".asnRegionV").find(".glyphicon-remove").click();
$(".asnRegionV").prev("h4").addClass("hidden");
}else{ }else{
$(".subscribeId").prev("h4").removeClass("hidden"); $(".subscribeId").prev("h4").removeClass("hidden");
$(".asnRegionV").prev("h4").removeClass("hidden");
} }
//处理ICMP //处理ICMP
if($(this).val()==32){ if($(this).val()==32){
@@ -145,17 +119,20 @@
} */ } */
//隐藏显示asn //隐藏显示asn
if($(this).val()==32||$(this).val()==64){ /* if($(this).val()==32||$(this).val()==64){
$("h4.form-section.asn").addClass("hidden"); $("h4.form-section.asn").addClass("hidden");
}else{ }else{
$("h4.form-section.asn").removeClass("hidden"); $("h4.form-section.asn").removeClass("hidden");
} } */
}); });
$("#serviceId").val($(".action:checked").attr("serviceId")); $("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId")); $("#protocolId").val($(".action:checked").attr("protocolId"));
$(".ratelimitAction").find("input[name='userRegion1']").on("change",function(){ $(".ratelimitAction").find("input[name='userRegion1']").on("change",function(){
switchRateLimitType(); switchRateLimitType();
}) })
if($("input[name='cfgId']").val() == null || $("input[name='cfgId']").val() == ''){
$(".glyphicon-plus").first().click();
}
$("#cfgFrom").validate( $("#cfgFrom").validate(
{ {
errorPlacement : function(error, element) { errorPlacement : function(error, element) {
@@ -173,14 +150,14 @@
subscribeId=1; subscribeId=1;
} }
//代表所有业务都隐藏了,提示必须增加一种业务数据 //代表所有业务都隐藏了,提示必须增加一种业务数据
/* var boxSolidLenth=$(".boxSolid").length; var boxSolidLenth=$(".boxSolid").length;
if($(".boxSolid").hasClass("subscribeId")){ if($(".boxSolid").hasClass("subscribeId")){
boxSolidLenth=boxSolidLenth-1; boxSolidLenth=boxSolidLenth-1;
} }
if(boxSolidLenth ==($(".boxSolid.hidden").length-subscribeId)){ if(boxSolidLenth ==($(".boxSolid.hidden").length-subscribeId)){
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>"); top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
return; return;
} */ }
//代表所有区域都隐藏了,提示必须增加个区域信息 //代表所有区域都隐藏了,提示必须增加个区域信息
if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){ if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
if($("#areaIsp").hasClass("hidden")) $("#areaIp").find(".glyphicon-plus").click(); if($("#areaIsp").hasClass("hidden")) $("#areaIp").find(".glyphicon-plus").click();
@@ -219,10 +196,10 @@
flag=flag1; flag=flag1;
} }
if(flag){ if(flag){
if(isAsn==0){ /* if(isAsn==0){
$("input[name='userRegion4']").attr("disabled",true); $("input[name='userRegion4']").attr("disabled",true);
$("input[name='userRegion5']").attr("disabled",true); $("input[name='userRegion5']").attr("disabled",true);
} } */
$("input[name$='userRegion1']").attr("disabled",false); $("input[name$='userRegion1']").attr("disabled",false);
$("input[name$='exprType']").attr("disabled",false); $("input[name$='exprType']").attr("disabled",false);
//将disable属性的元素删除 //将disable属性的元素删除
@@ -327,12 +304,12 @@ var processAction=function(configType,obj){
var selectedProtocol=o.find("select[name$='protocol'] option:selected").attr("value"); var selectedProtocol=o.find("select[name$='protocol'] option:selected").attr("value");
if(action==32){ if(action==32){
//先清空,再添加 //先清空,再添加
/* o.find("select[name$='protocol']").empty(); o.find("select[name$='protocol']").empty();
$.ipcommon.protocol.each(function(){ $.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)); o.find("select[name$='protocol']").append($(this));
} }
}) */ })
$(".ratelimitAction").addClass("hidden"); $(".ratelimitAction").addClass("hidden");
$(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true); $(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true);
}else if(action==16){ }else if(action==16){
@@ -347,12 +324,12 @@ var processAction=function(configType,obj){
$(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true); $(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true);
}else if(action==64){ }else if(action==64){
//先清空,再添加 //先清空,再添加
/* o.find("select[name$='protocol']").empty(); o.find("select[name$='protocol']").empty();
$.ipcommon.protocol.each(function(){ $.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)); o.find("select[name$='protocol']").append($(this));
} }
}) */ })
$(".ratelimitAction").removeClass("hidden"); $(".ratelimitAction").removeClass("hidden");
var rateLimitType=$("input[name='userRegion1']:checked").val(); var rateLimitType=$("input[name='userRegion1']:checked").val();
if(rateLimitType == 0){//丢包率 if(rateLimitType == 0){//丢包率
@@ -390,6 +367,8 @@ var processAction=function(configType,obj){
} }
} }
//drop动作不展示asn信息
} }
} }
@@ -697,7 +676,7 @@ var showHideIPSECProtocol=function(obj){
</c:if> </c:if>
<c:if test="${region.regionType eq 7 }"> <c:if test="${region.regionType eq 7 }">
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set> <c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
<h4 class="form-section"> <h4 class="form-section asnRegionH">
<spring:message code="${region.configRegionValue}" /> <spring:message code="${region.configRegionValue}" />
<small> <span <small> <span
class="glyphicon glyphicon-plus ${tabName}Add" class="glyphicon glyphicon-plus ${tabName}Add"
@@ -710,7 +689,7 @@ var showHideIPSECProtocol=function(obj){
<c:forEach items="${_cfg.asnKeywords}" var="cfg"> <c:forEach items="${_cfg.asnKeywords}" var="cfg">
<c:choose> <c:choose>
<c:when test="${!isBreak}"> <c:when test="${!isBreak}">
<div class="row boxSolid ${tabName}${status.index}"> <div class="row boxSolid ${tabName}${status.index} asnRegionV">
<%@include file="/WEB-INF/views/cfg/asnForm.jsp"%> <%@include file="/WEB-INF/views/cfg/asnForm.jsp"%>
</div> </div>
<c:set var="isBreak" value="true" ></c:set> <c:set var="isBreak" value="true" ></c:set>
@@ -719,14 +698,14 @@ var showHideIPSECProtocol=function(obj){
</c:choose> </c:choose>
</c:forEach> </c:forEach>
<c:if test="${!isBreak}"> <c:if test="${!isBreak}">
<div class="row boxSolid ${tabName}${status.index} hidden disabled"> <div class="row boxSolid ${tabName}${status.index} hidden disabled asnRegionV">
<%@include file="/WEB-INF/views/cfg/asnForm.jsp"%> <%@include file="/WEB-INF/views/cfg/asnForm.jsp"%>
</div> </div>
<c:set var="asnIndex" value="${asnIndex+1 }"></c:set> <c:set var="asnIndex" value="${asnIndex+1 }"></c:set>
</c:if> </c:if>
</c:when> </c:when>
<c:otherwise> <c:otherwise>
<div class="row boxSolid ${tabName}${status.index} hidden disabled"> <div class="row boxSolid ${tabName}${status.index} hidden disabled asnRegionV">
<%@include file="/WEB-INF/views/cfg/asnForm.jsp"%> <%@include file="/WEB-INF/views/cfg/asnForm.jsp"%>
</div> </div>
<c:set var="asnIndex" value="${asnIndex+1 }"></c:set> <c:set var="asnIndex" value="${asnIndex+1 }"></c:set>