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)});