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=?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=8C=E5=B0=86***and***=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=A0=BC=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/configuration/BaseStringCfg.java | 2 +- .../configuration/ComplexkeywordCfg.java | 3 +++ src/main/java/com/nis/util/Constants.java | 1 + .../configuration/ntc/WebsiteController.java | 2 +- .../com/nis/web/dao/FunctionRegionDictDao.xml | 2 +- .../java/com/nis/web/service/BaseService.java | 20 ++++++++++++------- src/main/resources/nis.properties | 4 +++- .../views/cfg/fileTransfer/ftpSubList.jsp | 3 ++- .../WEB-INF/views/cfg/mail/mailForm.jsp | 13 ++---------- .../WEB-INF/views/cfg/mail/mailSubList.jsp | 5 ++++- .../WEB-INF/views/cfg/website/dnsSubList.jsp | 5 ++++- .../WEB-INF/views/cfg/website/httpSubList.jsp | 10 +++++----- .../WEB-INF/views/cfg/website/sslSubList.jsp | 2 +- .../webapp/static/global/css/components.css | 14 ++++++++++++- .../webapp/static/global/scripts/common.js | 13 ++++++++++++ .../static/global/scripts/jquery.tagsinput.js | 2 +- 16 files changed, 68 insertions(+), 33 deletions(-) diff --git a/src/main/java/com/nis/domain/configuration/BaseStringCfg.java b/src/main/java/com/nis/domain/configuration/BaseStringCfg.java index e3f2c150e..7c22d86d3 100644 --- a/src/main/java/com/nis/domain/configuration/BaseStringCfg.java +++ b/src/main/java/com/nis/domain/configuration/BaseStringCfg.java @@ -131,7 +131,7 @@ public class BaseStringCfg extends BaseCfg { */ public String getCfgKeywords() { - cfgKeywords = StringEscapeUtils.unescapeHtml4(cfgKeywords); +// cfgKeywords = StringEscapeUtils.unescapeHtml4(cfgKeywords); /*cfgKeywords = cfgKeywords.replace("&", "\\&"); cfgKeywords = cfgKeywords.replace(" ", "\\b"); cfgKeywords = cfgKeywords.replace("\\", "\\\\"); diff --git a/src/main/java/com/nis/domain/configuration/ComplexkeywordCfg.java b/src/main/java/com/nis/domain/configuration/ComplexkeywordCfg.java index 773981328..e65a165d4 100644 --- a/src/main/java/com/nis/domain/configuration/ComplexkeywordCfg.java +++ b/src/main/java/com/nis/domain/configuration/ComplexkeywordCfg.java @@ -8,6 +8,8 @@ */ package com.nis.domain.configuration; +import org.apache.commons.lang3.StringEscapeUtils; + import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; @@ -73,6 +75,7 @@ public class ComplexkeywordCfg extends BaseCfg{ this.district = district; } public String getCfgKeywords() { +// cfgKeywords = StringEscapeUtils.unescapeHtml4(cfgKeywords); return cfgKeywords; } public void setCfgKeywords(String cfgKeywords) { diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index 2ee2bfce9..e1fab5abe 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -302,4 +302,5 @@ public final class Constants { public static final String SSL_SAN_REGION = Configurations.getStringProperty("ssl_san_region","ssl_san"); public static final String SSL_CA_REGION = Configurations.getStringProperty("ssl_ca_region","ssl_ca"); + public static final String KEYWORD_EXPR = Configurations.getStringProperty("keyword_expr","***and***"); } diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java b/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java index a3709798b..874e3f412 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java @@ -266,7 +266,7 @@ public class WebsiteController extends BaseController{ CfgIndexInfo entity = new CfgIndexInfo(); String[] idArray = ids.split(","); for(String id :idArray){ - entity = websiteCfgService.getHttpCfg(Long.parseLong(id)); + entity = websiteCfgService.getSslCfg(Long.parseLong(id)); entity.setIsAudit(isAudit); entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); diff --git a/src/main/java/com/nis/web/dao/FunctionRegionDictDao.xml b/src/main/java/com/nis/web/dao/FunctionRegionDictDao.xml index 9e81d33eb..9d39bbd61 100644 --- a/src/main/java/com/nis/web/dao/FunctionRegionDictDao.xml +++ b/src/main/java/com/nis/web/dao/FunctionRegionDictDao.xml @@ -30,7 +30,7 @@ AND config_region_code=#{configRegionCode,jdbcType=VARCHAR} - order by dict_id + order by dict_id,config_region_code \ No newline at end of file diff --git a/src/main/java/com/nis/web/service/BaseService.java b/src/main/java/com/nis/web/service/BaseService.java index c7a438bc2..eefc3424a 100644 --- a/src/main/java/com/nis/web/service/BaseService.java +++ b/src/main/java/com/nis/web/service/BaseService.java @@ -8,6 +8,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.apache.commons.lang3.StringEscapeUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; @@ -336,13 +337,8 @@ public abstract class BaseService { cfg.setRegionId(ConfigServiceUtil.getId(3, 1).get(0)); cfg.setAuditTime(baseCfg.getAuditTime()); cfg.setIsValid(baseCfg.getIsValid()); - String cfgKeywords = cfg.getCfgKeywords(); - cfgKeywords=cfgKeywords.replace("\\", "\\\\"); - cfgKeywords=cfgKeywords.replace("&", "\\&"); - cfgKeywords=cfgKeywords.replace(" ", "\\b"); - //英文逗号在界面表示多个关键字的与表达式,maat端以&表示 - cfgKeywords=cfgKeywords.replace(",", "&"); - cfg.setCfgKeywords(cfgKeywords); + //处理配置关键字转译 + cfg.setCfgKeywords(keywordsEscape(cfg.getCfgKeywords())); dstList.add(cfg); regionValue = cfg.getCfgType(); } @@ -560,4 +556,14 @@ public abstract class BaseService { } } } + public static String keywordsEscape(String cfgKeywords){ + //不转译特殊字符 + cfgKeywords = StringEscapeUtils.unescapeHtml4(cfgKeywords); + cfgKeywords=cfgKeywords.replace("\\", "\\\\"); + cfgKeywords=cfgKeywords.replace("&", "\\&"); + cfgKeywords=cfgKeywords.replace(" ", "\\b"); + //***and***在界面表示多个关键字的与表达式,此特殊字符串在common.js中使用定义,maat端以&表示 + cfgKeywords=cfgKeywords.replace(Constants.KEYWORD_EXPR, "&"); + return cfgKeywords; + } } diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index 7fbbc25ec..56b15cd83 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -262,4 +262,6 @@ voip_account=av_voip_account ssl_sni_region=ssl_sni ssl_san_region=ssl_san ssl_ca_region=ssl_ca -ssl_ip_region=ssl_ip \ No newline at end of file +ssl_ip_region=ssl_ip +#存在与表达式的关键字特殊分隔符 +keyword_expr=***and*** \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpSubList.jsp index 0fc324b23..b7727c52a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpSubList.jsp @@ -115,7 +115,8 @@
- +
diff --git a/src/main/webapp/WEB-INF/views/cfg/mail/mailForm.jsp b/src/main/webapp/WEB-INF/views/cfg/mail/mailForm.jsp index 4fbd92ca3..1e4c521bc 100644 --- a/src/main/webapp/WEB-INF/views/cfg/mail/mailForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/mail/mailForm.jsp @@ -77,16 +77,7 @@ /* $("span[title='add']").on("click", function() { $(".ipPort0").removeClass("hidden"); }); */ - $(".district").each(function(){ - if($(this).siblings(".otherValue").val()!=''){ - if($(this).val()!=$(this).siblings(".otherValue").val()){ - $(this).find("option[value=others]").attr("selected","selected"); - $(this).siblings(".otherValue").prop("type","text"); - } - } - - }); - + }); //业务窗口打开 @@ -225,7 +216,7 @@ - +
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
diff --git a/src/main/webapp/WEB-INF/views/cfg/mail/mailSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/mail/mailSubList.jsp index 55d9ee584..c62f76806 100644 --- a/src/main/webapp/WEB-INF/views/cfg/mail/mailSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/mail/mailSubList.jsp @@ -121,7 +121,10 @@
- + +
diff --git a/src/main/webapp/WEB-INF/views/cfg/website/dnsSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/dnsSubList.jsp index 566612532..36a14c42d 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/dnsSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/dnsSubList.jsp @@ -120,7 +120,10 @@
- + +
diff --git a/src/main/webapp/WEB-INF/views/cfg/website/httpSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/httpSubList.jsp index 080d5cddc..09a8cc02e 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/httpSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/httpSubList.jsp @@ -143,7 +143,7 @@
- +
@@ -198,7 +198,7 @@
- +
@@ -247,7 +247,7 @@
- +
@@ -302,7 +302,7 @@
- +
@@ -352,7 +352,7 @@
- +
diff --git a/src/main/webapp/WEB-INF/views/cfg/website/sslSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/sslSubList.jsp index a6f9a6325..e96bca242 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/sslSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/sslSubList.jsp @@ -115,7 +115,7 @@
- +
diff --git a/src/main/webapp/static/global/css/components.css b/src/main/webapp/static/global/css/components.css index 91118b18c..4e6af9b72 100644 --- a/src/main/webapp/static/global/css/components.css +++ b/src/main/webapp/static/global/css/components.css @@ -22551,4 +22551,16 @@ transition: background-color .1s ease-in-out; border: 1px solid #c2cad8; padding: 5px; } - +.keyword_tag{ + border: 1px solid #a5d24a; + -moz-border-radius:2px; + -webkit-border-radius:2px; + display: block; + float: left; + padding: 5px; + text-decoration:none; + background: #cde69c; + color: #638421; + margin-right: 5px; + margin-bottom:-15px; +} diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index 20be3dae3..8cbbbd322 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -215,6 +215,7 @@ $(function(){ $(tagsInputSettings).tagsInput({ width:$(".form-control").width(), defaultText:'please input keywords', + 'delimiter':'***and***',//特殊字符串分隔与表达式的多关键词 onAddTag:function(tag,size){ //var keywordValue = ""; var objNamePrefix = $(this).attr("name").split("cfgKeywords")[0]; @@ -260,6 +261,18 @@ $(function(){ } })*/ + //处理增强字符串配置的匹配区域 + $(".district").each(function(){ + if($(this).siblings(".otherValue").val()!=''){ + if($(this).val()!=$(this).siblings(".otherValue").val()){ + $(this).find("option[value=others]").attr("selected","selected"); + $(this).siblings(".otherValue").prop("type","text"); + } + } + + }); + + }); var switchIpType=function(obj){ var type=$(obj).val(); diff --git a/src/main/webapp/static/global/scripts/jquery.tagsinput.js b/src/main/webapp/static/global/scripts/jquery.tagsinput.js index 6b9f47cd1..0ffc4bb02 100644 --- a/src/main/webapp/static/global/scripts/jquery.tagsinput.js +++ b/src/main/webapp/static/global/scripts/jquery.tagsinput.js @@ -297,7 +297,7 @@ //if (event.which==event.data.delimiter.charCodeAt(0) || event.which==38 || event.which==13) { //38Ϊ& - if (event.which==event.data.delimiter.charCodeAt(0)||event.which==13) { + if (event.which==13) { event.preventDefault(); if( (event.data.minChars <= $(event.data.fake_input).val().length) && (!event.data.maxChars || (event.data.maxChars >= $(event.data.fake_input).val().length)) ) $(event.data.real_input).addTag($(event.data.fake_input).val(),{focus:true,unique:(settings.unique)});