diff --git a/src/main/java/com/nis/util/excel/ExportExcel.java b/src/main/java/com/nis/util/excel/ExportExcel.java index df69418d1..d1bd1f802 100644 --- a/src/main/java/com/nis/util/excel/ExportExcel.java +++ b/src/main/java/com/nis/util/excel/ExportExcel.java @@ -144,6 +144,52 @@ public class ExportExcel { public String[] validRegionFieldAndSetComment(String headerStr,String commentStr,FunctionRegionDict region,FunctionServiceDict service,Properties msgProp){ int index=0; String[] titleInfo=new String[3]; + //p2p_hash_type + if("p2p_hash_type".equals(headerStr)){ + commentStr=""; + List ratelimit=DictUtils.getDictList("P2P_HASH_TYPE"); + if(ratelimit !=null && ratelimit.size()>0){ + for (SysDataDictionaryItem sysDataDictionaryItem : ratelimit) { + if(StringUtil.isEmpty(msgProp.getProperty(sysDataDictionaryItem.getItemValue()))){ + commentStr=commentStr+sysDataDictionaryItem.getItemCode()+"("+sysDataDictionaryItem.getItemValue()+")\n"; + index++; + }else{ + commentStr=commentStr+sysDataDictionaryItem.getItemCode()+"("+msgProp.getProperty(sysDataDictionaryItem.getItemValue())+")\n"; + index++; + } + } + } + if(StringUtil.isEmpty(commentStr)){ + headerStr=""; + commentStr=""; + }else{ + commentStr=msgProp.getProperty("select")+":\n"+commentStr; + index++; + } + } + //p2p_ip_config_type + if("p2p_ip_config_type".equals(headerStr)){ + commentStr=""; + List ratelimit=DictUtils.getDictList("P2P_IP_TYPE"); + if(ratelimit !=null && ratelimit.size()>0){ + for (SysDataDictionaryItem sysDataDictionaryItem : ratelimit) { + if(StringUtil.isEmpty(msgProp.getProperty(sysDataDictionaryItem.getItemValue()))){ + commentStr=commentStr+sysDataDictionaryItem.getItemCode()+"("+sysDataDictionaryItem.getItemValue()+")\n"; + index++; + }else{ + commentStr=commentStr+sysDataDictionaryItem.getItemCode()+"("+msgProp.getProperty(sysDataDictionaryItem.getItemValue())+")\n"; + index++; + } + } + } + if(StringUtil.isEmpty(commentStr)){ + headerStr=""; + commentStr=""; + }else{ + commentStr=msgProp.getProperty("select")+":\n"+commentStr; + index++; + } + } //ratelimit if("ratelimit".equals(headerStr)){ commentStr=""; @@ -743,11 +789,13 @@ public class ExportExcel { for (SysDataDictionaryItem sysDataDictionaryItem : isCaseSenstive) { if(sysDataDictionaryItem.getItemCode().equals("0")){ commentStr=commentStr+sysDataDictionaryItem.getItemCode()+"("+msgProp.getProperty(sysDataDictionaryItem.getItemValue())+")"+"\n"; + list.add(sysDataDictionaryItem.getItemCode()); index++; } if(region.getConfigHex().split(",").length>1){ if(sysDataDictionaryItem.getItemCode().equals("1")){ commentStr=commentStr+sysDataDictionaryItem.getItemCode()+"("+msgProp.getProperty(sysDataDictionaryItem.getItemValue())+")"+"\n"; + list.add(sysDataDictionaryItem.getItemCode()); index++; } } @@ -756,6 +804,7 @@ public class ExportExcel { for (SysDataDictionaryItem sysDataDictionaryItem : isCaseSenstive) { if(sysDataDictionaryItem.getItemCode().equals("1")){ commentStr=commentStr+sysDataDictionaryItem.getItemCode()+"("+msgProp.getProperty(sysDataDictionaryItem.getItemValue())+")"+"\n"; + list.add(sysDataDictionaryItem.getItemCode()); index++; } } diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index ec21da70b..b4147e676 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -57,6 +57,8 @@ import com.nis.domain.configuration.template.IpAllTemplate; import com.nis.domain.configuration.template.IpCfgTemplate; import com.nis.domain.configuration.template.IpPayloadTemplate; import com.nis.domain.configuration.template.IpRateLimitTemplate; +import com.nis.domain.configuration.template.P2pHashStringTemplate; +import com.nis.domain.configuration.template.P2pIpTemplate; import com.nis.domain.configuration.template.StringAllTemplate; import com.nis.domain.log.BaseLogEntity; import com.nis.domain.log.SearchReport; @@ -2783,13 +2785,22 @@ public class BaseController { }else if(regionDict.getFunctionId().equals(212)) { List list = ei.getDataList(IpPayloadTemplate.class); ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list); + }else if(regionDict.getFunctionId().equals(510) && "p2p_ip".equals(regionDict.getConfigServiceType())){ //P2p IP + List list = ei.getDataList(P2pIpTemplate.class); + ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list); }else { List list = ei.getDataList(IpAllTemplate.class); ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list); } }else if(regionDict.getRegionType().equals(2)) {//字符串类 - List list = ei.getDataList(StringAllTemplate.class); - stringCfgs=this.checkStringCfg(serviceDict, regionDict, list); + if(regionDict.getFunctionId().equals(510) && "p2p_hash".equals(regionDict.getConfigServiceType())){ //P2p hash + List list = ei.getDataList(P2pHashStringTemplate.class); + stringCfgs=this.checkStringCfg(serviceDict, regionDict, list); + }else{ + List list = ei.getDataList(StringAllTemplate.class); + stringCfgs=this.checkStringCfg(serviceDict, regionDict, list); + } + }else if(regionDict.getRegionType().equals(3)) {//增强字符串类 List list = ei.getDataList(ComplexStringAllTemplate.class); complexkeywordCfgs=this.checkComplexStringCfg(serviceDict, regionDict, list); diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java b/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java index dbf017dd4..d775109d3 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java @@ -34,6 +34,8 @@ import com.nis.domain.configuration.template.DnsIpTemplate; import com.nis.domain.configuration.template.IpAllTemplate; import com.nis.domain.configuration.template.IpPayloadTemplate; import com.nis.domain.configuration.template.IpRateLimitTemplate; +import com.nis.domain.configuration.template.P2pHashStringTemplate; +import com.nis.domain.configuration.template.P2pIpTemplate; import com.nis.domain.configuration.template.StringAllTemplate; import com.nis.domain.specific.ConfigGroupInfo; import com.nis.exceptions.MaatConvertException; @@ -263,6 +265,11 @@ public class IpController extends BaseController{ ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, DnsIpTemplate.class, 2); excel.setDataList(this.getMsgProp(),classList,null). write(request,response, fileName).dispose(); + }else if(regionDict.getFunctionId().equals(510) && "p2p_ip".equals(regionDict.getConfigServiceType())){ //P2p IP + List classList=new ArrayList(); + ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, P2pIpTemplate.class, 2); + excel.setDataList(this.getMsgProp(),classList,null). + write(request,response, fileName).dispose(); }else{ List classList=new ArrayList(); ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, IpAllTemplate.class, 2); @@ -272,10 +279,18 @@ public class IpController extends BaseController{ } //str类模板 if(regionDict.getRegionType().equals(2)){ - List classList=new ArrayList(); - ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, StringAllTemplate.class, 2); - excel.setDataList(this.getMsgProp(),classList,null). - write(request,response, fileName).dispose(); + if(regionDict.getFunctionId().equals(510) && "p2p_hash".equals(regionDict.getConfigServiceType())){ //P2p hash + List classList=new ArrayList(); + ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, P2pHashStringTemplate.class, 2); + excel.setDataList(this.getMsgProp(),classList,null). + write(request,response, fileName).dispose(); + }else{ + List classList=new ArrayList(); + ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, StringAllTemplate.class, 2); + excel.setDataList(this.getMsgProp(),classList,null). + write(request,response, fileName).dispose(); + } + } //district类模板 if(regionDict.getRegionType().equals(3)){ diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 18d233219..7e29a1823 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1276,8 +1276,8 @@ example_tip=For Example rule_desc_tip=Rule description port_comment_tip=Port must between 0 and 65535 port_mask_comment_tip=Port and port mask must between 0 and 65535 -multi_keywords_tip=Allow multiple keywords to be entered \n and multiple keywords to be replaced by line breaks. -visible_keyword_tip=Single keyword is not allowed to enter \n invisible characters. +multi_keywords_tip=Allow multiple keywords to be entered and multiple keywords to be replaced by line breaks. +visible_keyword_tip=Single keyword is not allowed to enter invisible characters. single_keyword_tip=Only single key input is allowed. ipv4_mask_range_tip=IP mask must between 16 and 32 ipv6_mask_range_tip=IP Mask must between 2 and 128 diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 771a431c5..22170717c 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1296,8 +1296,8 @@ example_tip=For Example rule_desc_tip=Rule description port_comment_tip=Port must between 0 and 65535 port_mask_comment_tip=Port and port mask must between 0 and 65535 -multi_keywords_tip=Allow multiple keywords to be entered \n and multiple keywords to be replaced by line breaks. -visible_keyword_tip=Single keyword is not allowed to enter \n invisible characters. +multi_keywords_tip=Allow multiple keywords to be entered and multiple keywords to be replaced by line breaks. +visible_keyword_tip=Single keyword is not allowed to enter invisible characters. single_keyword_tip=Only single key input is allowed. ipv4_mask_range_tip=IP mask must between 16 and 32 ipv6_mask_range_tip=IP Mask must between 2 and 128 diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index b0d674234..ee92ec2cd 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1271,8 +1271,8 @@ example_tip=For Example rule_desc_tip=Rule description port_comment_tip=Port must between 0 and 65535 port_mask_comment_tip=Port and port mask must between 0 and 65535 -multi_keywords_tip=Allow multiple keywords to be entered \n and multiple keywords to be replaced by line breaks. -visible_keyword_tip=Single keyword is not allowed to enter \n invisible characters. +multi_keywords_tip=Allow multiple keywords to be entered and multiple keywords to be replaced by line breaks. +visible_keyword_tip=Single keyword is not allowed to enter invisible characters. single_keyword_tip=Only single key input is allowed. ipv4_mask_range_tip=IP mask must between 16 and 32 ipv6_mask_range_tip=IP Mask must between 2 and 128 diff --git a/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlList.jsp index 09801894e..fc6113365 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlList.jsp @@ -114,6 +114,23 @@ onClick="javascript:window.location='${ctx}/ntc/av/contUrlForm?functionId=${cfg.functionId}'"> + + + + + + + + + + + + + + + @@ -485,6 +502,8 @@ - + + +<%@include file="/WEB-INF/include/excel/importModal.jsp" %> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp index 844d3a491..34c2d3156 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp @@ -114,6 +114,23 @@ onClick="javascript:window.location='${ctx}/ntc/av/voipForm?functionId=${cfg.functionId}'"> + + + + + + + + + + + + + + + @@ -484,6 +501,8 @@ - + + +<%@include file="/WEB-INF/include/excel/importModal.jsp" %> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pList.jsp b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pList.jsp index 84dfbe02f..dbb3fea6d 100644 --- a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pList.jsp @@ -91,6 +91,23 @@ onClick="javascript:window.location='${ctx}/ntc/fileTransfer/p2pForm?functionId=${cfg.functionId}'"> + + + + + + + + + + + + + + + @@ -457,6 +474,8 @@ - + + +<%@include file="/WEB-INF/include/excel/importModal.jsp" %> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/other/bgpList.jsp b/src/main/webapp/WEB-INF/views/cfg/other/bgpList.jsp index f4c5a5a61..55d1bb995 100644 --- a/src/main/webapp/WEB-INF/views/cfg/other/bgpList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/other/bgpList.jsp @@ -93,6 +93,23 @@ onClick="javascript:window.location='${ctx}/ntc/other/bgpForm?functionId=${cfg.functionId}'"> + + + + + + + + + + + + + + + @@ -464,6 +481,8 @@ - + + +<%@include file="/WEB-INF/include/excel/importModal.jsp" %> \ No newline at end of file