(1)调整ip界面参数顺序
(2)修正验证方法同级触发时错误验证的bug
This commit is contained in:
@@ -138,6 +138,17 @@ $(function(){
|
|||||||
<div for="ipPattern"></div>
|
<div for="ipPattern"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group ">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_ip"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input class="form-control required ipCheck" type="text" name="srcIpAddress" value="${_cfg.srcIpAddress}">
|
||||||
|
</div>
|
||||||
|
<div for="srcIpAddress"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row hidden port">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="port_pattern"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="port_pattern"/></label>
|
||||||
@@ -150,17 +161,6 @@ $(function(){
|
|||||||
<div for="portPattern"></div>
|
<div for="portPattern"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6">
|
|
||||||
<div class="form-group ">
|
|
||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_ip"/></label>
|
|
||||||
<div class="col-md-6">
|
|
||||||
<input class="form-control required ipCheck" type="text" name="srcIpAddress" value="${_cfg.srcIpAddress}">
|
|
||||||
</div>
|
|
||||||
<div for="srcIpAddress"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group ">
|
<div class="form-group ">
|
||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_port"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_port"/></label>
|
||||||
@@ -171,7 +171,7 @@ $(function(){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row hidden disabled port">
|
<div class="row hidden protocol">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group ">
|
<div class="form-group ">
|
||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_ip"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_ip"/></label>
|
||||||
|
|||||||
@@ -170,7 +170,13 @@ jQuery.validator.addMethod("notStartZero",function(value, element) {
|
|||||||
jQuery.validator.addMethod("ipCheck",function(value, element) {
|
jQuery.validator.addMethod("ipCheck",function(value, element) {
|
||||||
if(value.length==0||value.trim().length==0){return true;}
|
if(value.length==0||value.trim().length==0){return true;}
|
||||||
var typeInt=$(element).parents(".row").siblings().find("select[name$='ipType']").val();
|
var typeInt=$(element).parents(".row").siblings().find("select[name$='ipType']").val();
|
||||||
|
if(!typeInt){
|
||||||
|
typeInt=$(element).parents(".row").find("select[name$='ipType']").val();
|
||||||
|
}
|
||||||
var ipPattern=$(element).parents(".row").siblings().find("select[name$='ipPattern']").val();
|
var ipPattern=$(element).parents(".row").siblings().find("select[name$='ipPattern']").val();
|
||||||
|
if(!ipPattern){
|
||||||
|
ipPattern=$(element).parents(".row").find("select[name$='ipPattern']").val();
|
||||||
|
}
|
||||||
if(typeInt==4){
|
if(typeInt==4){
|
||||||
if(ipPattern){
|
if(ipPattern){
|
||||||
if(ipPattern==1){//ip/掩码格式
|
if(ipPattern==1){//ip/掩码格式
|
||||||
@@ -231,6 +237,9 @@ jQuery.validator.addMethod("ipMask",function(value, element) {
|
|||||||
if(value.length==0||value.trim().length==0){return true;}
|
if(value.length==0||value.trim().length==0){return true;}
|
||||||
obj=value;
|
obj=value;
|
||||||
var typeInt=$(element).parents(".row").siblings().find("select[name$='ipType']").val();
|
var typeInt=$(element).parents(".row").siblings().find("select[name$='ipType']").val();
|
||||||
|
if(!typeInt){
|
||||||
|
typeInt=$(element).parents(".row").find("select[name$='ipType']").val();
|
||||||
|
}
|
||||||
if(typeInt==4){
|
if(typeInt==4){
|
||||||
if(obj=="255.255.255.255"){
|
if(obj=="255.255.255.255"){
|
||||||
return true;
|
return true;
|
||||||
@@ -249,6 +258,9 @@ jQuery.validator.addMethod("portCheck",function(value, element) {
|
|||||||
if(value.length==0||value.trim().length==0){return true;}
|
if(value.length==0||value.trim().length==0){return true;}
|
||||||
obj=value;
|
obj=value;
|
||||||
var typeInt=$(element).parents(".row").siblings().find("select[name$='portPattern']").val();
|
var typeInt=$(element).parents(".row").siblings().find("select[name$='portPattern']").val();
|
||||||
|
if(!typeInt){
|
||||||
|
typeInt=$(element).parents(".row").find("select[name$='portPattern']").val();
|
||||||
|
}
|
||||||
if(typeInt==1){//port 0~65535
|
if(typeInt==1){//port 0~65535
|
||||||
return this.optional(element)||(/^([0-9]+)$/.test(value) && (RegExp.$1 <=65535 && RegExp.$1 >=0));
|
return this.optional(element)||(/^([0-9]+)$/.test(value) && (RegExp.$1 <=65535 && RegExp.$1 >=0));
|
||||||
}else if(typeInt==2){// port -mask 0~65535/0~65535
|
}else if(typeInt==2){// port -mask 0~65535/0~65535
|
||||||
|
|||||||
Reference in New Issue
Block a user