diff --git a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp index a3d8d05f5..222be2629 100644 --- a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp @@ -159,7 +159,7 @@ $(function(){
- +
@@ -179,7 +179,7 @@ $(function(){
- +
diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js index 3e96985ef..6c6e81fc2 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js @@ -245,6 +245,16 @@ jQuery.validator.addMethod("ipMask",function(value, element) { }else{return (obj > 0) && ((obj & (obj - 1)) == 0)}; } }, "请填写正确的IP地址掩码"); +jQuery.validator.addMethod("portCheck",function(value, element) { + if(value.length==0||value.trim().length==0){return true;} + obj=value; + var typeInt=$(element).parents(".row").siblings().find("select[name$='portPattern']").val(); + if(typeInt==1){//port 0~65535 + return this.optional(element)||(/^([0-9]+)$/.test(value) && (RegExp.$1 <=65535 && RegExp.$1 >=0)); + }else if(typeInt==2){// port -mask 0~65535/0~65535 + return this.optional(element)||(/^([0-9]+)\/([0-9]+)$/.test(value) && (RegExp.$1 <=65535 && RegExp.$2 <=65535 && RegExp.$1