ip增加源目的不相同校验
action默认选中第一个动作 list列表type修改为classification
This commit is contained in:
@@ -179,6 +179,30 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
|
||||
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();
|
||||
var srcIpAddress=$(element).parents(".row").parent(".row").find("input[name$='srcIpAddress']").val();
|
||||
var destIpAddress=$(element).parents(".row").parent(".row").find("input[name$='destIpAddress']").val();
|
||||
var destIpIsHidden=$(element).parents(".row").parent(".row").find("input[name$='destIpAddress']").is(":hidden");
|
||||
if(ipPattern==1){//ip/掩码格式
|
||||
srcIpAddress=srcIpAddress.indexOf("/") >-1 ?srcIpAddress.split("/")[0] : srcIpAddress;
|
||||
destIpAddress=destIpAddress.indexOf("/") >-1 ?srcIpAddress.split("/")[0] : srcIpAddress;
|
||||
}else if (ipPattern==2){
|
||||
srcIpAddress=srcIpAddress.indexOf("-") >-1 ?srcIpAddress.split("-")[0] : srcIpAddress;
|
||||
destIpAddress=destIpAddress.indexOf("-") >-1 ?srcIpAddress.split("-")[0] : srcIpAddress;
|
||||
}
|
||||
if(destIpIsHidden){
|
||||
if((srcIpAddress == destIpAddress)){
|
||||
$.validator.messages.ipCheck=$.validator.messages.srcIpIsNotValue+destIpAddress;
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
if((srcIpAddress == destIpAddress)){
|
||||
$.validator.messages.ipCheck=$.validator.messages.srcIpNotEqDestIp+srcIpAddress
|
||||
+$.validator.messages.destIpNotEqDestIp+destIpAddress
|
||||
+$.validator.messages.IpNotEqDestIp;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(typeInt==4){
|
||||
if(ipPattern){
|
||||
if(ipPattern==1){//ip/掩码格式
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
ipPart:"Invalid IP part",
|
||||
ipv6MaskPart:"Mask must be exponent of 2,not greater than 128",
|
||||
ipMaskRange:"IP mask must between 0 and 32",
|
||||
srcIpNotEqDestIp:"Sourse IP ",
|
||||
destIpNotEqDestIp:" and destination IP ",
|
||||
IpNotEqDestIp:" can't the same",
|
||||
srcIpIsNotValue:"Sourse IP can't be ",
|
||||
ipRange:"Wrong IP format or start IP and end IP in two subnet",
|
||||
ipRange1:"start IP should smaller than end IP",
|
||||
portCheck:"Please enter a correct port",
|
||||
|
||||
@@ -26,10 +26,15 @@
|
||||
ipPart:"Invalid IP part",
|
||||
ipv6MaskPart:"Mask must be exponent of 2,not greater than 128",
|
||||
ipMaskRange:"IP mask must between 0 and 32",
|
||||
srcIpNotEqDestIp:"Sourse IP and destination IP can't the same",
|
||||
ipRange:"Wrong IP format or start IP and end IP in two subnet",
|
||||
ipRange1:"start IP should smaller than end IP",
|
||||
portCheck: " Пожалуйста, введите правильный порт.",
|
||||
portRange:"Port must between 0 and 65535",
|
||||
srcIpNotEqDestIp:"Sourse IP ",
|
||||
destIpNotEqDestIp:" and destination IP ",
|
||||
srcIpIsNotValue:"Sourse IP can't be ",
|
||||
IpNotEqDestIp:" can't the same",
|
||||
portMaskRange:"Port and mask must between 0 and 65535.The correct pattern is \"port/mask\".",
|
||||
chooseAreaOrIsp:"The region and the oprater must choose one",
|
||||
areaControl:"Action drop and loop do not need area control",
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
rangelength: $.validator.format("请输入一个长度介于 {0} 和 {1} 之间的字符串"),
|
||||
range: $.validator.format("请输入一个介于 {0} 和 {1} 之间的值"),
|
||||
max: $.validator.format("请输入一个最大为 {0} 的值"),
|
||||
|
||||
min: $.validator.format("请输入一个最小为 {0} 的值"),
|
||||
noBlankSpace:"不能为空格",
|
||||
ipCheck:"请填写正确的IP地址",
|
||||
@@ -30,9 +29,14 @@
|
||||
portCheck:"请填写正确的端口",
|
||||
notStartZero:"请填写正确的数值",
|
||||
ipMaskRange:"掩码范围0到32",
|
||||
srcIpNotEqDestIp:"源IP和目的IP不能相同",
|
||||
ipRange:"IP范围格式错误或者起始IP与结束IP不在同一网段",
|
||||
ipRange1:"起始IP值应小于结束IP值",
|
||||
portRange:"端口应小于65536,非0数字不能以0开头",
|
||||
srcIpIsNotValue:"源IP不能为 ",
|
||||
srcIpNotEqDestIp:"源IP ",
|
||||
destIpNotEqDestIp:" 与目的IP ",
|
||||
IpNotEqDestIp:" 不能相同",
|
||||
portMaskRange:"端口以及掩码范围0-65535,非0数字不能以0开头。格式为\"端口/掩码\"",
|
||||
chooseAreaOrIsp:"区域和运营商必选一个",
|
||||
areaControl:"丢弃和回流动作不能区域管控",
|
||||
|
||||
Reference in New Issue
Block a user