From aa5eccf995c439a9488090e6a70f2d34e28d0592 Mon Sep 17 00:00:00 2001 From: zhangwei Date: Sat, 19 Jan 2019 14:39:40 +0600 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8B=A6=E6=88=AA=E7=AD=96?= =?UTF-8?q?=E7=95=A5=E7=9A=84=E8=AF=81=E4=B9=A6=E4=BF=A1=E6=81=AF=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E8=A7=84=E5=88=99=EF=BC=9A=201.=20Keyring=E7=9A=84?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E5=B7=B2=E7=94=9F=E6=95=88=E7=9A=84=E8=AF=81=E4=B9=A6?= =?UTF-8?q?=EF=BC=9B=202.=20=E5=A6=82=E9=80=89=E6=8B=A9=E4=BA=86=E5=AE=9E?= =?UTF-8?q?=E4=BD=93=E8=AF=81=E4=B9=A6=EF=BC=8C=E5=BF=85=E9=A1=BB=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=9F=9F=E5=90=8D=EF=BC=8C=E6=88=96=E8=80=85IP?= =?UTF-8?q?=E4=B8=8E=E5=9F=9F=E5=90=8D=E7=9A=84=E7=BB=84=E5=90=88=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=9B=203.=20=E5=9F=9F=E5=90=8D=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E5=8C=B9=E9=85=8D=E6=96=B9=E5=BC=8F=E4=B8=BA?= =?UTF-8?q?=E5=AE=8C=E5=85=A8=E5=8C=B9=E9=85=8D=EF=BC=8C=E5=88=99=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=E5=BF=85=E9=A1=BB=E4=B8=8E=E6=89=80=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E7=9A=84=E5=AE=9E=E4=BD=93=E8=AF=81=E4=B9=A6=E7=9A=84CN?= =?UTF-8?q?=E5=92=8CSAN=E7=9B=B8=E5=90=8C=E3=80=82=E5=A6=82=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E6=96=B9=E5=BC=8F=E4=B8=BA=E5=90=8E=E7=BC=80=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=EF=BC=8C=E5=88=99=E5=9F=9F=E5=90=8D=E9=A1=BB=E4=B8=8E?= =?UTF-8?q?=E6=89=80=E9=80=89=E6=8B=A9=E7=9A=84=E5=AE=9E=E4=BD=93=E8=AF=81?= =?UTF-8?q?=E4=B9=A6=E7=9A=84CN=E5=92=8CSAN=E5=90=8E=E7=BC=80=E7=9B=B8?= =?UTF-8?q?=E5=90=8C=EF=BC=9B=204.=20=E5=A6=82=E9=80=89=E6=8B=A9=E4=BA=86?= =?UTF-8?q?=E4=B8=AD=E9=97=B4=E8=AF=81=E4=B9=A6=E6=88=96=E8=80=85=E6=A0=B9?= =?UTF-8?q?=E8=AF=81=E4=B9=A6=EF=BC=8C=E5=88=99=E5=8F=AF=E9=85=8D=E7=BD=AE?= =?UTF-8?q?IP=EF=BC=8C=E6=88=96=E8=80=85=E5=9F=9F=E5=90=8D=EF=BC=8C?= =?UTF-8?q?=E6=88=96=E8=80=85=E4=B8=A4=E8=80=85=E7=BB=84=E5=90=88=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Conflicts: src/main/resources/messages/message_en.properties src/main/resources/messages/message_ru.properties src/main/resources/messages/message_zh_CN.properties --- .../proxy/InterceptController.java | 12 ++-- .../resources/messages/message_en.properties | 7 ++- .../resources/messages/message_ru.properties | 8 ++- .../messages/message_zh_CN.properties | 7 ++- .../views/cfg/intercept/interceptForm.jsp | 56 ++++++++++++------- 5 files changed, 60 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java b/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java index 77c77c68e..820f03c81 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java @@ -88,12 +88,12 @@ public class InterceptController extends CommonController { } // 获取证书信息 List certificateList = new ArrayList(); - if (entity.getFunctionId().equals(200)) { - certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip"); - } - if (entity.getFunctionId().equals(201)) { - certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain"); - } +// if (entity.getFunctionId().equals(200)) { + certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, null); +// } +// if (entity.getFunctionId().equals(201)) { +// certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain"); +// } model.addAttribute("certificateList", certificateList); model.addAttribute("_cfg", entity); diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index f8d59f674..74ac69470 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1475,4 +1475,9 @@ block_drop=Block(Drop) mail_record=Mail Records ssl_record=SSL Records http_record=HTTP Records -second_bps=bps \ No newline at end of file +second_bps=bps +ip_existed=IP has existed! +user_check=In use, Can not be deleted! +deletedAsnTip=The asnId ASN configuration with ID cfgId is deleted; +reedit=Please re-edit! +intercep_domain_required_tip=Domain is required \ No newline at end of file diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 0c0c00b84..81bcae207 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1479,4 +1479,10 @@ framework_log=\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e block_drop=\u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435(\u041f\u0430\u0434\u0435\u043d\u0438\u0435) mail_record=\u0417\u0430\u043f\u0438\u0441\u0438 \u041f\u043e\u0447\u0442\u044b ssl_record=SSL \u0417\u0430\u043f\u0438\u0441\u0438 -http_record=HTTP \u0417\u0430\u043f\u0438\u0441\u0438 \ No newline at end of file +http_record=HTTP \u0417\u0430\u043f\u0438\u0441\u0438 +second_bps=bps +ip_existed=IP \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442! +user_check=\u0414\u0430\u043D\u043D\u044B\u0439 \u043E\u0431\u044A\u0435\u043A\u0442 \u0437\u0430\u043D\u044F\u0442, \u043D\u0435\u043B\u044C\u0437\u044F \u0443\u0434\u0430\u043B\u0438\u0442\u044C! +deletedAsnTip=\u041A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044F \u2116 cfgId \u0441 ASN asnId \u0431\u044B\u043B\u0430 \u0443\u0434\u0430\u043B\u0435\u043D\u0430; +reedit=\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0437\u0430\u043D\u043E\u0432\u043E! +intercep_domain_required_tip=Domain is required \ No newline at end of file diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index 188458816..0cfa977a9 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1475,4 +1475,9 @@ block_drop=\u5c01\u5835(\u4e22\u5f03) mail_record=\u90ae\u4ef6\u6cdb\u6536 ssl_record=SSL\u6cdb\u6536 http_record=HTTP\u6cdb\u6536 -second_bps=bps \ No newline at end of file +second_bps=bps +ip_existed=IP\u5DF2\u5B58\u5728\uFF01 +user_check=\u6B63\u5728\u4F7F\u7528\uFF0C\u4E0D\u80FD\u5220\u9664\uFF01 +deletedAsnTip=\u914D\u7F6EID\u4E3AcfgId\u7684asnId ASN\u914D\u7F6E\u5DF2\u88AB\u5220\u9664; +reedit=\u8BF7\u91CD\u65B0\u7F16\u8F91\uFF01 +intercep_domain_required_tip=\u57DF\u540D\u4FE1\u606F\u5FC5\u987B\u914D\u7F6E \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp index 8b93723ca..2c5d432bd 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp @@ -50,15 +50,25 @@ var flag = true; var actionValue=$("input[name=action]:checked").val(); - flag=validDomain(actionValue); - if(!flag){ - return; - } + //代表所有业务都隐藏了,提示必须增加一种业务数据 if($(".boxSolid").length ==$(".boxSolid.hidden").length){ top.$.jBox.tip("", ""); return; + }else{ + $(".boxSolid").each(function(){ + if($(this).hasClass("intercept_domain_div")){ + var inputObj = $(this).find("input[name$='cfgRegionCode']"); + flag=validDomain(actionValue,inputObj); + if(!flag){ + return; + } + } + }); + if(!flag){ + return; + } } //代表所有区域都隐藏了,提示必须增加个区域信息 @@ -188,20 +198,27 @@ $("#certDomain").addClass("hidden"); } } - var validDomain=function(actionValue){ + var validDomain=function(actionValue,inputObj){ var flag=false; if(actionValue == 1){ + var serviceType=$(inputObj).attr("serviceType"); + var prefixName=$(inputObj).attr("name").split("cfgRegionCode")[0]; + //var matchMethod=$("select[name='"+prefixName+"matchMethod']").val(); var cert=$(".monitAction").find("select[name='userRegion1']").val(); var keyringType=$(".monitAction").find("select[name='userRegion1']").find("option[value='"+cert+"']").attr("keyringType"); + if(cert != '' && keyringType == 'end-entity'){ + var domainDiv = $(inputObj).parent(".intercept_domain_div").is(':hidden'); + if(domainDiv){ + top.$.jBox.tip("", ""); + return false; + } var cn=$(".monitAction").find("select[name='userRegion1']").find("option[value='"+cert+"']").attr("cn"); if(cn !='' && cn != null){ var cnReg = new RegExp('^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\'+cn.replace("*","")+')+$'); var san=$(".monitAction").find("select[name='userRegion1']").find("option[value='"+cert+"']").attr("san"); if(san != null && san !=''){ - $("input[name$='cfgRegionCode'").each(function(){ - var serviceType=$(this).attr("serviceType"); - var prefixName=$(this).attr("name").split("cfgRegionCode")[0]; + //$(".intercept_domain_div").each(function(){ if(serviceType == "intercept_domain"){ var domain=$("input[name='"+prefixName+"cfgKeywords']").val(); var domain=domain.trim(); @@ -212,25 +229,26 @@ break; } var sanStr=san.split(",")[i].trim(); - if(sanStr.indexOf("*") >-1){ + if(sanStr.indexOf("*") >-1){//如证书域名包含*,则用该域名与配置进行后缀匹配 var sanReg= new RegExp('^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\'+sanStr.replace("*","")+')+$'); if(sanReg.exec(domain) != null){ flag=true; } - }else{ + }else{//证书域名不包含*,则该域名与配置完全匹配 if(sanStr == domain){ //完全匹配 flag=true; } } + } } if(!flag){ - if(cn.indexOf("*") > -1){ + if(cn.indexOf("*") > -1){//如证书域名包含*,则用该域名与配置进行后缀匹配 if(cnReg.exec(domain) != null){ flag=true; } - }else{ + }else{//证书域名不包含*,则该域名与配置完全匹配 if(cn == domain){ //完全匹配 flag=true; } @@ -246,12 +264,10 @@ }else{ $("div[for='"+prefixName+"cfgKeywords']").html(""); } - }); + //}); }else{ flag=false; - $("input[name$='cfgRegionCode'").each(function(){ - var serviceType=$(this).attr("serviceType"); - var prefixName=$(this).attr("name").split("cfgRegionCode")[0]; + //$("input[name$='cfgRegionCode'").each(function(){ if(serviceType == "intercept_domain"){ if(error ==null || error.trim() == ''){ $("div[for='"+prefixName+"cfgKeywords']").html(""); @@ -259,13 +275,11 @@ } } - }); + //}); } }else{ flag=false; - $("input[name$='cfgRegionCode'").each(function(){ - var serviceType=$(this).attr("serviceType"); - var prefixName=$(this).attr("name").split("cfgRegionCode")[0]; + //$("input[name$='cfgRegionCode'").each(function(){ var error=$("div[for='"+prefixName+"cfgKeywords']").html(); if(serviceType == "intercept_domain"){ if(error ==null || error.trim() == ''){ @@ -274,7 +288,7 @@ } } - }); + //}); } }else{ flag=true;