Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop

This commit is contained in:
duandongmei
2018-08-23 09:36:09 +08:00
61 changed files with 2692 additions and 1551 deletions

View File

@@ -55,30 +55,43 @@
}else{
nodes = tree.getSelectedNodes();
}
for(var i=0; i<nodes.length; i++) {//<c:if test="${checked && notAllowSelectParent}">
//wx提示c:if标签前加了//注释,c:if标签的判断条件仍会生效
for(var i=0; i<nodes.length; i++) {
//<c:if test="${checked && notAllowSelectParent}">
if (nodes[i].isParent && "${checkedPS}"!=''){
continue; // 如果为复选框选择,并且父子节点有关联,则过滤掉父节点
}//</c:if><c:if test="${notAllowSelectRoot}">
}//</c:if>
//<c:if test="${notAllowSelectRoot}">
if (nodes[i].level == 0){
top.$.jBox.tip("<spring:message code='no_root'/>"+nodes[i].name+"<spring:message code='reselect'/>");
return false;
}//</c:if><c:if test="${notAllowSelectParent}">
}//</c:if>
//<c:if test="${notAllowSelectParent}">
if (nodes[i].isParent){
top.$.jBox.tip("<spring:message code='no_parent'/>"+nodes[i].name+"<spring:message code='reselect'/>");
return false;
}//</c:if><c:if test="${not empty module && selectScopeModule}">
}
//wx: 带有business属性的节点特殊处理
if(nodes[i].businessType&&nodes[i].businessType==-1){
top.$.jBox.tip("<spring:message code='no_parent'/>"+nodes[i].name+"<spring:message code='reselect'/>");
return false;
}
//</c:if>
//<c:if test="${not empty module && selectScopeModule}">
if (nodes[i].module == ""){
top.$.jBox.tip("<spring:message code='no_public_model'/>"+nodes[i].name+"<spring:message code='reselect'/>");
return false;
}else if (nodes[i].module != "${module}"){
top.$.jBox.tip("<spring:message code='no_outside_column'/><spring:message code='reselect'/>");
return false;
}//</c:if><c:if test="${selectDepartment}">
}//</c:if>
//<c:if test="${selectDepartment}">
if (nodes[i].name=="<spring:message code='send_org'/>" || nodes[i].name=="<spring:message code='department'/>" ||nodes[i].name=="<spring:message code='sendind_org'/>"){
top.$.jBox.tip("<spring:message code='no_node'/>"+nodes[i].name+"<spring:message code='reselect'/>");
return false;
}//</c:if>
ids.push(nodes[i].id);//<c:if test="${showParentName}">
ids.push(nodes[i].id);
//<c:if test="${showParentName}">
if (nodes[i].id != null ){
$.ajax({
type:"post",
@@ -98,23 +111,16 @@
});
}//</c:if><c:if test="${!showParentName}">
}//</c:if>
//<c:if test="${!showParentName}">
names.push(nodes[i].name);
//if(nodes[i].type){
// types.push(nodes[i].type);
//}
//</c:if><c:if test="${!checked}">
break; // 如果为非复选框选择,则返回第一个选择 </c:if>
//</c:if>
//<c:if test="${!checked}">
break; // 如果为非复选框选择,则返回第一个选择
//</c:if>
}
if((nodes.length==1)&&(nodes[0].level == 0)&&('true'=='${notAllowSelectRoot}')){
top.$.jBox.tip("<spring:message code='no_root'/>"+nodes[0].name+"<spring:message code='reselect'/>");
return false;
}
$("#${id}Id").val(ids.join(",").replace(/u_/ig,""));
//if(types.length>0){
// $("#${id}Id").attr('cfgtype',types.join(","));
//}
$("#${id}Id").change();//手动触发change事件使Id的值得变化可以被监听到
$("#${id}Name").val(names.join(","));
if(!$("#${id}Name").val()&&'${value}'){//如果值不存在但是value却有值将placeholder清空
@@ -122,7 +128,6 @@
}
}else if (v == "clear"){
$("#${id}Id").val("");
//$("#${id}Id").removeAttr('cfgtype');
$("#${id}Id").change();//手动触发change事件使Id的值得变化可以被监听到
$("#${id}Name").val("");
$("#${id}Name").attr("placeholder","");

View File

@@ -5,9 +5,6 @@
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
$("#cancel").on("click",function(){
window.history.back();
});
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
});
@@ -85,7 +82,7 @@ $(function(){
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control required"/>
@@ -145,6 +142,25 @@ $(function(){
<div for="bytes"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</div>
</div>
<c:forEach items="${regionList}" var="region">
<c:if test="${_cfg.functionId eq region.functionId}">

View File

@@ -12,6 +12,8 @@
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.bytes}"){
$("#intype").val("${cfg.bytes}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -87,8 +89,8 @@
<div class="pull-left">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}"
labelName="parent.specServiceName"
<sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control input-small"/>
@@ -98,8 +100,9 @@
<div class="input-group-btn">
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<form:option value="bytes"><spring:message code="bytes"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
</form:select>
</div>
@@ -257,8 +260,6 @@
</div>
</div>
</div>
</div>
<!-- /筛选搜索内容栏 结束-->
@@ -275,6 +276,7 @@
<th><spring:message code="whether_hexbinary"/></th>
<th><spring:message code="expression_type"/></th>
<th><spring:message code="match_method"/></th>
<th><spring:message code="do_log"/></th>
<%-- <th><spring:message code="block_type"/></th>
<th><spring:message code="whether_area_block"/></th>
<th><spring:message code="letter"/></th>
@@ -313,6 +315,11 @@
<td>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG')}" var="dict">
<c:if test="${cfg.doLog==dict.itemCode }"><spring:message code="${dict.itemValue}"/></c:if>
</c:forEach>
</td>
<%-- <td>

View File

@@ -5,9 +5,6 @@
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
$("#cancel").on("click",function(){
window.history.back();
});
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
});
@@ -84,7 +81,7 @@ $(function(){
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control required"/>
@@ -145,7 +142,26 @@ $(function(){
<div for="domain"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</div>
</div>
<c:forEach items="${regionList}" var="region">
<c:if test="${_cfg.functionId eq region.functionId}">
<input type="hidden" name="cfgType" value="${region.configRegionValue}">

View File

@@ -12,6 +12,8 @@
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.domain}"){
$("#intype").val("${cfg.domain}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -87,8 +89,8 @@
<div class="pull-left">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}"
labelName="parent.specServiceName"
<sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control input-small"/>
@@ -98,8 +100,9 @@
<div class="input-group-btn">
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<form:option value="domain"><spring:message code="domain"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
</form:select>
</div>
@@ -257,8 +260,6 @@
</div>
</div>
</div>
</div>
<!-- /筛选搜索内容栏 结束-->
@@ -275,6 +276,7 @@
<th><spring:message code="whether_hexbinary"/></th>
<th><spring:message code="expression_type"/></th>
<th><spring:message code="match_method"/></th>
<th><spring:message code="do_log"/></th>
<%-- <th><spring:message code="block_type"/></th>
<th><spring:message code="whether_area_block"/></th>
<th><spring:message code="letter"/></th>
@@ -313,6 +315,11 @@
<td>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG')}" var="dict">
<c:if test="${cfg.doLog==dict.itemCode }"><spring:message code="${dict.itemValue}"/></c:if>
</c:forEach>
</td>
<%-- <td>

View File

@@ -96,7 +96,7 @@ $(function(){
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control required"/>

View File

@@ -12,6 +12,8 @@
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.cfgKeywords}"){
$("#intype").val("${cfg.cfgKeywords}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -87,8 +89,8 @@
<div class="pull-left">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}"
labelName="parent.specServiceName"
<sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control input-small"/>
@@ -98,8 +100,9 @@
<div class="input-group-btn">
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<form:option value="cfgKeywords"><spring:message code="keywords"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
</form:select>
</div>
@@ -257,8 +260,6 @@
</div>
</div>
</div>
</div>
<!-- /筛选搜索内容栏 结束-->

View File

@@ -5,9 +5,6 @@
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
$("#cancel").on("click",function(){
window.history.back();
});
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
});
@@ -99,7 +96,7 @@ $(function(){
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control required"/>
@@ -173,6 +170,25 @@ $(function(){
</div>
</div>
</c:if>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">

View File

@@ -12,6 +12,8 @@
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.cfgKeywords}"){
$("#intype").val("${cfg.cfgKeywords}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -87,8 +89,8 @@
<div class="pull-left">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}"
labelName="parent.specServiceName"
<sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control input-small"/>
@@ -98,8 +100,9 @@
<div class="input-group-btn">
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<form:option value="cfgKeywords"><spring:message code="keywords"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
</form:select>
</div>
@@ -258,7 +261,6 @@
</div>
</div>
</div>
<!-- /筛选搜索内容栏 结束-->
@@ -276,6 +278,7 @@
<th><spring:message code="whether_hexbinary"/></th>
<th><spring:message code="expression_type"/></th>
<th><spring:message code="match_method"/></th>
<th><spring:message code="do_log"/></th>
<%-- <th><spring:message code="block_type"/></th>
<th><spring:message code="whether_area_block"/></th>
<th><spring:message code="letter"/></th>
@@ -320,6 +323,11 @@
<td>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG')}" var="dict">
<c:if test="${cfg.doLog==dict.itemCode }"><spring:message code="${dict.itemValue}"/></c:if>
</c:forEach>
</td>
<%-- <td>

View File

@@ -5,7 +5,10 @@
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
initCommIpVal();
//initCommIpVal();
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#cfgFrom").validate({
errorPlacement: function(error,element){
@@ -75,7 +78,7 @@ $(function(){
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control required"/>
@@ -181,6 +184,28 @@ $(function(){
</div>
</div>
</div>
<!-- doLog -->
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</div>
</div>
<div class="row hidden">
<div class="col-md-6">
<div class="form-group">

View File

@@ -14,6 +14,8 @@
$("#intype").val("${cfg.destPort}");
} else if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
} else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
} else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -90,8 +92,8 @@
<div class="pull-left">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}"
labelName="parent.specServiceName"
<sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control input-small"/>
@@ -103,6 +105,7 @@
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="destIpAddress"><spring:message code="server_ip"></spring:message></form:option>
<form:option value="destPort"><spring:message code="server_port"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
</form:select>
@@ -262,7 +265,6 @@
</div>
</div>
</div>
<!-- /筛选搜索内容栏 结束-->
@@ -281,6 +283,7 @@
<th><spring:message code="server_ip"/></th>
<th><spring:message code="server_port"/></th>
<th><spring:message code="protocol"/></th>
<th><spring:message code="do_log"/></th>
<%-- <th><spring:message code="block_type"/></th> --%>
<%-- <th><spring:message code="whether_area_block"/></th> --%>
<%-- <th><spring:message code="letter"/></th>
@@ -320,6 +323,13 @@
</c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:if test="${dict.itemCode eq cfg.doLog }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</td>
<%-- <td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${dict.itemCode eq cfg.action }">

View File

@@ -199,7 +199,7 @@ var delContent = function(contentClassName, addBtnClassName) {
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName"
labelName="parent.specServiceName" notAllowSelectParent="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="0"
notAllowSelectRoot="true" cssClass="form-control required"/>

View File

@@ -130,8 +130,8 @@
<div class="pull-left">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}"
labelName="parent.specServiceName"
<sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control input-small"/>

View File

@@ -126,5 +126,60 @@
</c:if>
</c:forEach>
</c:if>
<!-- keywords -->
<c:if test="${region[0] eq 2 }">
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>
${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
<c:choose>
<c:when test="${cfg.exprType eq 1}"><spring:message code='and_expression'/></c:when>
<c:when test="${cfg.exprType eq 0}"><spring:message code='null_expression'/></c:when>
</c:choose>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${cfg.isHexbin==isHexbinC.itemCode }"><spring:message code="${isHexbinC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
</div>
</c:if>
</c:forEach>
</c:if>
</c:forEach>
</html>

View File

@@ -96,7 +96,7 @@ $(function(){
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control required"/>

View File

@@ -12,6 +12,8 @@
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.cfgKeywords}"){
$("#intype").val("${cfg.cfgKeywords}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -87,8 +89,8 @@
<div class="pull-left">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}"
labelName="parent.specServiceName"
<sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control input-small"/>
@@ -98,8 +100,9 @@
<div class="input-group-btn">
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<form:option value="cfgKeywords"><spring:message code="keywords"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
</form:select>
</div>
@@ -257,8 +260,6 @@
</div>
</div>
</div>
</div>
<!-- /筛选搜索内容栏 结束-->

View File

@@ -5,7 +5,10 @@
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
initCommIpVal();
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
$("#cfgFrom").validate({

View File

@@ -5,7 +5,11 @@
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
initCommIpVal();
//initCommIpVal();
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
$("#cfgFrom").validate({

View File

@@ -27,6 +27,8 @@
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){
$("#intype").val("${cfg.ntcSubscribeIdCfg.cfgKeywords}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else if("${cfg.voipAccount.cfgKeywords}"){
$("#intype").val("${cfg.voipAccount.cfgKeywords}");
}else{
@@ -360,6 +362,7 @@
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"/></form:option>
<form:option value="voipAccount.cfgKeywords"><spring:message code="account"/></form:option>
<form:option value="ntcSubscribeIdCfg.cfgKeywords"><spring:message code="NTC_SUBSCRIBE_ID"/></form:option>
</form:select>
@@ -533,6 +536,7 @@
<thead>
<tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th style="display: none"><spring:message code="cfg_id"/></th>
<th class="cfgDesc"><spring:message code="config_describe"/></th>
<th><spring:message code="block_type"/></th>
<th><spring:message code="do_log"/></th>
@@ -559,6 +563,7 @@
<span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" compileId="${indexCfg.compileId}" value="${indexCfg.isAudit}">
</td>
<td>${indexCfg.compileId }</td>
<td>${indexCfg.cfgDesc }</td>
<td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">

View File

@@ -13,14 +13,13 @@
$(document)
.ready(
function() {
initCommIpVal();
/* $("#cancel").on("click", function() {
window.history.back();
});
});*/
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
}); */
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
$("#cfgFrom").validate(

View File

@@ -27,6 +27,8 @@
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.voipIp.srcIpAddress}"){
$("#intype").val("${cfg.voipIp.srcIpAddress}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else if("${cfg.voipIp.srcPort}"){
$("#intype").val("${cfg.voipIp.srcPort}");
}else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){
@@ -426,6 +428,7 @@
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"/></form:option>
<form:option value="voipIp.srcIpAddress"><spring:message code="client_ip"/></form:option>
<form:option value="voipIp.srcPort"><spring:message code="client_port"/></form:option>
<form:option value="ntcSubscribeIdCfg.cfgKeywords"><spring:message code="NTC_SUBSCRIBE_ID"/></form:option>
@@ -601,6 +604,7 @@
<tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th class="cfgDesc"><spring:message code="config_describe"/></th>
<th style="display: none"><spring:message code="cfg_id"/></th>
<th><spring:message code="block_type"/></th>
<th><spring:message code="do_log"/></th>
<th><spring:message code="whether_area_block"/></th>
@@ -626,6 +630,7 @@
<span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" compileId="${indexCfg.compileId}" value="${indexCfg.isAudit}">
</td>
<td>${indexCfg.compileId }</td>
<td>${indexCfg.cfgDesc }</td>
<td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">

View File

@@ -3,11 +3,17 @@
<html>
<head>
<title><spring:message code="basic_protocol"></spring:message></title>
<style type="text/css">
.boxSolid {
border: 1px solid #eeeeee
}
</style>
<script type="text/javascript">
$(function(){
$("#cancel").on("click",function(){
window.history.back();
});
initCommIpVal();
// $("#cancel").on("click",function(){
// window.history.back();
// });
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
@@ -34,28 +40,45 @@ $(function(){
},
submitHandler: function(form){
var flag = true;
$("input[name$='cfgKeywords']").each(function(){
if($(this).val()==''){
$(this).parents(".form-group").find(
"div[for='"
+ $(this).attr("name")
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$("#keywordError").text()+"</label>");
flag = false;
}
})
$("select[name$='isHexbin']").each(function(){
//代表所有区域都隐藏了,提示必须增加个区域信息
/* if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
if($("#areaIsp").hasClass("hidden")) $("#areaIp").find(".glyphicon-plus").click();
if($("#areaIp").hasClass("hidden")) $("#areaIsp").find(".glyphicon-plus").click();
top.$.jBox.tip("<spring:message code='one_more_area'/>", "<spring:message code='info'/>");
return;
}
*/
var flag = true;
$(".boxSolid:visible").find("input[name$='cfgKeywords']").each(function(){
if($(this).val()==''){
$(this).parents(".form-group").find(
"div[for='"
+ $(this).attr("name")
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$("#keywordError").text()+"</label>");
flag = false;
}
})
//keywords非空校验完成校验二进制字符串
$(".boxSolid:visible").find("select[name$='isHexbin']").each(function(){
var isHexbin=$(this).val();
if(isHexbin == 1){ //十六进制
var keywords=$($(this).attr("name").replace("isHexbin","cfgKeywords")).val();
if(!(/^([0-9|a-f|A-F]*)$/.test(keywords))){
$(this).parents(".form-body").find(
"div[for='"
+ $(this).attr("name").replace("isHexbin","cfgKeywords")
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$.validator.messages.hexCheck+"</label>");
flag = false;
}
var keywords=$("input[name$='"+$(this).attr("name").replace("isHexbin","cfgKeywords")+"']").val();
if(keywords != ''){
if(!(/^([0-9|a-f|A-F]*)$/.test(keywords))){
$(this).parents(".boxSolid").find(
"div[for='"
+ $(this).attr("name").replace("isHexbin","cfgKeywords")
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$.validator.messages.hexCheck+"</label>");
flag = false;
}
}
}
});
var flag1=validateInvisibleCharTag();
if(flag){
flag=flag1;
}
if(flag){
//将disable属性的元素删除
$(".disabled").each(function(){
@@ -130,8 +153,10 @@ var delContent = function(contentClassName, addBtnClassName) {
<!-- desc and action -->
<c:set var="ipCfgIndex" value="0"></c:set>
<c:forEach items="${regionList}" var="region" varStatus="status">
<c:if test="${region.regionType eq 2 }">
<c:if test="${region.configServiceType eq 'app_policy' }">
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
<input type="hidden" name="cfgRegionCode" value="${region.configRegionCode}">
<div class="row">
@@ -143,9 +168,8 @@ var delContent = function(contentClassName, addBtnClassName) {
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="col-md-6">
<div class="form-group">
<c:set var="spec_service_id"><spring:message code="basic_protocol"/></c:set>
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="basic_protocol"/></label>
@@ -164,7 +188,8 @@ var delContent = function(contentClassName, addBtnClassName) {
<div class="col-md-6" id="behaviour">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
@@ -177,6 +202,7 @@ var delContent = function(contentClassName, addBtnClassName) {
<input type="radio" name="action"
serviceId="${service.serviceId }"
protocolId="${service.protocolId }"
regionCode="${service.regionCode }"
value="${service.action }" class="required action"
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
@@ -191,7 +217,27 @@ var delContent = function(contentClassName, addBtnClassName) {
<div for="action"></div>
</div>
</div>
<div class="col-md-6" id="ratelimit">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</div>
<div class="col-md-6 ratelimit" id="ratelimit">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ratelimit"/></label>
<div class="col-md-6">
@@ -202,6 +248,49 @@ var delContent = function(contentClassName, addBtnClassName) {
</div>
</div>
</c:if>
<!-- 关键字 -->
<c:set var="strCfgIndex" value="0"></c:set>
<c:set var="subscribeIndex" value="0"></c:set>
<c:if test="${region.configServiceType eq 'subscribe_id' }">
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
<h4 class="form-section">
<spring:message code="${region.configRegionValue}" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<c:set var="cfgName" value="ntcSubscribeIdCfgList[${subscribeIndex}]"></c:set>
<c:choose>
<c:when test="${fn:length(_cfg.ntcSubscribeIdCfgList)>0}">
<c:set var="isBreak" value="false" ></c:set>
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<c:choose>
<c:when test="${region.configRegionValue eq cfg.cfgType and !isBreak}">
<div class="row boxSolid ${tabName}${status.index}">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="isBreak" value="true" ></c:set>
<c:set var="subscribeIndex" value="${subscribeIndex+1 }"></c:set>
</c:when>
</c:choose>
</c:forEach>
<c:if test="${!isBreak}">
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="subscribeIndex" value="${subscribeIndex+1 }"></c:set>
</c:if>
</c:when>
<c:otherwise>
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="subscribeIndex" value="${subscribeIndex+1 }"></c:set>
</c:otherwise>
</c:choose>
</c:if>
<!-- 关键字结束 -->
</c:if>
<c:if test="${region.regionType eq 1 }">
<h4 class="form-section">

View File

@@ -126,5 +126,59 @@
</c:if>
</c:forEach>
</c:if>
<!-- keywords -->
<c:if test="${region[0] eq 2 }">
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>
${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
<c:choose>
<c:when test="${cfg.exprType eq 1}"><spring:message code='and_expression'/></c:when>
<c:when test="${cfg.exprType eq 0}"><spring:message code='null_expression'/></c:when>
</c:choose>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${cfg.isHexbin==isHexbinC.itemCode }"><spring:message code="${isHexbinC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
</div>
</c:if>
</c:forEach>
</c:if>
</c:forEach>
</html>

View File

@@ -10,6 +10,10 @@
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){
$("#intype").val("${cfg.ntcSubscribeIdCfg.cfgKeywords}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -31,6 +35,7 @@
$(".Wdate").attr("value",'');
$("#level").attr("value",'');
$("#searchForm")[0].reset();
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
});
//异步获取策略ip相关信息
$("span[id^=open]").click(function(){
@@ -130,7 +135,7 @@
<div class="pull-left">
<c:set var="spec_service_id"><spring:message code="basic_protocol"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}"
<sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
@@ -142,6 +147,8 @@
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<form:option value="ntcSubscribeIdCfg.cfgKeywords"><spring:message code="APP_SUBSCRIBE_ID"></spring:message></form:option>
</form:select>
</div>
@@ -311,11 +318,13 @@
<thead>
<tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th style="display: none"><spring:message code="cfg_id"/></th>
<th class="cfgDesc"><spring:message code="config_describe"/></th>
<th><spring:message code="basic_protocol"/></th>
<%-- <th><spring:message code="behaviour_type"/></th> --%>
<th><spring:message code="ratelimit"/></th>
<th><spring:message code="block_type"/></th>
<th><spring:message code="do_log"/></th>
<th><spring:message code="whether_area_block"/></th>
<th><spring:message code="letter"/></th>
<th><spring:message code="classification"/></th>
@@ -339,6 +348,7 @@
<span id="open${status.index}" class="" compileId="${cfg.compileId}" cfgId="${cfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
<input type="checkbox" class="i-checks child-checks" id="${cfg.cfgId}" value="${cfg.isAudit}">
</td>
<td>${cfg.compileId }</td>
<td>${cfg.cfgDesc }</td>
<td>${cfg.appName }</td>
<%-- <td>${cfg.behavName }</td> --%>
@@ -350,6 +360,13 @@
</c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:if test="${dict.itemCode eq cfg.doLog }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</td>
<td>
<c:if test="${cfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
<c:if test="${cfg.isAreaEffective==1}">

View File

@@ -9,7 +9,245 @@ $(function(){
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
}
initCommIpVal();
//initCommIpVal();
var serviceType=$("input[name='cfgRegionCode']").attr("serviceType");
if(serviceType){
if(serviceType.indexOf("ipaddr")>-1&&$("input[name$='action']:checked").val()==32){
$("select[name$='protocol'] option").each(function(){
if($(this).attr("value")==1){
$(this).removeAttr("disabled");
}
});
$("select[name$='protocol']").selectpicker("refresh");
}
if(serviceType&&serviceType.indexOf("ipaddr")>-1&&$("input[name$='action']").val()==32){
$("select[name$='protocol'] option").each(function(){
if($(this).attr("value")==1){
$(this).removeAttr("disabled");
}
});
$("select[name$='protocol']").selectpicker("refresh");
}
if(serviceType.indexOf("ipmulitiplex")>-1){
$(".ipmulitiplex").removeClass("hidden");
$("input[name$='isAreaEffective']").each(function(){
if($(this).val()==0){
$(this).click();
}
})
$(".areaInfo").addClass("hidden");
}else{
$(".areaInfo").removeClass("hidden");
$(".ipmulitiplex").addClass("hidden");
}
if(serviceType.indexOf("ratelimit")>-1){
if($("input[name$='action']").val()==64||$("input[name$='action']:checked").val()==64){
$(".ratelimit").removeClass("hidden");
}else{
$(".ratelimit").addClass("hidden");
}
}else{
$(".ratelimit").addClass("hidden");
}
}
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
var actionCode=$(this).val();
var regionCode=$(this).attr("regionCode");
if(!regionCode){
regionCode=$("input[name='action']").attr("regionCode");
}
if(regionCode){
if(regionCode.indexOf(",")==-1){
$("#cfgRegionCode"+regionCode).attr("name","cfgRegionCode");
$("#cfgType"+regionCode).attr("name","cfgType");
$("[id^='cfgRegionCode']").each(function(){
if($(this).attr("id")==("cfgRegionCode"+regionCode)){
$(this).attr("name","cfgRegionCode");
}else{
$(this).removeAttr("name");
}
});
$("[id^='cfgType']").each(function(){
if($(this).attr("id")==("cfgType"+regionCode)){
$(this).attr("name","cfgType");
}else{
$(this).removeAttr("name");
}
});
}else{
var _region='';
var regionArr=regionCode.split(',');
$("input[name$='cfgRegionCode'][regionType='1']").each(function(){
for(var re in regionArr){
if($(this).val()==regionArr[re]){
serviceType=$(this).attr("serviceType");
_region=regionArr[re];
break;
}
}
});
if(_region!=''){
regionCode=_region;
}
}
var 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");
//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");
}
}
if(ipType){
var arr=ipType.split(',');
$("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).attr("disabled",true);
}
});
$("select[name$='ipType']").selectpicker("refresh");
}
if(ipPattern){
arr=ipPattern.split(',');
$("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).attr("disabled",true);
}
});
$("select[name$='ipPattern']").selectpicker("refresh");
}
if(portPattern){
arr=portPattern.split(',');
$("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).attr("disabled",true);
}
});
$("select[name$='portPattern']").selectpicker("refresh");
}
if(direction){
arr=direction.split(',');
$("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).attr("disabled",true);
}
});
$("select[name$='direction']").selectpicker("refresh");
}
if(protocol){
arr=protocol.split(',');
$("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).attr("disabled",true);
}
});
$("select[name$='protocol']").selectpicker("refresh");
}
//处理自定义字段
var serviceType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("serviceType");
if(serviceType){
if(serviceType.indexOf("ipaddr")>-1){
if($(this).val()==32){
$("select[name$='protocol'] option[value='1']").removeAttr("disabled")
}else{
$("select[name$='protocol'] option[value='1']").attr("disabled",true);
}
$("select[name$='protocol']").selectpicker("refresh");
}
if(serviceType.indexOf("ipmulitiplex")>-1){
$(".ipmulitiplex").removeClass("hidden");
}else{
$(".ipmulitiplex").addClass("hidden");
}
if(serviceType.indexOf("ratelimit")>-1){
if($(this).val()==64){
$(".ratelimit").removeClass("hidden");
}else{
$(".ratelimit").addClass("hidden");
}
}else{
$(".ratelimit").addClass("hidden");
}
if($(this).val()==0x20||$(this).val()==0x60){
$("input[name$='isAreaEffective']").each(function(){
if($(this).val()==0){
$(this).click();
}
})
}
}
}
});
$("#ipCfgFrom").validate({
errorPlacement: function(error,element){
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);

View File

@@ -5,14 +5,14 @@
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
initCommIpVal();
//initCommIpVal();
/* $("#cancel").on("click",function(){
window.history.back();
});
});*/
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
}); */
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
$("#cfgFrom").validate({

View File

@@ -5,9 +5,10 @@
<title><spring:message code="encrypted_tunnel_behavior"></spring:message></title>
<script type="text/javascript">
$(function(){
$("#cancel").on("click",function(){
initCommIpVal();
/* $("#cancel").on("click",function(){
window.history.back();
});
}); */
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
@@ -181,6 +182,7 @@ var delContent = function(contentClassName, addBtnClassName) {
<c:set var="ipCfgIndex" value="0"></c:set>
<c:forEach items="${regionList}" var="region" varStatus="status">
<c:if test="${region.regionType eq 2 }">
<c:if test="${region.configServiceType eq 'app_policy' }">
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
<input type="hidden" name="cfgRegionCode" value="${region.configRegionCode}">
<div class="row">
@@ -231,6 +233,7 @@ var delContent = function(contentClassName, addBtnClassName) {
<input type="radio" name="action"
serviceId="${service.serviceId }"
protocolId="${service.protocolId }"
regionCode="${service.regionCode }"
value="${service.action }" class="required action"
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
@@ -245,6 +248,26 @@ var delContent = function(contentClassName, addBtnClassName) {
<div for="action"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</div>
<div class="col-md-6" id="ratelimit">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ratelimit"/></label>
@@ -254,8 +277,49 @@ var delContent = function(contentClassName, addBtnClassName) {
<div for="ratelimit"></div>
</div>
</div>
</div>
</c:if>
<!-- 关键字 -->
<c:set var="subscribeIndex" value="0"></c:set>
<c:if test="${region.configServiceType eq 'subscribe_id' }">
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
<h4 class="form-section">
<spring:message code="${region.configRegionValue}" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<c:set var="cfgName" value="ntcSubscribeIdCfgList[${subscribeIndex}]"></c:set>
<c:choose>
<c:when test="${fn:length(_cfg.ntcSubscribeIdCfgList)>0}">
<c:set var="isBreak" value="false" ></c:set>
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<c:choose>
<c:when test="${region.configRegionValue eq cfg.cfgType and !isBreak}">
<div class="row boxSolid ${tabName}${status.index}">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="isBreak" value="true" ></c:set>
<c:set var="subscribeIndex" value="${subscribeIndex+1 }"></c:set>
</c:when>
</c:choose>
</c:forEach>
<c:if test="${!isBreak}">
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="subscribeIndex" value="${subscribeIndex+1 }"></c:set>
</c:if>
</c:when>
<c:otherwise>
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="subscribeIndex" value="${subscribeIndex+1 }"></c:set>
</c:otherwise>
</c:choose>
</c:if>
<!-- 关键字结束 -->
</c:if>
<c:if test="${region.regionType eq 1 }">
<h4 class="form-section">
@@ -285,6 +349,7 @@ var delContent = function(contentClassName, addBtnClassName) {
</c:otherwise>
</c:choose>
</c:if>
</c:forEach>
<%@include file="/WEB-INF/include/form/areaInfo.jsp" %>
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>

View File

@@ -126,5 +126,60 @@
</c:if>
</c:forEach>
</c:if>
<!-- keywords -->
<c:if test="${region[0] eq 2 }">
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>
${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
<c:choose>
<c:when test="${cfg.exprType eq 1}"><spring:message code='and_expression'/></c:when>
<c:when test="${cfg.exprType eq 0}"><spring:message code='null_expression'/></c:when>
</c:choose>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${cfg.isHexbin==isHexbinC.itemCode }"><spring:message code="${isHexbinC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
</div>
</c:if>
</c:forEach>
</c:if>
</c:forEach>
</html>

View File

@@ -10,6 +10,10 @@
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){
$("#intype").val("${cfg.ntcSubscribeIdCfg.cfgKeywords}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -31,6 +35,7 @@
$(".Wdate").attr("value",'');
$("#level").attr("value",'');
$("#searchForm")[0].reset();
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
});
//异步获取策略ip相关信息
$("span[id^=open]").click(function(){
@@ -130,7 +135,7 @@
<div class="pull-left">
<c:set var="spec_service_id"><spring:message code="encrypted_tunnel_behavior"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}"
<sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
@@ -142,6 +147,8 @@
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<form:option value="ntcSubscribeIdCfg.cfgKeywords"><spring:message code="APP_SUBSCRIBE_ID"></spring:message></form:option>
</form:select>
</div>
@@ -311,11 +318,13 @@
<thead>
<tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th style="display: none"><spring:message code="cfg_id"/></th>
<th class="cfgDesc"><spring:message code="config_describe"/></th>
<th><spring:message code="encrypted_tunnel_behavior"/></th>
<th><spring:message code="behaviour_type"/></th>
<th><spring:message code="ratelimit"/></th>
<th><spring:message code="block_type"/></th>
<th><spring:message code="do_log"/></th>
<th><spring:message code="whether_area_block"/></th>
<th><spring:message code="letter"/></th>
<th><spring:message code="classification"/></th>
@@ -339,6 +348,7 @@
<span id="open${status.index}" class="" compileId="${cfg.compileId}" cfgId="${cfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
<input type="checkbox" class="i-checks child-checks" id="${cfg.cfgId}" value="${cfg.isAudit}">
</td>
<td>${cfg.compileId }</td>
<td>${cfg.cfgDesc }</td>
<td>${cfg.appName }</td>
<td>${cfg.behavName }</td>
@@ -350,6 +360,13 @@
</c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:if test="${dict.itemCode eq cfg.doLog }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</td>
<td>
<c:if test="${cfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
<c:if test="${cfg.isAreaEffective==1}">

View File

@@ -11,9 +11,6 @@ $(function(){
$("#file").on('change',function(){
$("#fileInfo").val($("#file").val());
});
$("#cancel").on("click",function(){
window.history.back();
});
$(".action").on("change",function(){
$("#serviceId").val($(this).attr("serviceId"));
});

View File

@@ -13,7 +13,7 @@
$(document)
.ready(
function() {
initCommIpVal();
// initCommIpVal();
/* $("#cancel").on("click", function() {
window.history.back();
});
@@ -191,6 +191,28 @@
</div>
</div>
</div>
<!-- dolog begin-->
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</div>
</div>
<c:set var="ipCfgIndex" value="0"></c:set>
<c:set var="strCfgIndex" value="0"></c:set>
<c:forEach items="${regionList}" var="region" varStatus="status">
@@ -226,6 +248,7 @@
<!--/ip info-->
</c:if>
<c:if test="${region.regionType eq 2 }">
<c:if test="${region.configServiceType eq 'keywords' }">
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
<h4 class="form-section">
<spring:message code="${region.configRegionValue}" />
@@ -264,6 +287,48 @@
</c:otherwise>
</c:choose>
</c:if>
<!-- 关键字 -->
<c:set var="subscribeIndex" value="0"></c:set>
<c:if test="${region.configServiceType eq 'subscribe_id' }">
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
<h4 class="form-section">
<spring:message code="${region.configRegionValue}" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<c:set var="cfgName" value="ntcSubscribeIdCfgList[${subscribeIndex}]"></c:set>
<c:choose>
<c:when test="${fn:length(_cfg.ntcSubscribeIdCfgList)>0}">
<c:set var="isBreak" value="false" ></c:set>
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<c:choose>
<c:when test="${region.configRegionValue eq cfg.cfgType and !isBreak}">
<div class="row boxSolid ${tabName}${status.index}">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="isBreak" value="true" ></c:set>
<c:set var="subscribeIndex" value="${subscribeIndex+1 }"></c:set>
</c:when>
</c:choose>
</c:forEach>
<c:if test="${!isBreak}">
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="subscribeIndex" value="${subscribeIndex+1 }"></c:set>
</c:if>
</c:when>
<c:otherwise>
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="subscribeIndex" value="${subscribeIndex+1 }"></c:set>
</c:otherwise>
</c:choose>
</c:if>
<!-- 关键字结束 -->
</c:if>
</c:forEach>
<br>
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>

View File

@@ -10,6 +10,10 @@
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){
$("#intype").val("${cfg.ntcSubscribeIdCfg.cfgKeywords}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -31,6 +35,7 @@
$(".Wdate").attr("value",'');
$("#level").attr("value",'');
$("#searchForm")[0].reset();
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
});
//异步获取voip相关信息
$("span[id^=open]").click(function(){
@@ -132,6 +137,8 @@
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<form:option value="ntcSubscribeIdCfg.cfgKeywords"><spring:message code="APP_SUBSCRIBE_ID"></spring:message></form:option>
<%-- <form:option value="voipIp.srcIpAddress"><spring:message code="client_ip"/></form:option>
<form:option value="voipIp.srcPort"><spring:message code="client_port"/></form:option>
<form:option value="voipAccount.cfgKeywords"><spring:message code="key_word"/></form:option>
@@ -305,8 +312,10 @@
<thead>
<tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th style="display: none"><spring:message code="cfg_id"/></th>
<th class="cfgDesc"><spring:message code="config_describe"/></th>
<th><spring:message code="block_type"/></th>
<th><spring:message code="do_log"/></th>
<th><spring:message code="whether_area_block"/></th>
<th><spring:message code="letter"/></th>
<th><spring:message code="classification"/></th>
@@ -330,6 +339,7 @@
<span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
</td>
<td>${indexCfg.compileId }</td>
<td>${indexCfg.cfgDesc }</td>
<td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
@@ -338,6 +348,13 @@
</c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:if test="${dict.itemCode eq cfg.doLog }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</td>
<td>
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
<c:if test="${indexCfg.isAreaEffective==1}">

View File

@@ -172,6 +172,59 @@
</div>
</c:if>
</c:forEach>
<!-- subscribe_id-->
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>
${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
<c:choose>
<c:when test="${cfg.exprType eq 1}"><spring:message code='and_expression'/></c:when>
<c:when test="${cfg.exprType eq 0}"><spring:message code='null_expression'/></c:when>
</c:choose>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${cfg.isHexbin==isHexbinC.itemCode }"><spring:message code="${isHexbinC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
</div>
</c:if>
</c:forEach>
</c:if>
<%-- <c:if test="${region[0] eq 5 }">
<c:forEach items="${_cfg.digestList}" var="cfg">

View File

@@ -9,6 +9,8 @@
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -132,6 +134,7 @@
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<%-- <form:option value="voipIp.srcIpAddress"><spring:message code="client_ip"/></form:option>
<form:option value="voipIp.srcPort"><spring:message code="client_port"/></form:option>
<form:option value="voipAccount.cfgKeywords"><spring:message code="key_word"/></form:option>
@@ -306,6 +309,7 @@
<thead>
<tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th style="display: none"><spring:message code="cfg_id"/></th>
<th class="cfgDesc"><spring:message code="config_describe"/></th>
<th><spring:message code="block_type"/></th>
<th><spring:message code="do_log"/></th>
@@ -332,6 +336,7 @@
<span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
</td>
<td>${indexCfg.compileId }</td>
<td>${indexCfg.cfgDesc }</td>
<td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">

View File

@@ -13,14 +13,14 @@
$(document)
.ready(
function() {
initCommIpVal();
//initCommIpVal();
/* $("#cancel").on("click", function() {
window.history.back();
});
});*/
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
}); */
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));

View File

@@ -5,38 +5,6 @@
<title><spring:message code="domain_whitelist"></spring:message></title>
<script type="text/javascript">
$(function(){
switchIpType($("select[name$='ipType']"));
areaControlInit();
$("input[name='isAreaEffective']").on('change',function(){
var val=$(this).val();
if(val==1){
$(".areaType").removeClass("hidden");
if($("input[name='areaType']:checked").val()==1){//areaISP
$("#areaIsp").removeClass("hidden");
}else if($("input[name='areaType']:checked").val()==0){//areaIp
$("#areaIp").removeClass("hidden");
}
}else{
$(".areaType").addClass("hidden");
$("#areaIp").addClass("hidden");
$("#areaIsp").addClass("hidden");
}
});
$("input[name='areaType']").on('change',function(){
var val=$(this).val();
if($(this).is(":visible")){
if(val==0){
$("#areaIp").removeClass("hidden");
$("#areaIsp").addClass("hidden");
}else{
$("#areaIsp").removeClass("hidden");
$("#areaIp").addClass("hidden");
}
}else{
$("#areaIsp").addClass("hidden");
$("#areaIp").addClass("hidden");
}
});
$(".action").on("change",function(){
$("#serviceId").val($(this).attr("serviceId"));
});
@@ -50,12 +18,6 @@ $(function(){
},
errorContainer: "#messageBox",
});
$("select[name$='ipType']").on("change",function(){
switchIpType($(this));
});
$("#cancel").on("click",function(){
window.history.back();
});
});
</script>
</head>

View File

@@ -6,7 +6,9 @@
<script type="text/javascript">
$(function(){
switchIpInfo($("select[name$='ipType']"),"ipType");
initCommIpVal();
$(".action").on("change",function(){
$("#serviceId").val($(this).attr("serviceId"));
});
$("#ipCfgFrom").validate({
errorPlacement: function(error,element){
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);

View File

@@ -6,6 +6,7 @@
P2P<spring:message code="log"></spring:message>
</title>
<script>
$(document).ready(function() {
//reset
$("#resetBtn").on("click",function(){
@@ -21,7 +22,7 @@
$("#searchForm")[0].reset();
});
//筛选功能
filterActionInit();
filterActionInit();
});
</script>
</head>
@@ -48,15 +49,27 @@
<!-- 搜索内容与操作按钮栏 -->
<div class="col-md-12">
<div class="pull-left">
<select path="action" class="selectpicker select2 input-small">
<option value=""><spring:message code="action"/></option>
<c:forEach items="${serviceList}" var="service"
varStatus="satus">
<select id="action" path="action" class="selectpicker select2 input-small">
<c:set var="actionIndex" value="0"></c:set>
<c:forEach items="${serviceList}" var="service" varStatus="satus">
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${(dict.itemCode eq service.action) && (service.action ne 128) && (service.action ne 32)}"> --%>
<option value="${dict.itemCode}"
<c:if test="${(dict.itemCode eq service.action) && (service.action ne 128) && (service.action ne 32)}">
<c:set var="actionIndex" value="${actionIndex+1}"></c:set>
</c:if>
</c:forEach>
</c:forEach>
<c:if test="${ (actionIndex > 1) || (actionIndex == 0) }">
<option value=""><spring:message code="action"/></option>
</c:if>
<c:forEach items="${serviceList}" var="service" varStatus="satus">
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${(dict.itemCode eq service.action) && (service.action ne 128) && (service.action ne 32)}">
<option value="${dict.itemCode}"
<c:if test="${log.action eq dict.itemCode}">
selected
selected="selected"
</c:if>
>
<spring:message code="${dict.itemValue}"/>

View File

@@ -81,6 +81,14 @@
$(this).addClass("hidden");
$(this).find("[name='parent.specServiceId']").removeAttr("name");
$(this).find("[name='parent.specServiceName']").removeAttr("name");
$(this).find("[name='businessType']").removeAttr("name");
}else{
var cfgType=$(this).attr("cfgType");
if("${specificServiceCfg.parent.specServiceId}"&& "${specificServiceCfg.parent.specServiceId}"!="0"){
$("#businessType"+cfgType).parents(".businessType").addClass("hidden");
}else{
$("#businessType"+cfgType).parents(".businessType").removeClass("hidden");
}
}
});
$(".protocol_code").html('<font color="red">*</font><spring:message code="app_code"/>:');
@@ -92,6 +100,15 @@
$(this).addClass("hidden");
$(this).find("[name='parent.specServiceId']").removeAttr("name");
$(this).find("[name='parent.specServiceName']").removeAttr("name");
$(this).find("[name='businessType']").removeAttr("name");
}else{
var cfgType=$(this).attr("cfgType");
if("${specificServiceCfg.parent.specServiceId}"&& "${specificServiceCfg.parent.specServiceId}"!="0"){
$("#businessType"+cfgType).parents(".businessType").addClass("hidden");
}else{
$("#businessType"+cfgType).parents(".businessType").removeClass("hidden");
}
}
});
if($("[name='cfgType']").val()==1){
@@ -113,13 +130,25 @@
$("[name=cfgType]").val(cfgType);
$(".cfgType").each(function(){
if($(this).attr("cfgType")==cfgType){
$(this).removeClass("hidden");
$("#specificServiceCfg"+cfgType+"Id").attr("name","parent.specServiceId");
$("#specificServiceCfg"+cfgType+"Name").attr("name","parent.specServiceName");
$("#businessType"+cfgType).attr("name","businessType");
if($(this).hasClass("businessType")){
var parentId=$("#specificServiceCfg"+cfgType+"Id").val();
if(parentId!=0){
$(this).addClass("hidden");
}else{
$(this).removeClass("hidden");
}
}else{
$(this).removeClass("hidden");
}
}else{
$(this).addClass("hidden");
$(this).find("[name='parent.specServiceId']").removeAttr("name");
$(this).find("[name='parent.specServiceName']").removeAttr("name");
$(this).find("[name='businessType']").removeAttr("name");
}
});
if(cfgType==1){
@@ -136,6 +165,15 @@
$(".protocol_desc").html('<spring:message code="protocol_desc"/>:');
}
});
$("#specificServiceCfg1Id,#specificServiceCfg2Id,#specificServiceCfg3Id").on("change",function(){
var cfgType=$(this).parents(".cfgType").attr("cfgType");
if($(this).val()==0){
$("#businessType"+cfgType).parents(".businessType").removeClass("hidden");
}else{
$("#businessType"+cfgType).selectpicker("val","");
$("#businessType"+cfgType).parents(".businessType").addClass("hidden");
}
});
});
</script>
</head>
@@ -197,6 +235,49 @@
</div>
<div for="parent.specServiceName"></div>
</div>
<div class="form-group cfgType businessType
<c:if test='${specificServiceCfg.parent.specServiceId ne null or specificServiceCfg.parent.specServiceId ne 0}'>hidden</c:if>" cfgType="${dict.itemCode}">
<c:if test="${dict.itemCode==1}">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="app_business_type"/>:</label>
<div class="col-md-4">
<select id="businessType1" name="businessType" class="form-control required">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('APP_BUSINESS_TYPE')}" var="dict">
<option value="${dict.itemCode}"
<c:if test="${dict.itemCode==specificServiceCfg.businessType}">selected</c:if>
><spring:message code="${dict.itemValue}"/></option>
</c:forEach>
</select>
</div>
</c:if>
<c:if test="${dict.itemCode==3}">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="basic_protocol_business_type"/>:</label>
<div class="col-md-4">
<select id="businessType3" name="businessType" class="form-control required">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('BASIC_PROTOCOL_BUSINESS_TYPE')}" var="dict">
<option value="${dict.itemCode}"
<c:if test="${dict.itemCode==specificServiceCfg.businessType}">selected</c:if>
><spring:message code="${dict.itemValue}"/></option>
</c:forEach>
</select>
</div>
</c:if>
<c:if test="${dict.itemCode==2}">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="tunnel_behavior_business_type"/>:</label>
<div class="col-md-4">
<select id="businessType2" name="businessType" class="form-control required">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('TUNNEL_BEHAV_BUSINESS_TYPE')}" var="dict">
<option value="${dict.itemCode}"
<c:if test="${dict.itemCode==specificServiceCfg.businessType or (specificServiceCfg.parent.specServiceId eq null or specificServiceCfg.parent.specServiceId eq 0)}">selected</c:if>
><spring:message code="${dict.itemValue}"/></option>
</c:forEach>
</select>
</div>
</c:if>
<div for="businessType"></div>
</div>
</c:forEach>
<div class="form-group">
<label class="col-md-3 control-label protocol_code"><font color="red">*</font><spring:message code="protocol_code"/>:</label>
@@ -219,6 +300,7 @@
</div>
<div for="groupId"></div>
</div>
<div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="is_leaf"/>:</label>
<div class="col-md-4">
@@ -248,7 +330,7 @@
<div class="row">
<div class="col-md-offset-3 col-md-9">
<shiro:hasPermission name="specific:service:edit"><button type="submit" class="btn btn-circle blue"><spring:message code="submit"/></button></shiro:hasPermission>
<button type="button" class="btn btn-circle grey-salsa btn-outline" onclick="history.go(-1)"><spring:message code="cancel"/></button>
<button type="button" class="btn btn-circle grey-salsa btn-outline" id="cancel" ><spring:message code="cancel"/></button>
</div>
</div>
</div>

View File

@@ -213,32 +213,44 @@
<!-- 筛选搜索内容栏默认隐藏-->
<div class="col-md-12 filter-action-select-panle hide" >
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="operate_time"/></label>
<input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${specificServiceCfg.beginDate}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>&nbsp;</label>
<input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${specificServiceCfg.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="business_type"/></label>
<form:select path="businessType" class="selectpicker select2 input-middle" >
<form:option value=""><spring:message code='business_type'/></form:option>
<c:if test="${specificServiceCfg.cfgType==1}">
<c:forEach items="${fns:getDictList('APP_BUSINESS_TYPE') }" var="dict">
<form:option value="${dict.itemCode}"><spring:message code='${dict.itemValue}'/></form:option>
</c:forEach>
</c:if>
<c:if test="${specificServiceCfg.cfgType==2}">
<c:forEach items="${fns:getDictList('TUNNEL_BEHAV_BUSINESS_TYPE') }" var="dict">
<form:option value="${dict.itemCode}"><spring:message code='${dict.itemValue}'/></form:option>
</c:forEach>
</c:if>
<c:if test="${specificServiceCfg.cfgType==3}">
<c:forEach items="${fns:getDictList('BASIC_PROTOCOL_BUSINESS_TYPE') }" var="dict">
<form:option value="${dict.itemCode}"><spring:message code='${dict.itemValue}'/></form:option>
</c:forEach>
</c:if>
</form:select>
</div>
</div>
</div>
</div>
<!-- /筛选搜索内容栏 结束-->
@@ -258,6 +270,7 @@
<tr>
<th><input type="checkbox" class="ckboxs" id="selAll" onclick="selectAll()"></th>
<!-- <th>序号</th> -->
<th><spring:message code="business_type"/></th>
<th><spring:message code="protocol_code"/></th>
<th><spring:message code="protocol_name"/></th>
<th><spring:message code="protocol_desc"/></th>
@@ -272,6 +285,29 @@
<tr id="${specificServiceCfg.specServiceId}" pId="${specificServiceCfg.parent.specServiceId ne 0?specificServiceCfg.parent.specServiceId:0}">
<td><input type="checkbox" class="ckbox" name="check" value="${specificServiceCfg.specServiceId}"></td>
<%-- <td>${specificServiceCfg.showSequence}</td> --%>
<td title="${specificServiceCfg.businessType}">
<c:if test="${specificServiceCfg.cfgType==1}">
<c:forEach items="${fns:getDictList('APP_BUSINESS_TYPE') }" var="dict">
<c:if test="${specificServiceCfg.businessType==dict.itemCode}">
<spring:message code="${dict.itemValue}"/>
</c:if>
</c:forEach>
</c:if>
<c:if test="${specificServiceCfg.cfgType==2}">
<c:forEach items="${fns:getDictList('TUNNEL_BEHAV_BUSINESS_TYPE') }" var="dict">
<c:if test="${specificServiceCfg.businessType==dict.itemCode}">
<spring:message code="${dict.itemValue}"/>
</c:if>
</c:forEach>
</c:if>
<c:if test="${specificServiceCfg.cfgType==3}">
<c:forEach items="${fns:getDictList('BASIC_PROTOCOL_BUSINESS_TYPE') }" var="dict">
<c:if test="${specificServiceCfg.businessType==dict.itemCode}">
<spring:message code="${dict.itemValue}"/>
</c:if>
</c:forEach>
</c:if>
</td>
<td nowrap><i class="icon-icon-tablet"></i><%--<a href="${ctx}/specific/specificServiceCfg/form?specServiceId=${specificServiceCfg.specServiceId}&doAction=0">--%>${specificServiceCfg.specServiceCode}<%--</a>--%></td>
<td title="${specificServiceCfg.specServiceName}">${specificServiceCfg.specServiceName}</td>
<td title="${specificServiceCfg.specServiceDesc}">${fns:abbr(specificServiceCfg.specServiceDesc,15)}</td>

View File

@@ -202,6 +202,13 @@ jQuery.validator.addMethod("domainCheck",function(value, element) {
//ip地址校验
jQuery.validator.addMethod("ipCheck",function(value, element) {
var ipv4_ip_subnet_regexp=/^(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\/(3[0-2]|[1-2][0-9]|[0-9])$/;
var ipv6_ip_subnet_regexp=/^((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3}))\/(0|2|4|8|16|32|64|128)$/;
var ipv4_ip_range_regexp=/^(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)-(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)$/;
var ipv6_ip_range_regexp=/^((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3}))((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3}))$/;
var ipv4_ip_regexp=/^(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)$/;
var ipv6_ip_regexp=/^((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3}))$/;
if(value.length==0||value.trim().length==0){return true;}
var typeInt=$(element).parents(".row").parent(".row").find("select[name$='ipType']").val();
var ipPattern=$(element).parents(".row").parent(".row").find("select[name$='ipPattern']").val();
@@ -239,42 +246,52 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
if(ipPattern){
if(ipPattern==1){//ip/掩码格式
if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\/(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5<=32))){
return true;
if(ipv4_ip_subnet_regexp.test(value)){
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ipMask;
return false;
}
}else if(RegExp.$5&&RegExp.$5>32){
$.validator.messages.ipCheck=$.validator.messages.ipMaskRange;
return false;
}else{
$.validator.messages.ipCheck=$.validator.messages.ipMask;
return false;
}
}else if(ipPattern==2){//ip range
//A类 0.0.0.0-127.255.255.255 默认掩码255.0.0.0
//B类128.0.0.0-191.255.255.255 默认掩码255.255.0.0
//C类192.0.0.0-223.255.255.255 默认掩码255.255.255.0
if(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\-(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value)&&(RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5 <256 && RegExp.$6<256 && RegExp.$7<256 && RegExp.$8<256)){
var startPart0= RegExp.$1;
var startPart1= RegExp.$5;
if((startPart0<128&&startPart1<128)||(startPart0>127&&startPart1>127&&startPart0<192&&startPart1<192)
||(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224)
||(startPart0>223&&startPart1>223&&startPart0<240&&startPart1<240)
||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){
if(ipv4_ip_range_regexp.test(value)){
if(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\-(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value)&&(RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5 <256 && RegExp.$6<256 && RegExp.$7<256 && RegExp.$8<256)){
var startPart0= RegExp.$1;
var startPart1= RegExp.$5;
if((startPart0<128&&startPart1<128)||(startPart0>127&&startPart1>127&&startPart0<192&&startPart1<192)
||(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224)
||(startPart0>223&&startPart1>223&&startPart0<240&&startPart1<240)
||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){
}else{
$.validator.messages.ipCheck=$.validator.messages.ipRange;
return false;
}
var startIp=value.split("-")[0];
var endIp=value.split("-")[1];
if(ipToNumber(startIp)<=ipToNumber(endIp)){//比较IP大小
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ipRange1;
return false;
}
}else{
$.validator.messages.ipCheck=$.validator.messages.ipRange;
return false;
}
var startIp=value.split("-")[0];
var endIp=value.split("-")[1];
if(ipToNumber(startIp)<=ipToNumber(endIp)){//比较IP大小
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ipRange1;
return false;
}
}else{
$.validator.messages.ipCheck=$.validator.messages.ipRange;
return false;
}
}else if(ipPattern==3){//ip格式
if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256))){
if(this.optional(element)||ipv4_ip_regexp.test(value)){
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ip;
@@ -282,7 +299,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
}
}
}else{//兼容原来的验证
if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256))){
if(this.optional(element)||ipv4_ip_regexp.test(value)){
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ip;
@@ -291,7 +308,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
}
}else if(typeInt==6){
if(ipPattern==1){//ip/掩码格式
if(this.optional(element)||(/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*\/(0|2|4|8|16|32|64|128)$/.test(value))){
if(this.optional(element)||ipv6_ip_subnet_regexp.test(value)){
return true;
}else if(value.indexOf("/")==-1){
$.validator.messages.ipCheck=$.validator.messages.ipMask;
@@ -302,7 +319,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
$.validator.messages.ipCheck=$.validator.messages.ipMask;
return false;
}else{
if(!/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*$/.test(ipMaskArr[0])){
if(!ipv6_ip_regexp.test(ipMaskArr[0])){
$.validator.messages.ipCheck=$.validator.messages.ipPart;
return false;
}else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){
@@ -316,9 +333,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
}
}else if(ipPattern==2){//ip range
$.validator.messages.ipCheck=$.validator.messages.ipRange;
var _exp="\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*";
var exp=new RegExp("^"+_exp+"-"+_exp+"$","");
if(exp.test(value)){
if(ipv6_ip_range_regexp.test(value)){
var ipArr=value.split("-");
var startIp=fillIp(ipArr[0]);
var endIp=fillIp(ipArr[1]);
@@ -330,14 +345,14 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
}
return false;
}else if(ipPattern==3){//ip格式
if(this.optional(element)||/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*$/.test(value)){
if(this.optional(element)||ipv6_ip_regexp.test(value)){
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ip;
return false;
}
}else{//兼容原来的验证
if(this.optional(element)||/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})))(%.+)?\s*$/.test(value)){
if(this.optional(element)||ipv6_ip_regexp.test(value)){
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ip;
@@ -350,7 +365,12 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
console.log("client ip must ipv4");
if(ipPattern==1){//ip/掩码格式
if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\/(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5<=32))){
return true;
if(ipv4_ip_subnet_regexp.test(value)){
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ipMask;
return false;
}
}else if(RegExp.$5&&RegExp.$5>32){
$.validator.messages.ipCheck=$.validator.messages.ipMaskRange;
return false;
@@ -362,32 +382,37 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
//A类 0.0.0.0-127.255.255.255 默认掩码255.0.0.0
//B类128.0.0.0-191.255.255.255 默认掩码255.255.0.0
//C类192.0.0.0-223.255.255.255 默认掩码255.255.255.0
if(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\-(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value)&&(RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5 <256 && RegExp.$6<256 && RegExp.$7<256 && RegExp.$8<256)){
var startPart0= RegExp.$1;
var startPart1= RegExp.$5;
if((startPart0<128&&startPart1<128)||(startPart0>127&&startPart1>127&&startPart0<192&&startPart1<192)
||(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224)
||(startPart0>223&&startPart1>223&&startPart0<240&&startPart1<240)
||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){
if(ipv4_ip_range_regexp.test(value)){
if(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\-(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value)&&(RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5 <256 && RegExp.$6<256 && RegExp.$7<256 && RegExp.$8<256)){
var startPart0= RegExp.$1;
var startPart1= RegExp.$5;
if((startPart0<128&&startPart1<128)||(startPart0>127&&startPart1>127&&startPart0<192&&startPart1<192)
||(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224)
||(startPart0>223&&startPart1>223&&startPart0<240&&startPart1<240)
||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){
}else{
$.validator.messages.ipCheck=$.validator.messages.ipRange;
return false;
}
var startIp=value.split("-")[0];
var endIp=value.split("-")[1];
if(ipToNumber(startIp)<=ipToNumber(endIp)){//比较IP大小
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ipRange1;
return false;
}
}else{
$.validator.messages.ipCheck=$.validator.messages.ipRange;
$.validator.messages.ipCheck=$.validator.messages.ip;
return false;
}
var startIp=value.split("-")[0];
var endIp=value.split("-")[1];
if(ipToNumber(startIp)<=ipToNumber(endIp)){//比较IP大小
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ipRange1;
return false;
}
}else{
$.validator.messages.ipCheck=$.validator.messages.ip;
$.validator.messages.ipCheck=$.validator.messages.ipRange;
return false;
}
}else if(ipPattern==3){//ip
if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256))){
if(this.optional(element)||ipv4_ip_regexp.test(value)){
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ip;
@@ -397,7 +422,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
}else if(name.indexOf("destIpAddress")>-1){
console.log("server ip must ipv6");
if(ipPattern==1){//ip/掩码格式
if(this.optional(element)||(/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*\/(0|2|4|8|16|32|64|128)$/.test(value))){
if(this.optional(element)||ipv6_ip_subnet_regexp.test(value)){
return true;
}else if(value.indexOf("/")==-1){
$.validator.messages.ipCheck=$.validator.messages.ipMask;
@@ -408,7 +433,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
$.validator.messages.ipCheck=$.validator.messages.ipMask;
return false;
}else{
if(!/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*$/.test(ipMaskArr[0])){
if(!ipv6_ip_regexp.test(ipMaskArr[0])){
$.validator.messages.ipCheck=$.validator.messages.ipPart;
return false;
}else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){
@@ -422,9 +447,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
}
}else if(ipPattern==2){//ip range
$.validator.messages.ipCheck=$.validator.messages.ipRange;
var _exp="\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*";
var exp=new RegExp("^"+_exp+"-"+_exp+"$","");
if(exp.test(value)){
if(ipv6_ip_range_regexp.test(value)){
var ipArr=value.split("-");
var startIp=fillIp(ipArr[0]);
var endIp=fillIp(ipArr[1]);
@@ -436,14 +459,14 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
}
return false;
}else if(ipPattern==3){//ip格式
if(this.optional(element)||/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*$/.test(value)){
if(this.optional(element)||ipv6_ip_regexp.test(value)){
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ip;
return false;
}
}else{//兼容原来的验证
if(this.optional(element)||/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})))(%.+)?\s*$/.test(value)){
if(this.optional(element)||ipv6_ip_regexp.test(value)){
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ip;
@@ -456,7 +479,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
if(name.indexOf("srcIpAddress")>-1){
console.log("client ip must ipv6");
if(ipPattern==1){//ip/掩码格式
if(this.optional(element)||(/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*\/(0|2|4|8|16|32|64|128)$/.test(value))){
if(this.optional(element)||ipv6_ip_subnet_regexp.test(value)){
return true;
}else if(value.indexOf("/")==-1){
$.validator.messages.ipCheck=$.validator.messages.ipMask;
@@ -467,7 +490,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
$.validator.messages.ipCheck=$.validator.messages.ipMask;
return false;
}else{
if(!/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*$/.test(ipMaskArr[0])){
if(!ipv6_ip_regexp.test(ipMaskArr[0])){
$.validator.messages.ipCheck=$.validator.messages.ipPart;
return false;
}else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){
@@ -481,9 +504,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
}
}else if(ipPattern==2){//ip range
$.validator.messages.ipCheck=$.validator.messages.ipRange;
var _exp="\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*";
var exp=new RegExp("^"+_exp+"-"+_exp+"$","");
if(exp.test(value)){
if(ipv6_ip_range_regexp.test(value)){
var ipArr=value.split("-");
var startIp=fillIp(ipArr[0]);
var endIp=fillIp(ipArr[1]);
@@ -495,14 +516,14 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
}
return false;
}else if(ipPattern==3){//ip格式
if(this.optional(element)||/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*$/.test(value)){
if(this.optional(element)||ipv6_ip_regexp.test(value)){
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ip;
return false;
}
}else{//兼容原来的验证
if(this.optional(element)||/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})))(%.+)?\s*$/.test(value)){
if(this.optional(element)||ipv6_ip_regexp.test(value)){
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ip;
@@ -513,7 +534,12 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
console.log("server ip must ipv4");
if(ipPattern==1){//ip/掩码格式
if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\/(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5<=32))){
return true;
if(ipv4_ip_subnet_regexp.test(value)){
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ipMask;
return false;
}
}else if(RegExp.$5&&RegExp.$5>32){
$.validator.messages.ipCheck=$.validator.messages.ipMaskRange;
return false;
@@ -525,32 +551,37 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
//A类 0.0.0.0-127.255.255.255 默认掩码255.0.0.0
//B类128.0.0.0-191.255.255.255 默认掩码255.255.0.0
//C类192.0.0.0-223.255.255.255 默认掩码255.255.255.0
if(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\-(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value)&&(RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5 <256 && RegExp.$6<256 && RegExp.$7<256 && RegExp.$8<256)){
var startPart0= RegExp.$1;
var startPart1= RegExp.$5;
if((startPart0<128&&startPart1<128)||(startPart0>127&&startPart1>127&&startPart0<192&&startPart1<192)
||(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224)
||(startPart0>223&&startPart1>223&&startPart0<240&&startPart1<240)
||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){
if(ipv4_ip_range_regexp.test(value)){
if(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\-(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value)&&(RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5 <256 && RegExp.$6<256 && RegExp.$7<256 && RegExp.$8<256)){
var startPart0= RegExp.$1;
var startPart1= RegExp.$5;
if((startPart0<128&&startPart1<128)||(startPart0>127&&startPart1>127&&startPart0<192&&startPart1<192)
||(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224)
||(startPart0>223&&startPart1>223&&startPart0<240&&startPart1<240)
||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){
}else{
$.validator.messages.ipCheck=$.validator.messages.ipRange;
return false;
}
var startIp=value.split("-")[0];
var endIp=value.split("-")[1];
if(ipToNumber(startIp)<=ipToNumber(endIp)){//比较IP大小
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ipRange1;
return false;
}
}else{
$.validator.messages.ipCheck=$.validator.messages.ipRange;
$.validator.messages.ipCheck=$.validator.messages.ip;
return false;
}
var startIp=value.split("-")[0];
var endIp=value.split("-")[1];
if(ipToNumber(startIp)<=ipToNumber(endIp)){//比较IP大小
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ipRange1;
return false;
}
}else{
$.validator.messages.ipCheck=$.validator.messages.ip;
$.validator.messages.ipCheck=$.validator.messages.ipRange;
return false;
}
}else if(ipPattern==3){//ip
if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256))){
if(this.optional(element)||ipv4_ip_regexp.test(value)){
return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ip;
@@ -558,13 +589,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
}
}
}
}else if(typeInt==10){
var ipv4_ip_subnet_regexp=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\/(3[0-2]|[1-2][0-9]|[0-9])$/;
var ipv6_ip_subnet_regexp=/^\s*((([0-9A-Fa-f]{1,4}\:){7}(([0-9A-Fa-f]{1,4})|\:))|(([0-9A-Fa-f]{1,4}\:){6}(\:|(\:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}\:){5}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){4}(\:[0-9A-Fa-f]{1,4}){0,1}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){3}(\:[0-9A-Fa-f]{1,4}){0,2}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){2}(\:[0-9A-Fa-f]{1,4}){0,3}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:)(\:[0-9A-Fa-f]{1,4}){0,4}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(\:(\:[0-9A-Fa-f]{1,4}){0,5}((\:)|((\:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*\/(0|2|4|8|16|32|64|128)$/;
var ipv4_ip_range_regexp=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}-(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/;
var ipv6_ip_range_regexp=/^\s*((([0-9A-Fa-f]{1,4}\:){7}(([0-9A-Fa-f]{1,4})|\:))|(([0-9A-Fa-f]{1,4}\:){6}(\:|(\:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}\:){5}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){4}(\:[0-9A-Fa-f]{1,4}){0,1}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){3}(\:[0-9A-Fa-f]{1,4}){0,2}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){2}(\:[0-9A-Fa-f]{1,4}){0,3}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:)(\:[0-9A-Fa-f]{1,4}){0,4}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(\:(\:[0-9A-Fa-f]{1,4}){0,5}((\:)|((\:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*-\s*((([0-9A-Fa-f]{1,4}\:){7}(([0-9A-Fa-f]{1,4})|\:))|(([0-9A-Fa-f]{1,4}\:){6}(\:|(\:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}\:){5}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){4}(\:[0-9A-Fa-f]{1,4}){0,1}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){3}(\:[0-9A-Fa-f]{1,4}){0,2}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){2}(\:[0-9A-Fa-f]{1,4}){0,3}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:)(\:[0-9A-Fa-f]{1,4}){0,4}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(\:(\:[0-9A-Fa-f]{1,4}){0,5}((\:)|((\:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*$/;
var ipv4_ip_regexp=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/;
var ipv6_ip_regexp=/^\s*((([0-9A-Fa-f]{1,4}\:){7}(([0-9A-Fa-f]{1,4})|\:))|(([0-9A-Fa-f]{1,4}\:){6}(\:|(\:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}\:){5}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){4}(\:[0-9A-Fa-f]{1,4}){0,1}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){3}(\:[0-9A-Fa-f]{1,4}){0,2}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){2}(\:[0-9A-Fa-f]{1,4}){0,3}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:)(\:[0-9A-Fa-f]{1,4}){0,4}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(\:(\:[0-9A-Fa-f]{1,4}){0,5}((\:)|((\:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*$/;
}else if(typeInt==10){
if(ipPattern){
if(ipPattern==1){//ip/掩码格式
if(ipv4_ip_subnet_regexp.test(value)){

View File

@@ -358,219 +358,8 @@ $(function(){
}
});
$(".action").on("change", function() {
//DNS REJECT 时选择dnsStrategyId
var action=$("input[name='action']:checked").val();
switchAction(action);
//拦截根据action切换动作部分
setInterceptDefaultInfo("");
//dolog 白名单默认不显示,不记录日志
if(action == 128 || action == 32){
$(".doLog").addClass("hidden");
$("input[name='doLog'][value=0]").prop("checked",true);
}else{
$(".doLog").removeClass("hidden");
$("input[name='doLog'][value=2]").prop("checked",true);
}
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
var actionCode=$(this).val();
var regionCode=$(this).attr("regionCode");
if(!regionCode){
regionCode=$("input[name='action']").attr("regionCode");
}
if(regionCode){
if(regionCode.indexOf(",")==-1){
$("#cfgRegionCode"+regionCode).attr("name","cfgRegionCode");
$("#cfgType"+regionCode).attr("name","cfgType");
$("[id^='cfgRegionCode']").each(function(){
if($(this).attr("id")==("cfgRegionCode"+regionCode)){
$(this).attr("name","cfgRegionCode");
}else{
$(this).removeAttr("name");
}
});
$("[id^='cfgType']").each(function(){
if($(this).attr("id")==("cfgType"+regionCode)){
$(this).attr("name","cfgType");
}else{
$(this).removeAttr("name");
}
});
}else{
var _region='';
var regionArr=regionCode.split(',');
$("input[name$='cfgRegionCode'][regionType='1']").each(function(){
for(var re in regionArr){
if($(this).val()==regionArr[re]){
serviceType=$(this).attr("serviceType");
_region=regionArr[re];
break;
}
}
});
if(_region!=''){
regionCode=_region;
}
}
var 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");
//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");
}
}
if(ipType){
var arr=ipType.split(',');
$("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).attr("disabled",true);
}
});
$("select[name$='ipType']").selectpicker("refresh");
}
if(ipPattern){
arr=ipPattern.split(',');
$("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).attr("disabled",true);
}
});
$("select[name$='ipPattern']").selectpicker("refresh");
}
if(portPattern){
arr=portPattern.split(',');
$("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).attr("disabled",true);
}
});
$("select[name$='portPattern']").selectpicker("refresh");
}
if(direction){
arr=direction.split(',');
$("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).attr("disabled",true);
}
});
$("select[name$='direction']").selectpicker("refresh");
}
if(protocol){
arr=protocol.split(',');
$("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).attr("disabled",true);
}
});
$("select[name$='protocol']").selectpicker("refresh");
}
//处理自定义字段
var serviceType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("serviceType");
if(serviceType){
if(serviceType.indexOf("ipaddr")>-1){
if($(this).val()==32){
$("select[name$='protocol'] option[value='1']").removeAttr("disabled")
}else{
$("select[name$='protocol'] option[value='1']").attr("disabled",true);
}
$("select[name$='protocol']").selectpicker("refresh");
}
if(serviceType.indexOf("ipmulitiplex")>-1){
$(".ipmulitiplex").removeClass("hidden");
}else{
$(".ipmulitiplex").addClass("hidden");
}
if(serviceType.indexOf("ratelimit")>-1){
if($(this).val()==64){
$(".ratelimit").removeClass("hidden");
}else{
$(".ratelimit").addClass("hidden");
}
}else{
$(".ratelimit").addClass("hidden");
}
if($(this).val()==0x20||$(this).val()==0x60){
$("input[name$='isAreaEffective']").each(function(){
if($(this).val()==0){
$(this).click();
}
})
}
}
}
});
//选择hex cfgkeywords需校验十六进制
$("select[name$='isHexbin']").each(function(){
@@ -642,6 +431,7 @@ $(function(){
window.history.back();
return false;
});
initCommIpVal();
});
window.onload=function(){
//日志查询IP类型增加格式提示
@@ -1474,6 +1264,9 @@ var validateInvisibleCharTag=function(){
}
return true;
}
/**
* ip默认选项处理
*/
var initCommIpVal=function(){
var regionCode,serviceType,ipPortShow,ipType,
ipPattern,portPattern,direction,protocol,regionType;
@@ -1486,14 +1279,12 @@ var initCommIpVal=function(){
if(regionCode.indexOf(",")==-1){
$("#cfgRegionCode"+regionCode).attr("name","cfgRegionCode");
$("#cfgType"+regionCode).attr("name","cfgType");
serviceType=$("input[name$='cfgRegionCode'][regionType='1'][value='"+regionCode+"']").attr("serviceType");
}else{
var _region='';
var regionArr=regionCode.split(',');
$("input[name$='cfgRegionCode'][regionType='1']").each(function(){
for(var re in regionArr){
if($(this).val()==regionArr[re]){
serviceType=$(this).attr("serviceType");
_region=regionArr[re];
break;
}
@@ -1504,45 +1295,7 @@ var initCommIpVal=function(){
}
}
}
if(serviceType){
if(serviceType.indexOf("ipaddr")>-1&&$("input[name$='action']:checked").val()==32){
$("select[name$='protocol'] option").each(function(){
if($(this).attr("value")==1){
$(this).removeAttr("disabled");
}
});
$("select[name$='protocol']").selectpicker("refresh");
}
if(serviceType&&serviceType.indexOf("ipaddr")>-1&&$("input[name$='action']").val()==32){
$("select[name$='protocol'] option").each(function(){
if($(this).attr("value")==1){
$(this).removeAttr("disabled");
}
});
$("select[name$='protocol']").selectpicker("refresh");
}
if(serviceType.indexOf("ipmulitiplex")>-1){
$(".ipmulitiplex").removeClass("hidden");
$("input[name$='isAreaEffective']").each(function(){
if($(this).val()==0){
$(this).click();
}
})
$(".areaInfo").addClass("hidden");
}else{
$(".areaInfo").removeClass("hidden");
$(".ipmulitiplex").addClass("hidden");
}
if(serviceType.indexOf("ratelimit")>-1){
if($("input[name$='action']").val()==64||$("input[name$='action']:checked").val()==64){
$(".ratelimit").removeClass("hidden");
}else{
$(".ratelimit").addClass("hidden");
}
}else{
$(".ratelimit").addClass("hidden");
}
}
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"),
@@ -1550,6 +1303,15 @@ var initCommIpVal=function(){
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,端口
@@ -1567,6 +1329,7 @@ var initCommIpVal=function(){
$("input[name$='destPort']").parents(".form-group").addClass("hidden");
}
}
//ip类型处理
if(ipType){
var arr=ipType.split(',');
$("select[name$='ipType'] option").each(function(){
@@ -1585,6 +1348,7 @@ var initCommIpVal=function(){
}
});
}
//ip格式处理
if(ipPattern){
arr=ipPattern.split(',');
$("select[name$='ipPattern'] option").each(function(){
@@ -1603,6 +1367,7 @@ var initCommIpVal=function(){
}
});
}
//端口格式处理
if(portPattern){
arr=portPattern.split(',');
$("select[name$='portPattern'] option").each(function(){
@@ -1621,6 +1386,7 @@ var initCommIpVal=function(){
}
});
}
//方向处理
if(direction){
arr=direction.split(',');
$("select[name$='direction'] option").each(function(){
@@ -1639,6 +1405,7 @@ var initCommIpVal=function(){
}
});
}
//协议处理
if(protocol){
arr=protocol.split(',');
$("select[name$='protocol'] option").each(function(){
@@ -1657,5 +1424,4 @@ var initCommIpVal=function(){
}
});
}
return regionCode;
}