修改areaInfo.jsp加入验证:action为drop和loop的时候提示用户无需区域管控
This commit is contained in:
@@ -12,12 +12,12 @@ $(function(){
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="whether_area_block"/></label>
|
||||
<div class="col-md-6">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="isAreaEffective" value="1" class="required"
|
||||
<input type="radio" name="isAreaEffective" value="1" class="required areaControl"
|
||||
<c:if test="${_cfg.isAreaEffective==1}">checked</c:if>
|
||||
><spring:message code="yes"/>
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="isAreaEffective" value="0" class="required"
|
||||
<input type="radio" name="isAreaEffective" value="0" class="required areaControl"
|
||||
<c:if test="${_cfg.isAreaEffective==0}">checked</c:if>
|
||||
><spring:message code="no"/>
|
||||
</label>
|
||||
|
||||
@@ -21,6 +21,11 @@ $(function(){
|
||||
if($(this).val()==0x20||$(this).val()==0x60){
|
||||
$("#cfgRegionCode").val($("#cfgRegionCodeCallback").val());
|
||||
$("#cfgType").val($("#cfgTypeCallback").val());
|
||||
$("input[name='isAreaEffective']").each(function(){
|
||||
if($(this).val()==0){
|
||||
$(this).click();
|
||||
}
|
||||
})
|
||||
}else{
|
||||
$("#cfgRegionCode").val($("#cfgRegionCodeMaat").val());
|
||||
$("#cfgType").val($("#cfgTypeMaat").val());
|
||||
|
||||
@@ -323,6 +323,15 @@ jQuery.validator.addMethod("chooseAreaOrIsp",function(value, element) {
|
||||
return true;
|
||||
|
||||
});
|
||||
jQuery.validator.addMethod("areaControl",function(value, element) {
|
||||
var action=$(element).closest(".row").siblings(".row").find("input[name$=action]:radio:checked").val();
|
||||
if((action==0x20||action==0x60)&&value==1){
|
||||
$.validator.messages.areaControl=$.validator.messages.areaControl
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
});
|
||||
//ip v4转数字
|
||||
var ipToNumber=function (ip){
|
||||
var num =0;
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
notStartZero:"Please enter a valid Integer",
|
||||
portRange:"Please enter a valid Integer",
|
||||
portMaskRange:"Port must be a valid Integer and mask must between 0 and 65535.The correct pattern is \"port/mask\".",
|
||||
chooseAreaOrIsp:"The region and the oprater must choose one"
|
||||
chooseAreaOrIsp:"The region and the oprater must choose one",
|
||||
areaControl:"Action drop and loop do not need area control"
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
portCheck: " Пожалуйста, введите правильный порт.",
|
||||
portRange:"Please enter a valid Integer",
|
||||
portMaskRange:"Port must be a valid Integer and mask must between 0 and 65535.The correct pattern is \"port/mask\".",
|
||||
chooseAreaOrIsp:"The region and the oprater must choose one"
|
||||
chooseAreaOrIsp:"The region and the oprater must choose one",
|
||||
areaControl:"Action drop and loop do not need area control"
|
||||
});
|
||||
}(jQuery));
|
||||
@@ -34,6 +34,7 @@
|
||||
ipRange1:"起始IP值应小于结束IP值",
|
||||
portRange:"端口必须为整数,非0数字不能以0开头",
|
||||
portMaskRange:"端口必须为整数,掩码范围0-65535,非0数字不能以0开头。格式为\"端口/掩码\"",
|
||||
chooseAreaOrIsp:"区域和运营商必选一个"
|
||||
chooseAreaOrIsp:"区域和运营商必选一个",
|
||||
areaControl:"丢弃和回流动作不能区域管控"
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
Reference in New Issue
Block a user