(1)ipsec协议修改

(2)ipv6掩码范围修改
(3)全部协议放开端口限制
This commit is contained in:
wangxin
2018-10-15 15:26:43 +08:00
parent fd2a4cf28e
commit b6276cdc8c
14 changed files with 107 additions and 50 deletions

View File

@@ -7,6 +7,10 @@ import java.util.Map;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
public final class Constants { public final class Constants {
/**
* IPSEC协议
*/
public static Integer IPSEC_PROTOCOL=Configurations.getIntProperty("ipsec_protocol", 8);
public static final String GROUP_REUSE_SOURCES=Configurations.getStringProperty("groupReuseSources","groupReuseSources"); public static final String GROUP_REUSE_SOURCES=Configurations.getStringProperty("groupReuseSources","groupReuseSources");
public static Integer APP_SPEC_SERVICE_CODE_MIN_VAL=Configurations.getIntProperty("app_spec_service_code_min_val", 300001); public static Integer APP_SPEC_SERVICE_CODE_MIN_VAL=Configurations.getIntProperty("app_spec_service_code_min_val", 300001);
public static Integer APP_SPEC_SERVICE_CODE_MAX_VAL=Configurations.getIntProperty("app_spec_service_code_max_val", 268435455); public static Integer APP_SPEC_SERVICE_CODE_MAX_VAL=Configurations.getIntProperty("app_spec_service_code_max_val", 268435455);

View File

@@ -24,24 +24,17 @@ import com.nis.domain.FunctionRegionDict;
import com.nis.domain.FunctionServiceDict; import com.nis.domain.FunctionServiceDict;
import com.nis.domain.Page; import com.nis.domain.Page;
import com.nis.domain.SysDataDictionaryItem; import com.nis.domain.SysDataDictionaryItem;
import com.nis.domain.basics.PolicyGroupInfo;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.domain.configuration.template.IpAddrTemplate;
import com.nis.domain.configuration.template.IpAllTemplate; import com.nis.domain.configuration.template.IpAllTemplate;
import com.nis.domain.configuration.template.IpsecTemplate;
import com.nis.domain.configuration.template.TunnelIpTemplate;
import com.nis.domain.specific.ConfigGroupInfo; import com.nis.domain.specific.ConfigGroupInfo;
import com.nis.exceptions.MaatConvertException; import com.nis.exceptions.MaatConvertException;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.util.DictUtils; import com.nis.util.DictUtils;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.util.excel.ExcelField;
import com.nis.util.excel.ExportExcel; import com.nis.util.excel.ExportExcel;
import com.nis.web.controller.BaseController; import com.nis.web.controller.BaseController;
import com.nis.web.controller.configuration.CommonController;
import com.nis.web.security.UserUtils; import com.nis.web.security.UserUtils;
/** /**

View File

@@ -205,7 +205,8 @@
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id ,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id, ,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable
,a.area_effective_ids,a.function_id,a.cfg_region_code ,a.area_effective_ids,a.function_id,a.cfg_region_code,a.user_region1,a.user_region2,
a.user_region3,a.user_region4,a.user_region5
</sql> </sql>
<select id="getById" resultMap="BaseIpMap" parameterType="java.lang.Long" > <select id="getById" resultMap="BaseIpMap" parameterType="java.lang.Long" >
SELECT SELECT

View File

@@ -136,7 +136,11 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
ipCfgDao.saveCfgIndex(entity); ipCfgDao.saveCfgIndex(entity);
if(entity.getIpPortList()!=null){ if(entity.getIpPortList()!=null){
for(IpPortCfg cfg:entity.getIpPortList()){ for(IpPortCfg cfg:entity.getIpPortList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); if(Constants.IPSEC_PROTOCOL.intValue()==cfg.getProtocol().intValue()) {
BeanUtils.copyProperties(entity, cfg,new String[]{"userRegion1","cfgRegionCode","cfgType"});
}else {
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
}
ipCfgDao.saveIpPortCfg(cfg); ipCfgDao.saveIpPortCfg(cfg);
} }
} }
@@ -172,7 +176,11 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
entity.setCreatorId(entity.getCurrentUser().getId()); entity.setCreatorId(entity.getCurrentUser().getId());
if(entity.getIpPortList()!=null){ if(entity.getIpPortList()!=null){
for(IpPortCfg cfg:entity.getIpPortList()){ for(IpPortCfg cfg:entity.getIpPortList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); if(Constants.IPSEC_PROTOCOL.intValue()==cfg.getProtocol().intValue()) {
BeanUtils.copyProperties(entity, cfg,new String[]{"userRegion1","cfgRegionCode","cfgType"});
}else {
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
}
ipCfgDao.saveIpPortCfg(cfg); ipCfgDao.saveIpPortCfg(cfg);
} }
} }
@@ -551,24 +559,23 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
} }
} }
} }
IpPortCfg cfg = new IpPortCfg(); for(IpPortCfg cfg:entity.getIpPortList()) {
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); BeanUtils.copyProperties(entity, cfg, new String[]{"userRegion1","cfgId"});
cfg.setTableName(IpPortCfg.getTablename()); cfg.setTableName(IpPortCfg.getTablename());
ipCfgDao.auditCfg(cfg); ipCfgDao.auditCfg(cfg);
if(isAudit==1){ }
if(isAudit==1&&maatType==Constants.MAAT_TYPE){
for(IpPortCfg cfg:entity.getIpPortList()) {
if(Constants.IPSEC_PROTOCOL==cfg.getProtocol().intValue()) {
cfg.setProtocol(Integer.parseInt(cfg.getUserRegion1()));
}
}
Map<String,List> map = cfgConvert(ipRegionList,entity.getIpPortList(),1,entity,groupRelationList); Map<String,List> map = cfgConvert(ipRegionList,entity.getIpPortList(),1,entity,groupRelationList);
groupRelationList=map.get("groupList"); groupRelationList=map.get("groupList");
ipRegionList=map.get("dstList"); ipRegionList=map.get("dstList");
if(map.get("numRegionList")!=null){ if(map.get("numRegionList")!=null){
numRegionList.addAll(map.get("numRegionList")); numRegionList.addAll(map.get("numRegionList"));
} }
if(Constants.SERVICE_IP_MULITIPLEX==cfg.getServiceId().intValue()){
String region=Constants.USERREGION_IR_STRATEGY+"="+cfg.getDnsStrategyId()+Constants.USER_REGION_SPLIT
+Constants.USERREGION_IR_TYPE+"="+cfg.getIrType();
maatCfg.setUserRegion(region);
}else if(Constants.SERVICE_IP_RATELIMIT==cfg.getServiceId().intValue()){
maatCfg.setUserRegion(Constants.USERREGION_RATE_LIMIT+"="+cfg.getRatelimit());
}
} }
} }
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){ if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){
@@ -576,7 +583,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(NtcSubscribeIdCfg.getTablename()); cfg.setTableName(NtcSubscribeIdCfg.getTablename());
ipCfgDao.auditCfg(cfg); ipCfgDao.auditCfg(cfg);
if(isAudit==1){ if(isAudit==1&&maatType==Constants.MAAT_TYPE){
Map<String,List> map = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList); Map<String,List> map = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList);
groupRelationList=map.get("groupList"); groupRelationList=map.get("groupList");
strRegionList=map.get("dstList"); strRegionList=map.get("dstList");
@@ -589,7 +596,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename()); cfg.setTableName(AreaIpCfg.getTablename());
ipCfgDao.auditCfg(cfg); ipCfgDao.auditCfg(cfg);
if(isAudit==1){ if(isAudit==1&&maatType==Constants.MAAT_TYPE){
Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList); Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=map.get("groupList"); groupRelationList=map.get("groupList");
areaIpRegionList=map.get("dstList"); areaIpRegionList=map.get("dstList");
@@ -600,8 +607,15 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
if(maatType==Constants.CALLBACK_TYPE){ if(maatType==Constants.CALLBACK_TYPE){
List<InlineIp> ipList=new ArrayList<>(); List<InlineIp> ipList=new ArrayList<>();
for(IpPortCfg cfg :entity.getIpPortList()) { for(IpPortCfg cfg :entity.getIpPortList()) {
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); Integer ipsecProtocol=null;
if(Constants.IPSEC_PROTOCOL==cfg.getProtocol().intValue()) {
ipsecProtocol=Integer.parseInt(cfg.getUserRegion1());
}
BeanUtils.copyProperties(entity, cfg, new String[]{"userRegion1","cfgId"});
InlineIp ip=convertCallBackIp(cfg,null); InlineIp ip=convertCallBackIp(cfg,null);
if(ipsecProtocol!=null) {
ip.setProtocol(ipsecProtocol);
}
ipList.add(ip); ipList.add(ip);
} }
//调用服务接口下发配置数据 //调用服务接口下发配置数据
@@ -660,8 +674,15 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
if(maatType==Constants.CALLBACK_TYPE){ if(maatType==Constants.CALLBACK_TYPE){
List<InlineIp> ipList=new ArrayList<>(); List<InlineIp> ipList=new ArrayList<>();
for(IpPortCfg cfg :entity.getIpPortList()) { for(IpPortCfg cfg :entity.getIpPortList()) {
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); Integer ipsecProtocol=null;
if(Constants.IPSEC_PROTOCOL==cfg.getProtocol().intValue()) {
ipsecProtocol=Integer.parseInt(cfg.getUserRegion1());
}
BeanUtils.copyProperties(entity, cfg, new String[]{"userRegion1","cfgId"});
InlineIp ip=convertCallBackIp(cfg,null); InlineIp ip=convertCallBackIp(cfg,null);
if(ipsecProtocol!=null) {
ip.setProtocol(ipsecProtocol);
}
ipList.add(ip); ipList.add(ip);
} }
//调用服务接口下发配置数据 //调用服务接口下发配置数据

View File

@@ -1243,4 +1243,5 @@ usual_ddos=Usual DDOS
mail_address=Mail Address mail_address=Mail Address
mail_address_whitelist=Mail Address Whitelist mail_address_whitelist=Mail Address Whitelist
mail_address_monit=Mail Address Monit mail_address_monit=Mail Address Monit
mail_address_reject=Mail Address Reject mail_address_reject=Mail Address Reject
ipsec_protocol=IPSEC Protocol

View File

@@ -1254,4 +1254,5 @@ usual_ddos=Usual DDOS
mail_address=Mail Address mail_address=Mail Address
mail_address_whitelist=Mail Address Whitelist mail_address_whitelist=Mail Address Whitelist
mail_address_monit=Mail Address Monit mail_address_monit=Mail Address Monit
mail_address_reject=Mail Address Reject mail_address_reject=Mail Address Reject
ipsec_protocol=IPSEC Protocol

View File

@@ -1236,4 +1236,5 @@ usual_ddos=\u5E38\u7528DDOS\u653B\u51FB
mail_address=\u90AE\u4EF6\u5730\u5740 mail_address=\u90AE\u4EF6\u5730\u5740
mail_address_whitelist=\u90AE\u4EF6\u5730\u5740\u767D\u540D\u5355 mail_address_whitelist=\u90AE\u4EF6\u5730\u5740\u767D\u540D\u5355
mail_address_monit=\u90AE\u4EF6\u5730\u5740\u76D1\u6D4B mail_address_monit=\u90AE\u4EF6\u5730\u5740\u76D1\u6D4B
mail_address_reject=\u90AE\u4EF6\u5730\u5740\u7BA1\u63A7 mail_address_reject=\u90AE\u4EF6\u5730\u5740\u7BA1\u63A7
ipsec_protocol=IPSEC\u534F\u8BAE

View File

@@ -219,14 +219,14 @@ clusterBStartTime=1503504000725
isCommit=true isCommit=true
############################################################################################################################################ ############################################################################################################################################
############################################################################################################################################ ############################################################################################################################################
httpUrl=http://192.168.10.204:7777/galaxy-service/service/cfg/v1/ httpUrl=http://192.168.10.204:9999/galaxy-service/service/cfg/v1/
maatCfg=configSources maatCfg=configSources
fileUploadCfg=fileUploadSources fileUploadCfg=fileUploadSources
callbackCfg=commonSources callbackCfg=commonSources
fileDigestCfg=fileDigestSources fileDigestCfg=fileDigestSources
configIdSources=configPzIdSources configIdSources=configPzIdSources
#logBaseUrl=http://10.0.6.242:8080/galaxy-service/service/log/v1/ #logBaseUrl=http://10.0.6.242:8080/galaxy-service/service/log/v1/
logBaseUrl=http://192.168.10.204:7777/galaxy-service/service/log/v1/ logBaseUrl=http://192.168.10.204:9999/galaxy-service/service/log/v1/
ntcPzReport=ntcPzReport ntcPzReport=ntcPzReport
ntcServiceReport=ntcServiceReport ntcServiceReport=ntcServiceReport
ntcTagReport=ntcTagReport ntcTagReport=ntcTagReport
@@ -270,7 +270,7 @@ mmLogoDetectionLog=mmLogoDetectionLogs
mmFaceRecognizationLog=mmFaceRecognizationLogs mmFaceRecognizationLog=mmFaceRecognizationLogs
######################################## ########################################
#\u5927\u5c4f\u56fe\u8868\u5c55\u793a\u670d\u52a1\u63a5\u53e3 #\u5927\u5c4f\u56fe\u8868\u5c55\u793a\u670d\u52a1\u63a5\u53e3
dashboardUrl=http://192.168.10.204:7777/galaxy-service/service/log/v1/ dashboardUrl=http://192.168.10.204:9999/galaxy-service/service/log/v1/
trafficIpActive=trafficIpActive trafficIpActive=trafficIpActive
trafficProtocol=trafficProtocol trafficProtocol=trafficProtocol
trafficApp=trafficApp trafficApp=trafficApp
@@ -367,7 +367,7 @@ user_region_placeholder=0
user_region_split=; user_region_split=;
#IP\u76f8\u5173\u9a8c\u8bc1\u6b63\u5219 #IP\u76f8\u5173\u9a8c\u8bc1\u6b63\u5219
ipv4_ip_subnet_regexp=^(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(0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\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}))$
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)$ 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)$
@@ -527,4 +527,5 @@ log_time_end=2018-10-01 00:00:00
area_tag=location area_tag=location
isp_tag=isp isp_tag=isp
mmFileDigestLog=mmFileDigestLogs mmFileDigestLog=mmFileDigestLogs
ntcStreamMediaLog=ntcStreamMediaLogs ntcStreamMediaLog=ntcStreamMediaLogs
ipsec_protocol=8

View File

@@ -64,6 +64,20 @@
</div> </div>
</div> </div>
</c:if> </c:if>
<div class="col-md-6 ipsecProtocol hidden">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ipsec_protocol"/></label>
<div class="col-md-6">
<select name="${cfgName}.userRegion1" class="selectpicker show-tick form-control required" disabled="disabled">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('IPSEC_PROTOCOL')}" var="ipType">
<option value="${ipType.itemCode}" <c:if test="${_cfg.ipPortList[0].userRegion1==ipType.itemCode}">selected</c:if> ><spring:message code="${ipType.itemValue}"/></option>
</c:forEach>
</select>
</div>
<div for="${cfgName}.userRegion1"></div>
</div>
</div>
</div> </div>
<div class="row ip"> <div class="row ip">
<div class="col-md-6"> <div class="col-md-6">

View File

@@ -32,7 +32,12 @@
}else{ }else{
hideAction(1,asnRegionCode); hideAction(1,asnRegionCode);
} }
$("[name$='protocol']").each(function(){
showHideIPSECProtocol($(this));
});
$("[name$='protocol']").on("change",function(){
showHideIPSECProtocol($(this));
});
if(isAsn==0){ if(isAsn==0){
$("[class~='glyphicon-plus'][class~='ipPortList']").click(); $("[class~='glyphicon-plus'][class~='ipPortList']").click();
$("[class~='boxSolid'][class~='asn']").find(".glyphicon-remove").click(); $("[class~='boxSolid'][class~='asn']").find(".glyphicon-remove").click();
@@ -108,6 +113,7 @@
changeIPVal(tabInfo); changeIPVal(tabInfo);
} }
processAction(isAsn,tabInfo); processAction(isAsn,tabInfo);
$("[name$='protocol']").change();
/* if(tabInfo){ /* if(tabInfo){
tabInfo.find("[name$='cfgType']").val(cfgType); tabInfo.find("[name$='cfgType']").val(cfgType);
tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode); tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode);
@@ -372,6 +378,23 @@ var processAction=function(configType,obj){
} }
} }
var showHideIPSECProtocol=function(obj){
var name=$(obj).attr("name");
var userRegion1=$("select[name='"+name.replace("protocol","userRegion1")+"']");
if($(obj).val()==8){
if(userRegion1){
userRegion1.removeAttr("disabled");
userRegion1.parents(".ipsecProtocol").removeClass("hidden");
userRegion1.selectpicker("refresh");
}
}else{
if(userRegion1){
userRegion1.attr("disabled","disabled");
userRegion1.parents(".ipsecProtocol").addClass("hidden");
userRegion1.selectpicker("refresh");
}
}
}
</script> </script>
</head> </head>
<body> <body>

View File

@@ -237,8 +237,8 @@ jQuery.validator.addMethod("protocolPort",function(value, element) {
var protocolElement=$("[name='"+name.replace("destPort","protocol")+"']"); var protocolElement=$("[name='"+name.replace("destPort","protocol")+"']");
protocolVal=protocolElement.val(); protocolVal=protocolElement.val();
} }
if((protocolVal==0&&srcPortVal>0)||(protocolVal==0&&destPortVal>0)){ if(protocolVal==0){
$.validator.messages.protocolPort=$.validator.messages.protocolPort; return true;
}else if((protocolVal!=tcp&&protocolVal!=udp&&srcPortVal>0)||(protocolVal!=tcp&&protocolVal!=udp&&destPortVal>0)){ }else if((protocolVal!=tcp&&protocolVal!=udp&&srcPortVal>0)||(protocolVal!=tcp&&protocolVal!=udp&&destPortVal>0)){
$.validator.messages.protocolPort=$.validator.messages.protocolPort1; $.validator.messages.protocolPort=$.validator.messages.protocolPort1;
return false; return false;
@@ -250,7 +250,7 @@ jQuery.validator.addMethod("protocolPort",function(value, element) {
//ip地址校验 //ip地址校验
jQuery.validator.addMethod("ipCheck",function(value, element) { 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[6-9]|2[0-9])$/; 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[6-9]|2[0-9])$/;
var ipv6_ip_subnet_regexp=/^((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa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{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 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)$/;
@@ -370,7 +370,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
$.validator.messages.ipCheck=$.validator.messages.ipPart; $.validator.messages.ipCheck=$.validator.messages.ipPart;
return false; return false;
//}else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){ //}else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){
}else if(!/^(128)$/.test(ipMaskArr[1])){ }else if(!/^([2-9]|[1-9][0-9]|1[0-2][0-8])$/.test(ipMaskArr[1])){
$.validator.messages.ipCheck=$.validator.messages.ipv6MaskPart; $.validator.messages.ipCheck=$.validator.messages.ipv6MaskPart;
return false; return false;
} else{ } else{
@@ -410,7 +410,6 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
}else if(typeInt==46){ }else if(typeInt==46){
var name=$(element).attr("name"); var name=$(element).attr("name");
if(name.indexOf("srcIpAddress")>-1){ if(name.indexOf("srcIpAddress")>-1){
console.log("client ip must ipv4");
if(ipPattern==1){//ip/掩码格式 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))){ 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))){
if(ipv4_ip_subnet_regexp.test(value)){ if(ipv4_ip_subnet_regexp.test(value)){
@@ -468,7 +467,6 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
} }
} }
}else if(name.indexOf("destIpAddress")>-1){ }else if(name.indexOf("destIpAddress")>-1){
console.log("server ip must ipv6");
if(ipPattern==1){//ip/掩码格式 if(ipPattern==1){//ip/掩码格式
if(this.optional(element)||ipv6_ip_subnet_regexp.test(value)){ if(this.optional(element)||ipv6_ip_subnet_regexp.test(value)){
return true; return true;
@@ -485,7 +483,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
$.validator.messages.ipCheck=$.validator.messages.ipPart; $.validator.messages.ipCheck=$.validator.messages.ipPart;
return false; return false;
//}else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){ //}else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){
}else if(!/^(128)$/.test(ipMaskArr[1])){ }else if(!/^([2-9]|[1-9][0-9]|1[0-2][0-8])$/.test(ipMaskArr[1])){
$.validator.messages.ipCheck=$.validator.messages.ipv6MaskPart; $.validator.messages.ipCheck=$.validator.messages.ipv6MaskPart;
return false; return false;
} else{ } else{
@@ -526,7 +524,6 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
}else if(typeInt==64){ }else if(typeInt==64){
var name=$(element).attr("name"); var name=$(element).attr("name");
if(name.indexOf("srcIpAddress")>-1){ if(name.indexOf("srcIpAddress")>-1){
console.log("client ip must ipv6");
if(ipPattern==1){//ip/掩码格式 if(ipPattern==1){//ip/掩码格式
if(this.optional(element)||ipv6_ip_subnet_regexp.test(value)){ if(this.optional(element)||ipv6_ip_subnet_regexp.test(value)){
return true; return true;
@@ -543,7 +540,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
$.validator.messages.ipCheck=$.validator.messages.ipPart; $.validator.messages.ipCheck=$.validator.messages.ipPart;
return false; return false;
//}else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){ //}else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){
}else if(!/^(128)$/.test(ipMaskArr[1])){ }else if(!/^([2-9]|[1-9][0-9]|1[0-2][0-8])$/.test(ipMaskArr[1])){
$.validator.messages.ipCheck=$.validator.messages.ipv6MaskPart; $.validator.messages.ipCheck=$.validator.messages.ipv6MaskPart;
return false; return false;
} else{ } else{

View File

@@ -27,7 +27,7 @@
ipMask:"Please enter a correct IP/mask", ipMask:"Please enter a correct IP/mask",
ipPart:"Invalid IP part", ipPart:"Invalid IP part",
//ipv6MaskPart:"Mask must be exponent of 2,not greater than 128", //ipv6MaskPart:"Mask must be exponent of 2,not greater than 128",
ipv6MaskPart:"Mask must be 128", ipv6MaskPart:"Mask must between 2 and 128",
//ipMaskRange:"IP mask must between 0 and 32", //ipMaskRange:"IP mask must between 0 and 32",
ipMaskRange:"IP mask must between 16 and 32", ipMaskRange:"IP mask must between 16 and 32",
srcIpNotEqDestIp:"Client IP ", srcIpNotEqDestIp:"Client IP ",
@@ -74,6 +74,6 @@
log_1_hour:"Log For The Last Hour", log_1_hour:"Log For The Last Hour",
input:"Please Enter ", input:"Please Enter ",
protocolPort:"TCP protocol or UDP protocol must be chosen when port is greater than 0", protocolPort:"TCP protocol or UDP protocol must be chosen when port is greater than 0",
protocolPort1:"Only when TCP protocol or UDP protocol is chosen can port greater than 0" protocolPort1:"Only when TCP protocol or UDP protocol is chosen can port greater than 0,ALL protocol has no limit"
}); });
}(jQuery)); }(jQuery));

View File

@@ -27,7 +27,7 @@
ipMask:"Введите правильный IP/маску", ipMask:"Введите правильный IP/маску",
ipPart:"Недопустимая часть IP", ipPart:"Недопустимая часть IP",
//ipv6MaskPart:"Mаска-показатель степени 2, небольше 128", //ipv6MaskPart:"Mаска-показатель степени 2, небольше 128",
ipv6MaskPart:"掩码必须为128", ipv6MaskPart:"掩码介于2到128",
//ipMaskRange:"Маска IP между 0 и 32", //ipMaskRange:"Маска IP между 0 и 32",
ipMaskRange:"Маска IP должна между 16 и 32", ipMaskRange:"Маска IP должна между 16 и 32",
srcIpNotEqDestIp:"IP Источник", srcIpNotEqDestIp:"IP Источник",
@@ -74,6 +74,6 @@
log_1_hour:"Log For The Last Hour", log_1_hour:"Log For The Last Hour",
input:"Please Enter ", input:"Please Enter ",
protocolPort:"TCP protocol or UDP protocol must be chosen when port is greater than 0", protocolPort:"TCP protocol or UDP protocol must be chosen when port is greater than 0",
protocolPort1:"Only when TCP protocol or UDP protocol is chosen can port greater than 0" protocolPort1:"Only when TCP protocol or UDP protocol is chosen can port greater than 0,ALL protocol has no limit"
}); });
}(jQuery)); }(jQuery));

View File

@@ -27,7 +27,7 @@
ipMask:"请填写正确的IP地址/掩码", ipMask:"请填写正确的IP地址/掩码",
ipPart:"IP部分格式错误", ipPart:"IP部分格式错误",
//ipv6MaskPart:"掩码为不大于128的2的指数幂", //ipv6MaskPart:"掩码为不大于128的2的指数幂",
ipv6MaskPart:"掩码必须为128", ipv6MaskPart:"掩码介于2到128",
//ipMaskRange:"IP掩码介于0到32", //ipMaskRange:"IP掩码介于0到32",
ipMaskRange:"IP掩码介于16到32", ipMaskRange:"IP掩码介于16到32",
srcIpNotEqDestIp:"源IP ", srcIpNotEqDestIp:"源IP ",
@@ -74,6 +74,6 @@
log_1_hour:"1小时日志量", log_1_hour:"1小时日志量",
input:"请输入 ", input:"请输入 ",
protocolPort:"端口大于0时必须选择TCP协议或者UDP协议", protocolPort:"端口大于0时必须选择TCP协议或者UDP协议",
protocolPort1:"只有tcp,udp协议端口号可以不为0" protocolPort1:"只有tcp,udp协议端口号可以不为0,全部协议无限制"
}); });
}(jQuery)); }(jQuery));