diff --git a/src/main/java/com/nis/web/service/configuration/IpCfgService.java b/src/main/java/com/nis/web/service/configuration/IpCfgService.java index 880fbefa8..979f58ffb 100644 --- a/src/main/java/com/nis/web/service/configuration/IpCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/IpCfgService.java @@ -161,15 +161,15 @@ public class IpCfgService extends CrudService { ipList.add(ip); //调用服务接口下发配置数据 json=gsonToJson(ipList); - logger.info("IP管控下发配置参数:"+json); + logger.info("IP配置下发配置参数:"+json); //调用服务接口下发配置 try { ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json); if(result!=null){ - logger.info("IP管控配置下发响应信息:"+result.getMsg()); + logger.info("IP配置配置下发响应信息:"+result.getMsg()); } } catch (Exception e) { - logger.error("IP管控配置下发失败",e); + logger.error("IP配置配置下发失败",e); throw e; } }else{ @@ -199,15 +199,15 @@ public class IpCfgService extends CrudService { maatBean.setVersion(Constants.MAAT_VERSION); //调用服务接口下发配置数据 json=gsonToJson(maatBean); - logger.info("IP管控下发配置参数:"+json); + logger.info("IP配置下发配置参数:"+json); //调用服务接口下发配置 try { ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); if(result!=null){ - logger.info("IP管控配置下发响应信息:"+result.getMsg()); + logger.info("IP配置配置下发响应信息:"+result.getMsg()); } } catch (Exception e) { - logger.error("IP管控配置下发失败",e); + logger.error("IP配置配置下发失败",e); throw e; } } @@ -222,10 +222,10 @@ public class IpCfgService extends CrudService { //调用服务接口取消配置 try { ToMaatResult result = ConfigServiceUtil.put(json, 2); - logger.info("IP管控取消配置响应信息:"+result.getMsg()); + logger.info("IP配置取消配置响应信息:"+result.getMsg()); } catch (Exception e) { e.printStackTrace(); - logger.info("IP管控取消配置失败"); + logger.info("IP配置取消配置失败"); throw e; } }else{ diff --git a/src/main/java/com/nis/web/service/configuration/StringCfgService.java b/src/main/java/com/nis/web/service/configuration/StringCfgService.java index 036372e75..65896e0de 100644 --- a/src/main/java/com/nis/web/service/configuration/StringCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/StringCfgService.java @@ -202,7 +202,7 @@ public class StringCfgService extends CrudService { } catch (Exception e) { e.printStackTrace(); logger.info("域名白名单配置下发失败"); - throw new MaatConvertException(":"+e.getMessage()); + throw e; } }else if(cfg.getIsAudit()==3){ maatCfg.setCompileId(cfg.getCompileId()); @@ -224,7 +224,7 @@ public class StringCfgService extends CrudService { } catch (Exception e) { e.printStackTrace(); logger.info("域名白名单取消配置失败"); - throw new MaatConvertException(":"+e.getMessage()); + throw e; } } } @@ -302,7 +302,7 @@ public class StringCfgService extends CrudService { } catch (Exception e) { e.printStackTrace(); logger.info("域名配置下发失败"); - throw new MaatConvertException(":"+e.getMessage()); + throw e; } }else if(cfg.getIsAudit()==3){ maatCfg.setCompileId(cfg.getCompileId()); @@ -324,7 +324,7 @@ public class StringCfgService extends CrudService { } catch (Exception e) { e.printStackTrace(); logger.info("域名取消配置失败"); - throw new MaatConvertException(":"+e.getMessage()); + throw e; } } } diff --git a/src/main/webapp/WEB-INF/include/form/areaInfo.jsp b/src/main/webapp/WEB-INF/include/form/areaInfo.jsp index 13cd3a2bc..9c6dc2ab8 100644 --- a/src/main/webapp/WEB-INF/include/form/areaInfo.jsp +++ b/src/main/webapp/WEB-INF/include/form/areaInfo.jsp @@ -144,7 +144,7 @@ $(function(){
@@ -171,7 +171,7 @@ $(function(){
- +
@@ -295,7 +295,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 b8be3c0ef..41f21ed3d 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 @@ -323,6 +323,58 @@ jQuery.validator.addMethod("areaControl",function(value, element) { return true; } }); +jQuery.validator.addMethod("areaIp",function(value, element) { + 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 msg=$.validator.messages.areaIpPrefix; + if(typeInt==4){ + if(ipPattern==3){ + if(value=='0.0.0.0'){ + $.validator.messages.areaIp=msg+'0.0.0.0'; + return false; + }else{ + return true; + } + }else if(ipPattern==2){ + if(value=='0.0.0.0-1.1.1.1'){ + $.validator.messages.areaIp=msg+'0.0.0.0-1.1.1.1'; + return false; + }else{ + return true; + } + }else if(ipPattern==1){ + if(value=='0.0.0.0/8'){ + $.validator.messages.areaIp=msg+'0.0.0.0/8'; + return false; + }else{ + return true; + } + } + }else if(typeInt==6){ + if(ipPattern==3){ + if(value=='::'){ + $.validator.messages.areaIp=msg+'::'; + return false; + }else{ + return true; + } + }else if(ipPattern==2){ + if(value=='::-::'){ + $.validator.messages.areaIp=msg+'::-::'; + return false; + }else{ + return true; + } + }else if(ipPattern==1){ + if(value=='::/64'){ + $.validator.messages.areaIp=msg+'::/64'; + return false; + }else{ + return true; + } + } + } +}); //ip v4转数字 var ipToNumber=function (ip){ var num =0; diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js index 609ba9ff9..40e8b2f72 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js @@ -48,6 +48,7 @@ all: "all", ip_subnet: "Subnet", ip_range: "ip Range", - timeout:"timeout" + timeout:"timeout", + areaIpPrefix:"Forbiden value: " }); }(jQuery)); diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js index 85dff78e3..ca9e1b322 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js @@ -46,6 +46,7 @@ all: "all", ip_subnet: "Subnet", ip_range: "ip Range", - timeout:"timeout" + timeout:"timeout", + areaIpPrefix:"Forbiden value: " }); }(jQuery)); \ No newline at end of file diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js index c0329f45c..36ee971fa 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js @@ -50,6 +50,7 @@ ip_subnet: "Subnet", ip_subnet: "Subnet", ip_range: "ip Range", - timeout:"超时" + timeout:"超时", + areaIpPrefix:"禁止使用的值: " }); }(jQuery));