From 1828b726bac74f6d1158e20ccc801759afde3f85 Mon Sep 17 00:00:00 2001 From: chenjinsong Date: Sun, 8 Apr 2018 17:07:32 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E5=A2=9E=E5=BC=BA=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E7=AE=A1=E6=8E=A7=E7=9A=84ip=E7=B1=BB=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=202.=E5=B0=86ip=E5=9C=B0=E5=9D=80=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E6=8F=90=E7=A4=BA=E8=AF=AD=E6=8F=90=E5=87=BA?= =?UTF-8?q?=E8=87=B3=E5=9B=BD=E9=99=85=E5=8C=96=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SystemServiceController.java | 1 - .../WEB-INF/include/form/multiple/ipInfo.jsp | 44 +++++++++---------- .../webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp | 3 +- .../WEB-INF/views/cfg/multipleCfgForm.jsp | 30 +++++++++++++ .../1.11.0/localization/messages_en.js | 3 +- .../1.11.0/localization/messages_ru.js | 3 +- .../1.11.0/localization/messages_zh.js | 3 +- 7 files changed, 59 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/nis/web/controller/systemService/SystemServiceController.java b/src/main/java/com/nis/web/controller/systemService/SystemServiceController.java index 87a41f48e..714d9d147 100644 --- a/src/main/java/com/nis/web/controller/systemService/SystemServiceController.java +++ b/src/main/java/com/nis/web/controller/systemService/SystemServiceController.java @@ -125,7 +125,6 @@ public class SystemServiceController extends BaseController { public String delete(Model model, SystemServiceInfo systemServiceInfo, HttpServletRequest request, HttpServletResponse response) { //增加后台校验,当数据是初始数据时不允许删除 if(systemServiceInfo.getIsInitianlize().intValue() == 1) { - addMessage(model, "delete_failed"); return "/error/403"; } diff --git a/src/main/webapp/WEB-INF/include/form/multiple/ipInfo.jsp b/src/main/webapp/WEB-INF/include/form/multiple/ipInfo.jsp index 843cf021a..f40a2da4d 100644 --- a/src/main/webapp/WEB-INF/include/form/multiple/ipInfo.jsp +++ b/src/main/webapp/WEB-INF/include/form/multiple/ipInfo.jsp @@ -36,14 +36,14 @@
- - > @@ -69,10 +69,10 @@
- + - +
@@ -92,10 +92,10 @@
- + - +
@@ -118,10 +118,10 @@
- + - +
@@ -141,10 +141,10 @@
- + - +
@@ -166,10 +166,10 @@
- + - +
@@ -189,10 +189,10 @@
- + - +
@@ -214,10 +214,10 @@
- + - +
@@ -237,10 +237,10 @@
- + - +
@@ -262,14 +262,14 @@
- > - > @@ -294,7 +294,7 @@
- > @@ -302,7 +302,7 @@ - > diff --git a/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp index dd226e1fe..e3a9c4643 100644 --- a/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp @@ -182,8 +182,7 @@ $(function(){ checkIp = /\S+/; } return this.optional(element) || (checkIp.test(value) && (RegExp.$1 < 256 && RegExp.$2 < 256 && RegExp.$3 < 256 && RegExp.$4 < 256)); - }, - "请输入正确的IP!" + } ); }); diff --git a/src/main/webapp/WEB-INF/views/cfg/multipleCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/multipleCfgForm.jsp index 6176e91cf..525838eba 100644 --- a/src/main/webapp/WEB-INF/views/cfg/multipleCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/multipleCfgForm.jsp @@ -40,6 +40,19 @@ $(function(){ errorContainer: "#messageBox" }); + $.validator.addMethod( + "checkIp", + function(value, element, params) { + var checkIp; + if ($("[name$=ipType]").val() == 4) { + checkIp = /((25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))/; + } else { + checkIp = /\S+/; + } + return this.optional(element) || (checkIp.test(value) && (RegExp.$1 < 256 && RegExp.$2 < 256 && RegExp.$3 < 256 && RegExp.$4 < 256)); + } + ); + $("#ipSelect").change(function(){ if($(this).prop("checked")){ $("[name^='ipCfg']").removeProp("disabled"); @@ -56,6 +69,23 @@ $(function(){ $("[name^='ipCfg']").attr("disabled",true); } }); + + function myValidate(flag) { + if (flag) { + myValidate(false); + $("[name=ipCfg\\[http_ip_cfg\\]\\.srcIp]").each(function(){ + $(this).rules("add", { + checkIp: true, + messages: { + required:'' + } + }); + }); + } else { + + } + } + $(".district").on("change",function(){ var text=$(this).find("option:selected").text().toLowerCase(); var other=$(this).parent("div").siblings(".otherValue"); 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 30505d7b8..47a6425f5 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 @@ -20,6 +20,7 @@ rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."), range: $.validator.format("Please enter a value between {0} and {1}."), max: $.validator.format("Please enter a value less than or equal to {0}."), - min: $.validator.format("Please enter a value greater than or equal to {0}.") + min: $.validator.format("Please enter a value greater than or equal to {0}."), + checkIp: $.validator.format("Please enter a correct IP address.") }); }(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 46dc78168..307dec287 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 @@ -20,6 +20,7 @@ rangelength: $.validator.format("Пожалуйста, введите значение длиной от {0} до {1} символов."), range: $.validator.format("Пожалуйста, введите число от {0} до {1}."), max: $.validator.format("Пожалуйста, введите число, меньшее или равное {0}."), - min: $.validator.format("Пожалуйста, введите число, большее или равное {0}.") + min: $.validator.format("Пожалуйста, введите число, большее или равное {0}."), + min: $.validator.format(" Пожалуйста, введите  правильный  IP - адрес.") }); }(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 aee0edc3f..533e091bb 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 @@ -20,6 +20,7 @@ rangelength: $.validator.format("请输入一个长度介于 {0} 和 {1} 之间的字符串"), range: $.validator.format("请输入一个介于 {0} 和 {1} 之间的值"), max: $.validator.format("请输入一个最大为 {0} 的值"), - min: $.validator.format("请输入一个最小为 {0} 的值") + min: $.validator.format("请输入一个最小为 {0} 的值"), + checkIp: $.validator.format("请输入一个合法的IP") }); }(jQuery));