From b201c7a520b3b802c8fdc6b960b34c6d0650b668 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Thu, 18 Oct 2018 10:11:38 +0800 Subject: [PATCH 01/11] =?UTF-8?q?ddos=20=E6=96=B0=E5=A2=9Eddos=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE=E8=B7=9F=E6=B5=81=E9=87=8F=E9=98=88=E5=80=BC=E7=9A=84?= =?UTF-8?q?=E4=B8=8B=E5=8F=91=EF=BC=8C=E6=97=A5=E5=BF=97=E6=B5=81=E9=87=8F?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E9=BB=98=E8=AE=A4=E4=BF=9D=E6=8A=A4dddos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/nis/domain/callback/InlineIp.java | 10 +++++ .../nis/domain/configuration/DdosIpCfg.java | 22 +++++++++++ .../controller/log/ntc/DdosLogController.java | 3 ++ .../nis/web/dao/configuration/DdosCfgDao.xml | 18 +++++++-- .../WEB-INF/include/form/dDosIpInfo.jsp | 37 +++++++++++++++++++ .../WEB-INF/views/cfg/ddosIpCfgForm.jsp | 4 ++ .../WEB-INF/views/cfg/ddosIpCfgList.jsp | 6 +++ 7 files changed, 97 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/nis/domain/callback/InlineIp.java b/src/main/java/com/nis/domain/callback/InlineIp.java index 21f25c819..ebd45ef2b 100644 --- a/src/main/java/com/nis/domain/callback/InlineIp.java +++ b/src/main/java/com/nis/domain/callback/InlineIp.java @@ -56,6 +56,16 @@ public class InlineIp { private Date opTime; @Expose private Integer policyGroup; + @Expose + private String userRegion;//用于存储协议跟流量阀值 + + + public String getUserRegion() { + return userRegion; + } + public void setUserRegion(String userRegion) { + this.userRegion = userRegion; + } /** * action * @return action diff --git a/src/main/java/com/nis/domain/configuration/DdosIpCfg.java b/src/main/java/com/nis/domain/configuration/DdosIpCfg.java index 020f4b500..5dfd52082 100644 --- a/src/main/java/com/nis/domain/configuration/DdosIpCfg.java +++ b/src/main/java/com/nis/domain/configuration/DdosIpCfg.java @@ -22,6 +22,28 @@ public class DdosIpCfg extends BaseIpCfg { */ private static final long serialVersionUID = -5446903784736960824L; + private String antiddosProtocol;//目前支持TCP_SYN, DNS, NTP, + private Long bpsThreadshold;// 即DDoS攻击保护动作触发阈值,每秒Bit数和每秒包数 + private Long ppsThreadshold; + + public String getAntiddosProtocol() { + return antiddosProtocol; + } + public void setAntiddosProtocol(String antiddosProtocol) { + this.antiddosProtocol = antiddosProtocol; + } + public Long getBpsThreadshold() { + return bpsThreadshold; + } + public void setBpsThreadshold(Long bpsThreadshold) { + this.bpsThreadshold = bpsThreadshold; + } + public Long getPpsThreadshold() { + return ppsThreadshold; + } + public void setPpsThreadshold(Long ppsThreadshold) { + this.ppsThreadshold = ppsThreadshold; + } } diff --git a/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java b/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java index 987de3a8c..dc1c0f569 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java @@ -59,6 +59,9 @@ public class DdosLogController extends BaseController{ params.put("pageNo", page.getPageNo()); if(entry!=null&&entry.getIsBlock()!=null) { params.put("searchIsBlock", entry.getIsBlock()); + }else { + entry.setIsBlock(1);//默认保护ddos日志 + params.put("searchIsBlock", entry.getIsBlock()); } //查询值判断 initLogSearchValue(entry,params); diff --git a/src/main/java/com/nis/web/dao/configuration/DdosCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/DdosCfgDao.xml index be87cebb6..ccaa2dc56 100644 --- a/src/main/java/com/nis/web/dao/configuration/DdosCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/DdosCfgDao.xml @@ -34,6 +34,9 @@ + + + @@ -42,7 +45,7 @@ ,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id ,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id, r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable - ,r.area_effective_ids,r.function_id,r.cfg_region_code + ,r.area_effective_ids,r.function_id,r.cfg_region_code,r.antiddos_protocol,r.bps_threadshold,r.pps_threadshold + + + + + + +
+ + +
+
+ +
+ +
+
+
+
+ +
+
+
+ +
+ +
+
+
+
+
diff --git a/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp index b3165bca4..92f8354f4 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp @@ -20,6 +20,10 @@ $(function(){ $(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error); }, submitHandler: function(form){ + if(($("#antiddosProtocol").val()!="")&&(!($("#bpsThreadshold").val().trim()>0)&&!($("#ppsThreadshold").val().trim()>0))){ + top.$.jBox.tip("", ""); + return; + } loading('onloading...'); form.submit(); }, diff --git a/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgList.jsp index d7e5a7c38..61e8d98bf 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgList.jsp @@ -307,6 +307,9 @@ + + + @@ -373,6 +376,9 @@ + ${cfg.antiddosProtocol } + ${cfg.bpsThreadshold } + ${cfg.ppsThreadshold } ${cfg.requestName } From 849ba480debdf308b676c9888f907c522a7c0859 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Thu, 18 Oct 2018 10:14:15 +0800 Subject: [PATCH 02/11] =?UTF-8?q?ddos=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/service/configuration/DdosCfgService.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/nis/web/service/configuration/DdosCfgService.java b/src/main/java/com/nis/web/service/configuration/DdosCfgService.java index 0a6bfe591..9f528efa4 100644 --- a/src/main/java/com/nis/web/service/configuration/DdosCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/DdosCfgService.java @@ -3,12 +3,15 @@ package com.nis.web.service.configuration; import java.util.ArrayList; import java.util.Date; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import com.google.gson.Gson; import com.nis.domain.Page; import com.nis.domain.callback.InlineIp; import com.nis.domain.configuration.DdosIpCfg; @@ -123,11 +126,19 @@ public class DdosCfgService extends BaseService{ ddosCfgDao.update(entity); entity=ddosCfgDao.getDdosIpCfg(Long.valueOf(id)); + String antiddosProtocol = entity.getAntiddosProtocol(); + Long bpsThreadshold = entity.getBpsThreadshold(); + Long ppsThreadshold = entity.getPpsThreadshold(); + Map map= new HashMap(); + map.put("protocol", antiddosProtocol); + map.put("bps_threadshold", bpsThreadshold); + map.put("pps_threadshold", ppsThreadshold); String json=""; if(entity.getIsAudit()==1){ List ipList=new ArrayList(); InlineIp resStrategy=convertCallBackIp(entity,null); + resStrategy.setUserRegion(new Gson().toJson(map)); ipList.add(resStrategy); //调用服务接口下发配置数据 json=gsonToJson(ipList); @@ -145,6 +156,7 @@ public class DdosCfgService extends BaseService{ }else if(entity.getIsAudit()==3){ List resStrategyList=new ArrayList<>(); InlineIp resStrategy=convertCallBackIp(entity,entity.getDnsStrategyId()); + resStrategy.setUserRegion(new Gson().toJson(map)); resStrategyList.add(resStrategy); //调用服务接口取消配置 json=gsonToJson(resStrategyList); From a277a4b29d85379381417a3e1de58e65252584c8 Mon Sep 17 00:00:00 2001 From: wangxin Date: Thu, 18 Oct 2018 10:18:03 +0800 Subject: [PATCH 03/11] =?UTF-8?q?(1)=E4=BF=AE=E6=AD=A3=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6IP=E9=BB=98=E8=AE=A4=E5=80=BC=20(2)Packet,Whi?= =?UTF-8?q?telist=20IP=E7=9A=84update=E6=96=B9=E6=B3=95=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E9=83=A8=E5=88=86if=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nis/web/dao/configuration/IpCfgDao.xml | 60 +++++-------------- src/main/resources/nis.properties | 5 +- 2 files changed, 19 insertions(+), 46 deletions(-) diff --git a/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml index 6e4d05aa8..4f150623e 100644 --- a/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml @@ -909,61 +909,33 @@ update cfg_index_info - cfg_desc = #{cfgDesc,jdbcType=VARCHAR}, - - action = #{action,jdbcType=INTEGER}, - - do_log = #{doLog,jdbcType=INTEGER}, - - is_valid = #{isValid,jdbcType=INTEGER}, - - is_audit = #{isAudit,jdbcType=INTEGER}, - creator_id = #{creatorId,jdbcType=INTEGER}, create_time = #{createTime,jdbcType=TIMESTAMP}, - - editor_id = #{editorId,jdbcType=INTEGER}, - - edit_time = #{editTime,jdbcType=TIMESTAMP}, - - service_id = #{serviceId,jdbcType=INTEGER}, - - - request_id = #{requestId,jdbcType=INTEGER}, - - - is_area_effective = #{isAreaEffective,jdbcType=INTEGER}, - - - classify = #{classify,jdbcType=VARCHAR}, - - - attribute = #{attribute,jdbcType=VARCHAR}, - - - lable = #{lable,jdbcType=VARCHAR}, - - - area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR}, - - - function_id = #{functionId,jdbcType=INTEGER}, - - user_region1 = #{userRegion1,jdbcType=VARCHAR}, - user_region2 = #{userRegion2,jdbcType=VARCHAR}, - user_region3 = #{userRegion3,jdbcType=VARCHAR}, - user_region4 = #{userRegion4,jdbcType=VARCHAR}, - user_region5 = #{userRegion5,jdbcType=VARCHAR}, - dns_strategy_id = #{dnsStrategyId,jdbcType=INTEGER}, + editor_id = #{editorId,jdbcType=INTEGER}, + edit_time = #{editTime,jdbcType=TIMESTAMP}, + service_id = #{serviceId,jdbcType=INTEGER}, + request_id = #{requestId,jdbcType=INTEGER}, + is_area_effective = #{isAreaEffective,jdbcType=INTEGER}, + classify = #{classify,jdbcType=VARCHAR}, + attribute = #{attribute,jdbcType=VARCHAR}, + lable = #{lable,jdbcType=VARCHAR}, + area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR}, + function_id = #{functionId,jdbcType=INTEGER}, + user_region1 = #{userRegion1,jdbcType=VARCHAR}, + user_region2 = #{userRegion2,jdbcType=VARCHAR}, + user_region3 = #{userRegion3,jdbcType=VARCHAR}, + user_region4 = #{userRegion4,jdbcType=VARCHAR}, + user_region5 = #{userRegion5,jdbcType=VARCHAR}, + dns_strategy_id = #{dnsStrategyId,jdbcType=INTEGER}, where cfg_id = #{cfgId,jdbcType=BIGINT} diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index 35b683ea0..c5e22f073 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -501,8 +501,9 @@ droprate=Droprate bandwidth=Bandwidth intercept_domain_intensity=DOMAIN_INTENSITY #IP\u9ed8\u8ba4\u503c -ipv4_default_ip_value=\:\: -ipv4_default_ip_subnet_value=0.0.0.0/32 +ipv4_default_ip_value=0.0.0.0 +ipv6_default_ip_value=\:\: +ipv4_default_ip_subnet_value=0.0.0.0/16 ipv6_default_ip_subnet_value=::/128 ipv4_default_ip_range_value=0.0.0.0-0.0.0.0 ipv6_default_ip_range_value=::-:: From 02f121e53aabfc0026e0603b2285ca2ac1f3a7e1 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Thu, 18 Oct 2018 10:28:26 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E5=AD=97=E9=99=90=E5=88=B6=E9=95=BF=E5=BA=A61024?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/static/global/scripts/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index 28969d073..0a1814252 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -1,7 +1,7 @@ $(function(){ //增加描述新增时的文字长度限制 $("form input[name='cfgDesc']").attr("maxlength","128"); - $("form input[name$='cfgKeywords']").attr("maxlength","2048"); + $("form input[name$='cfgKeywords']").attr("maxlength","1024"); //截取过长的文字 使用id选择器;例如:tab对象->tr->td对象. 排除日志table .logTb $("#contentTable").not(".logTb").find("td").each(function(i){ //获取td当前对象的文本,如果长度大于25; From e9f7e1370fb60b19bf24794f8fb882ba0a4f3bb5 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Thu, 18 Oct 2018 10:34:01 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/messages/message_en.properties | 2 +- src/main/resources/messages/message_ru.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 12c085b74..6f774935d 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1252,7 +1252,7 @@ select_certificate=Please Select Certificate Type First root_certificate=der cer crt pem intermediate_entity_certificate=p12 private_certificate=pem key p12 -antiddos_protocol=DDOS协议 +antiddos_protocol=DDOS Protocol bps_threadshold=Traffic Threshold Bit/S pps_threadshold=Traffic Threshold Pkt/S one_more_greater_zero=At Least One Threshold Is Not 0. \ 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 43314fed4..5d81c8f34 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1272,7 +1272,7 @@ select_certificate=Please Select Certificate Type First root_certificate=der cer crt pem intermediate_entity_certificate=p12 private_certificate=pem key p12 -antiddos_protocol=DDOS\u534f\u8bae +antiddos_protocol=DDOS Protocol bps_threadshold=Traffic Threshold Bit/S pps_threadshold=Traffic Threshold Pkt/S one_more_greater_zero=At Least One Threshold Is Not 0. \ No newline at end of file From bfaa681811dd1e2f69cdd75177898c70b6f521dc Mon Sep 17 00:00:00 2001 From: wangxin Date: Thu, 18 Oct 2018 10:45:18 +0800 Subject: [PATCH 06/11] =?UTF-8?q?(1)=E7=AB=AF=E5=8F=A3=E6=8E=A9=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E4=B8=AD=E7=9A=84=E7=AB=AF=E5=8F=A3=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=8D=8F=E8=AE=AE=E9=9D=9ETCP,UDP=E6=98=AF=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E9=9D=9E0=E6=A0=A1=E9=AA=8C=20(2)IP=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E8=B5=B7=E5=A7=8BIP=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E7=9B=B8=E5=90=8C=E7=9A=84=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1.11.0/jquery.validate.method.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js index 4ba9e7039..e901cd654 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js @@ -237,6 +237,13 @@ jQuery.validator.addMethod("protocolPort",function(value, element) { var protocolElement=$("[name='"+name.replace("destPort","protocol")+"']"); protocolVal=protocolElement.val(); } + //端口/掩码格式 + if(srcPortVal&&srcPortVal.indexOf("/")>-1){ + srcPortVal=srcPortVal.split("/")[0]; + } + if(destPortVal&&destPortVal.indexOf("/")>-1){ + destPortVal=destPortVal.split("/")[0]; + } if(protocolVal==0){ return true; }else if((protocolVal!=tcp&&protocolVal!=udp&&srcPortVal>0)||(protocolVal!=tcp&&protocolVal!=udp&&destPortVal>0)){ @@ -276,13 +283,13 @@ jQuery.validator.addMethod("ipCheck",function(value, element) { var srcIpIsHidden=srcIpAddressE.is(":hidden"); var destIpIsHidden=destIpAddressE.is(":hidden"); var IPv4RangeDefault="0.0.0.0-0.0.0.0"; - /*if(ipPattern==1){//ip/掩码格式 + if(ipPattern==1){//ip/掩码格式 srcIpAddress=srcIpAddress.indexOf("/") >-1 ?srcIpAddress.split("/")[0] : srcIpAddress; destIpAddress=destIpAddress.indexOf("/") >-1 ?destIpAddress.split("/")[0] : destIpAddress; }else if (ipPattern==2){ srcIpAddress=srcIpAddress.indexOf("-") >-1 ?srcIpAddress.split("-")[0] : srcIpAddress; destIpAddress=destIpAddress.indexOf("-") >-1 ?destIpAddress.split("-")[0] : destIpAddress; - }*/ + } if(srcIpIsHidden){ if((srcIpAddress == destIpAddress)){ $.validator.messages.ipCheck=$.validator.messages.destIpIsNotValue+destIpAddress; From 8c96e21a27fbdf0a83cb56543493a191a02f949a Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Thu, 18 Oct 2018 11:10:10 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9B=BE=E5=BD=A2=E6=98=BE=E7=A4=BA=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/messages/message_en.properties | 2 +- src/main/resources/messages/message_ru.properties | 2 +- .../resources/messages/message_zh_CN.properties | 2 +- .../WEB-INF/views/dashboard/dashBoardIndex.jsp | 14 +++++++------- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 6f774935d..136fe5f85 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1166,7 +1166,7 @@ ASN_POLICY_MONIT=ASN Policy Monitor p2p_monit=P2P Monitor av_content_url_whitelist=Multimedia Content Url White List av_content_ip_whitelist=Multimedia Content IP White List -active_port=Active Port +active_port=Traffic Port visits=Visits percentage=Percentage APP_SSL=APP SSL Feature diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 5d81c8f34..882570846 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1168,7 +1168,7 @@ ASN_POLICY_MONIT=ASN Policy Monitor p2p_monit=P2P Monitor av_content_url_whitelist=Multimedia Content Url White List av_content_ip_whitelist=Multimedia Content IP White List -active_port=\u0410\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u041f\u043e\u0440\u0442 \u0422\u041e\u041f 10 +active_port=Traffic Port visits=\u041f\u043e\u0441\u0435\u0449\u0430\u0435\u043c\u043e\u0441\u0442\u044c percentage=\u041f\u0440\u043e\u0446\u0435\u043d\u0442 APP_SSL=APP SSL Feature diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index 9beae9bf6..3809c82a9 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1162,7 +1162,7 @@ ASN_POLICY_MONIT=ASN\u7B56\u7565\u76D1\u6D4B p2p_monit=P2P\u76D1\u6D4B av_content_url_whitelist=\u591A\u5A92\u4F53\u5185\u5BB9URL\u914D\u7F6E\u767D\u540D\u5355 av_content_ip_whitelist=\u591A\u5A92\u4F53\u5185\u5BB9IP\u914D\u7F6E\u767D\u540D\u5355 -active_port=\u6D3B\u8DC3\u7AEF\u53E3 +active_port=\u7AEF\u53E3\u6D41\u91CF visits=\u8BBF\u95EE\u6B21\u6570 percentage=\u767E\u5206\u6BD4 APP_SSL=APP SSL\u7279\u5F81 diff --git a/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp b/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp index 6fb0fbf28..b868e99e9 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp @@ -197,7 +197,7 @@   
-
+
@@ -637,7 +637,7 @@ function systemList(){ $("#tbodyData1").prepend("No Data"); } //终端图-操作系统 - echart_2(rs); + echart_2(rs.reverse()); } }, }); @@ -655,7 +655,7 @@ function osClick(osType,obj){ dataType:"json", cache:false,async:true, success:function (rs) { - echart_5(rs); + echart_5(rs.reverse()); }, }); } @@ -670,7 +670,7 @@ function bsClick(bsType,obj){ dataType:"json", cache:false,async:true, success:function (rs) { - echart_2(rs); + echart_2(rs.reverse()); }, }); } @@ -728,7 +728,7 @@ function browserList() { $("#tbodyData1").prepend("No Data"); } //终端图-浏览器 - echart_5(rs); + echart_5(rs.reverse()); } }, }); @@ -782,7 +782,7 @@ function websiteList() { $("#tbodyData2").prepend("No Data"); } //网站统计图 - echart_4(rs); + echart_4(rs.reverse()); } }, }); @@ -800,7 +800,7 @@ function webClick(websiteServiceId,obj){ dataType:"json", cache:false,async:true, success:function (rs) { - echart_6(rs); + echart_6(rs.reverse()); }, }); } From 5cb07b724c573e54881b583cfc8548962147e5b3 Mon Sep 17 00:00:00 2001 From: leijun Date: Thu, 18 Oct 2018 11:15:25 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=81=AB=E7=8B=90?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8=E6=96=87=E4=BB=B6=E5=90=8D=E7=A9=BA?= =?UTF-8?q?=E6=A0=BC=E5=87=BA=E7=8E=B0+=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nis/util/excel/ExportExcel.java | 2 +- src/main/java/com/nis/web/controller/BaseController.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/nis/util/excel/ExportExcel.java b/src/main/java/com/nis/util/excel/ExportExcel.java index 2664857b7..29e0da42b 100644 --- a/src/main/java/com/nis/util/excel/ExportExcel.java +++ b/src/main/java/com/nis/util/excel/ExportExcel.java @@ -1395,7 +1395,7 @@ public class ExportExcel { public ExportExcel write(HttpServletResponse response, String fileName) throws IOException{ response.reset(); response.setContentType("application/octet-stream; charset=utf-8"); - response.setHeader("Content-Disposition", "attachment; filename="+Encodes.urlEncode(fileName)); + response.setHeader("Content-Disposition", "attachment; filename=\""+fileName+"\""); write(response.getOutputStream()); return this; } diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 4488fffc0..1fa03ffed 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -2,6 +2,7 @@ package com.nis.web.controller; import java.beans.PropertyEditorSupport; import java.io.IOException; import java.lang.reflect.Field; +import java.net.URLEncoder; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -2237,6 +2238,11 @@ public class BaseController { map.put("labels", labels); String fileName = msgProp.getProperty(functionName, functionName)+"_"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx"; + if(request.getHeader("User-Agent").toUpperCase().indexOf("MSIE")>0){ + fileName = URLEncoder.encode(fileName, "UTF-8"); + }else{ + fileName = new String(fileName.getBytes("UTF-8"),"ISO8859-1"); + } new ExportExcel(msgProp,titleList,noExportMap,classMap,1).setDataList(msgProp,dataMap,map).write(response, fileName).dispose(); } } From ccbc1d5eff646c6c46470acd531a090bdefaa643 Mon Sep 17 00:00:00 2001 From: leijun Date: Thu, 18 Oct 2018 11:24:12 +0800 Subject: [PATCH 09/11] =?UTF-8?q?ftp=E3=80=81dns=E3=80=81mail=E3=80=81http?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ntc/FileTransferCfgController.java | 87 +++++++++++++++++ .../configuration/ntc/MailCfgController.java | 97 +++++++++++++++++++ .../configuration/ntc/WebsiteController.java | 78 +++++++++++++++ .../ntc/WhiteListController.java | 59 ++++++++++- .../service/configuration/DomainService.java | 8 ++ .../configuration/FileTransferCfgService.java | 17 ++++ .../service/configuration/MailCfgService.java | 17 ++++ .../configuration/WebsiteCfgService.java | 14 +++ .../views/cfg/fileTransfer/ftpList.jsp | 1 + .../WEB-INF/views/cfg/mail/mailList.jsp | 1 + .../WEB-INF/views/cfg/website/dnsList.jsp | 1 + .../WEB-INF/views/cfg/website/httpList.jsp | 4 +- .../views/cfg/whitelist/domainList.jsp | 1 + .../WEB-INF/views/cfg/whitelist/ipList.jsp | 1 + 14 files changed, 382 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java b/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java index ee268ea92..8bea6b713 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java @@ -456,4 +456,91 @@ public class FileTransferCfgController extends BaseController{ } return "redirect:" + adminPath +"/ntc/fileTransfer/p2pList?functionId="+functionId; } + + //ftp配置导出 + @RequestMapping(value = "exportftp") + public void exportdns(Model model,HttpServletRequest request,HttpServletResponse response, + @ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){ + try { + //export data info + List titleList=new ArrayList(); + Map> classMap=new HashMap>(); + Map dataMap=new HashMap(); + Map noExportMap=new HashMap(); + + + /*//导出选中记录 + * if(!StringUtil.isEmpty(ids)){ + for(String id:ids.split(",")){ + Long.parseLong(id); + } + //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); + }else{*/ + //条件导出数据大于最大导出数,只导出最大导出条数 + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"a"); + if(pageInfo.getCount()>Constants.MAX_EXPORT_SIZE){ + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + }else{ + pageInfo.setPageNo(1); + pageInfo.setPageSize(-1); + } + Page page = fileTransferCfgService.getFtpList(pageInfo, entity); + titleList.add(entity.getMenuNameCode()); + titleList.add("NTC_IP"); + titleList.add("NTC_FTP_URL"); + titleList.add("NTC_FTP_CONTENT"); + titleList.add("NTC_SUBSCRIBE_ID"); + classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); + classMap.put("NTC_IP", IpPortCfg.class); + classMap.put("NTC_FTP_URL", BaseStringCfg.class); + classMap.put("NTC_FTP_CONTENT", BaseStringCfg.class); + classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); + + String cfgIndexInfoNoExport=",group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator" + + ",config_time,editor,edit_time,auditor,audit_time" + +",letter,whether_area_block,classification,attribute,label" + +",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,"; + String ntcSubscribeIdCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator" + + ",config_time,editor,edit_time,auditor,audit_time" + +",letter,whether_area_block,classification,attribute,label" + +",userregion1,userregion2,userregion3,userregion4,userregion5,"; + String regionCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator" + + ",config_time,editor,edit_time,auditor,audit_time" + +",letter,whether_area_block,classification,attribute,label" + +",userregion1,userregion2,userregion3,userregion4,userregion5,"; + + noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); + noExportMap.put("NTC_IP", ipPortInfoNoExport); + noExportMap.put("NTC_FTP_URL", regionCfgNoExport); + noExportMap.put("NTC_FTP_CONTENT", regionCfgNoExport); + noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); + List ipList=new ArrayList(); + List subscribeInfoList=new ArrayList(); + List ftpkeyList=new ArrayList(); + List ftpurlList=new ArrayList(); + for (CfgIndexInfo cfg : page.getList()) { + Map maps=fileTransferCfgService.exportftp(cfg); + ftpkeyList.addAll(maps.get("NTC_FTP_CONTENT")); + ftpurlList.addAll(maps.get("NTC_FTP_URL")); + ipList.addAll(maps.get("NTC_UNIVERSAL_IP")); + subscribeInfoList.addAll(maps.get("NTC_SUBSCRIBE_ID")); + } + + dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put("NTC_IP", ipList); + dataMap.put("NTC_FTP_URL", ftpurlList); + dataMap.put("NTC_FTP_CONTENT", ftpkeyList); + dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); + /*}*/ + this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); + } catch (Exception e) { + logger.error("ftp export failed",e); + addMessage(redirectAttributes, "export_failed"); + } + //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + } diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java b/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java index bffad6486..a76e9466d 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java @@ -32,6 +32,7 @@ import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.domain.maat.ToMaatResult; import com.nis.exceptions.MaatConvertException; import com.nis.util.ConfigServiceUtil; +import com.nis.util.Constants; import com.nis.util.FileUtils; import com.nis.util.JsonMapper; import com.nis.web.controller.BaseController; @@ -174,4 +175,100 @@ public class MailCfgController extends BaseController{ } return "redirect:" + adminPath +"/ntc/mail/mailList?functionId="+functionId; } + + //mail配置导出 + @RequestMapping(value = "exportmail") + public void exportdns(Model model,HttpServletRequest request,HttpServletResponse response, + @ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){ + try { + //export data info + List titleList=new ArrayList(); + Map> classMap=new HashMap>(); + Map dataMap=new HashMap(); + Map noExportMap=new HashMap(); + + + /*//导出选中记录 + * if(!StringUtil.isEmpty(ids)){ + for(String id:ids.split(",")){ + Long.parseLong(id); + } + //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); + }else{*/ + //条件导出数据大于最大导出数,只导出最大导出条数 + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"a"); + if(pageInfo.getCount()>Constants.MAX_EXPORT_SIZE){ + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + }else{ + pageInfo.setPageNo(1); + pageInfo.setPageSize(-1); + } + Page page = mailCfgService.getMailList(pageInfo, entity); + titleList.add(entity.getMenuNameCode()); + String cfgIndexInfoNoExport=",group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator" + + ",config_time,editor,edit_time,auditor,audit_time" + +",letter,whether_area_block,classification,attribute,label" + +",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,"; + String ntcSubscribeIdCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator" + + ",config_time,editor,edit_time,auditor,audit_time" + +",letter,whether_area_block,classification,attribute,label" + +",userregion1,userregion2,userregion3,userregion4,userregion5,"; + String regionCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator" + + ",config_time,editor,edit_time,auditor,audit_time" + +",letter,whether_area_block,classification,attribute,label" + +",userregion1,userregion2,userregion3,userregion4,userregion5,"; + if(entity.getFunctionId()!=null){ + if(entity.getFunctionId()!=37){ + titleList.add("NTC_IP"); + titleList.add("NTC_MAIL_BODY"); + + classMap.put("NTC_IP", IpPortCfg.class); + classMap.put("NTC_MAIL_BODY", ComplexkeywordCfg.class); + + noExportMap.put("NTC_IP", ipPortInfoNoExport); + noExportMap.put("NTC_MAIL_BODY", regionCfgNoExport); + + } + } + titleList.add("NTC_MAIL_HDR"); + titleList.add("NTC_SUBSCRIBE_ID"); + classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); + classMap.put("NTC_MAIL_HDR", ComplexkeywordCfg.class); + classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); + noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); + noExportMap.put("NTC_MAIL_HDR", regionCfgNoExport); + noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); + List ipList=new ArrayList(); + List subscribeInfoList=new ArrayList(); + List mailBodyList=new ArrayList(); + List mailReqHdrList=new ArrayList(); + for (CfgIndexInfo cfg : page.getList()) { + Map maps=mailCfgService.exportmail(cfg); + mailReqHdrList.addAll(maps.get("NTC_MAIL_HDR")); + mailBodyList.addAll(maps.get("NTC_MAIL_BODY")); + ipList.addAll(maps.get("NTC_UNIVERSAL_IP")); + subscribeInfoList.addAll(maps.get("NTC_SUBSCRIBE_ID")); + } + if(entity.getFunctionId()!=null){ + if(entity.getFunctionId()!=37){ + dataMap.put("NTC_IP", ipList); + dataMap.put("NTC_MAIL_BODY", mailBodyList); + + } + } + dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put("NTC_MAIL_HDR", mailReqHdrList); + dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); + /*}*/ + this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); + } catch (Exception e) { + logger.error("mail export failed",e); + addMessage(redirectAttributes, "export_failed"); + } + //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } + } 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 7640ba214..53335fe87 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 @@ -640,5 +640,83 @@ public class WebsiteController extends BaseController{ } return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+entity.getFunctionId(); } + + //dns配置导出 + @RequestMapping(value = "exportdns") + public void exportdns(Model model,HttpServletRequest request,HttpServletResponse response, + @ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){ + try { + //export data info + List titleList=new ArrayList(); + Map> classMap=new HashMap>(); + Map dataMap=new HashMap(); + Map noExportMap=new HashMap(); + + + /*//导出选中记录 + * if(!StringUtil.isEmpty(ids)){ + for(String id:ids.split(",")){ + Long.parseLong(id); + } + //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); + }else{*/ + //条件导出数据大于最大导出数,只导出最大导出条数 + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"a"); + if(pageInfo.getCount()>Constants.MAX_EXPORT_SIZE){ + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + }else{ + pageInfo.setPageNo(1); + pageInfo.setPageSize(-1); + } + Page page = websiteCfgService.getWebsiteList(pageInfo, entity); + titleList.add(entity.getMenuNameCode()); + titleList.add("NTC_IP"); + titleList.add("NTC_DNS_REGION"); + titleList.add("NTC_SUBSCRIBE_ID"); + classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); + classMap.put("NTC_IP", IpPortCfg.class); + classMap.put("NTC_DNS_REGION", ComplexkeywordCfg.class); + classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class); + String cfgIndexInfoNoExport=",group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator" + + ",config_time,editor,edit_time,auditor,audit_time" + +",letter,whether_area_block,classification,attribute,label" + +",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,"; + String ntcSubscribeIdCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator" + + ",config_time,editor,edit_time,auditor,audit_time" + +",letter,whether_area_block,classification,attribute,label" + +",userregion1,userregion2,userregion3,userregion4,userregion5,"; + String regionCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator" + + ",config_time,editor,edit_time,auditor,audit_time" + +",letter,whether_area_block,classification,attribute,label" + +",userregion1,userregion2,userregion3,userregion4,userregion5,"; + noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); + noExportMap.put("NTC_IP", ipPortInfoNoExport); + noExportMap.put("NTC_DNS_REGION", regionCfgNoExport); + noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport); + List ipList=new ArrayList(); + List subscribeInfoList=new ArrayList(); + List regionInfoList=new ArrayList(); + for (CfgIndexInfo cfg : page.getList()) { + CfgIndexInfo cfgIndexInfo=websiteCfgService.exportdns(cfg); + ipList.addAll(cfgIndexInfo.getIpPortList()); + subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList()); + regionInfoList.addAll(cfgIndexInfo.getDomainList()); + } + dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put("NTC_IP", ipList); + dataMap.put("NTC_DNS_REGION", regionInfoList); + dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); + + /*}*/ + this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); + } catch (Exception e) { + logger.error("dns export failed",e); + addMessage(redirectAttributes, "export_failed"); + } + //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } } diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java b/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java index 4ffaf753e..cb9aa6614 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java @@ -286,7 +286,7 @@ public class WhiteListController extends CommonController{ titleList.add("NTC_IP"); classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); classMap.put("NTC_IP", IpPortCfg.class); - String cfgIndexInfoNoExport=",group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + String cfgIndexInfoNoExport=",do_log,letter,whether_area_block,classification,attribute,label,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; String ipPortInfoNoExport=",protocol,direction,do_log,action,config_describe,valid_identifier,is_audit,creator,creator" + ",config_time,editor,edit_time,auditor,audit_time" +",letter,whether_area_block,classification,attribute,label" @@ -308,6 +308,61 @@ public class WhiteListController extends CommonController{ } //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); } - + //ip配置导出 + @RequestMapping(value = "exportdomain") + public void exportdomain(Model model,HttpServletRequest request,HttpServletResponse response, + @ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){ + try { + //export data info + List titleList=new ArrayList(); + Map> classMap=new HashMap>(); + Map dataMap=new HashMap(); + Map noExportMap=new HashMap(); + + + /*//导出选中记录 + * if(!StringUtil.isEmpty(ids)){ + for(String id:ids.split(",")){ + Long.parseLong(id); + } + //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); + }else{*/ + //条件导出数据大于最大导出数,只导出最大导出条数 + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"a"); + if(pageInfo.getCount()>Constants.MAX_EXPORT_SIZE){ + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + }else{ + pageInfo.setPageNo(1); + pageInfo.setPageSize(-1); + } + Page page = domainService.getDomainList(pageInfo, entity); + titleList.add(entity.getMenuNameCode()); + titleList.add("NTC_HTTP_URL"); + classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); + classMap.put("NTC_HTTP_URL", HttpUrlCfg.class); + String cfgIndexInfoNoExport=",do_log,letter,whether_area_block,classification,attribute,label,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + String httpUrlInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator" + + ",config_time,editor,edit_time,auditor,audit_time" + +",letter,whether_area_block,classification,attribute,label" + +",userregion1,userregion2,userregion3,userregion4,userregion5,"; + noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); + noExportMap.put("NTC_HTTP_URL", httpUrlInfoNoExport); + List httpurlList=new ArrayList(); + for (CfgIndexInfo cfg : page.getList()) { + CfgIndexInfo cfgIndexInfo=domainService.exportDomainInfo(cfg); + httpurlList.addAll(cfgIndexInfo.getHttpUrlList()); + } + dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put("NTC_HTTP_URL", httpurlList); + /*}*/ + this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); + } catch (Exception e) { + logger.error("ip white export failed",e); + addMessage(redirectAttributes, "export_failed"); + } + //return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId(); + } } diff --git a/src/main/java/com/nis/web/service/configuration/DomainService.java b/src/main/java/com/nis/web/service/configuration/DomainService.java index feef3efb5..33373654a 100644 --- a/src/main/java/com/nis/web/service/configuration/DomainService.java +++ b/src/main/java/com/nis/web/service/configuration/DomainService.java @@ -16,6 +16,7 @@ import com.nis.domain.configuration.AreaIpCfg; import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.HttpUrlCfg; +import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.domain.maat.MaatCfg; import com.nis.domain.maat.MaatCfg.DigestCfg; @@ -23,6 +24,7 @@ import com.nis.domain.maat.MaatCfg.GroupCfg; import com.nis.domain.maat.MaatCfg.IpCfg; import com.nis.domain.maat.MaatCfg.NumBoundaryCfg; import com.nis.domain.maat.MaatCfg.StringCfg; +import com.nis.domain.specific.ConfigGroupInfo; import com.nis.domain.maat.ToMaatBean; import com.nis.domain.maat.ToMaatResult; import com.nis.exceptions.MaatConvertException; @@ -666,4 +668,10 @@ public class DomainService extends CrudService { page.setList(list); return page; } + + public CfgIndexInfo exportDomainInfo(CfgIndexInfo entity){ + List httpUrlList = websiteCfgDao.getHttpUrlList(entity); + entity.setHttpUrlList(httpUrlList); + return entity; + } } diff --git a/src/main/java/com/nis/web/service/configuration/FileTransferCfgService.java b/src/main/java/com/nis/web/service/configuration/FileTransferCfgService.java index 6a193fb89..b6c639291 100644 --- a/src/main/java/com/nis/web/service/configuration/FileTransferCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/FileTransferCfgService.java @@ -86,6 +86,23 @@ public class FileTransferCfgService extends CrudService exportftp(CfgIndexInfo entity){ + Map dataMap=new HashMap(); + List ipPortList = fileTransferCfgDao.getIpPortList(entity); + entity.setCfgType("NTC_FTP_CONTENT"); + List keywordList = fileTransferCfgDao.getFtpKeywordList(entity); + entity.setCfgType("NTC_FTP_URL"); + List urlwordList = fileTransferCfgDao.getFtpKeywordList(entity); + List subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity); + dataMap.put("NTC_SUBSCRIBE_ID", subscribeIdList); + dataMap.put("NTC_FTP_CONTENT", keywordList); + dataMap.put("NTC_FTP_URL", urlwordList); + dataMap.put("NTC_UNIVERSAL_IP", ipPortList); + return dataMap; + } + + /** * 保存ftp配置 * @param entity diff --git a/src/main/java/com/nis/web/service/configuration/MailCfgService.java b/src/main/java/com/nis/web/service/configuration/MailCfgService.java index e2d350583..d0f4ef148 100644 --- a/src/main/java/com/nis/web/service/configuration/MailCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/MailCfgService.java @@ -20,6 +20,7 @@ import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.ComplexkeywordCfg; import com.nis.domain.configuration.FileDigestCfg; +import com.nis.domain.configuration.HttpBodyCfg; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.MailKeywordCfg; import com.nis.domain.configuration.NtcSubscribeIdCfg; @@ -79,6 +80,22 @@ public class MailCfgService extends CrudService { entity.setAreaCfg(areaCfg); return entity; } + + public Map exportmail(CfgIndexInfo entity){ + Map dataMap=new HashMap(); + List ipPortList = mailCfgDao.getIpPortList(entity); + entity.setCfgType("NTC_MAIL_HDR"); + List mailHdrList =mailCfgDao.getMailKeywordList(entity); + entity.setCfgType("NTC_MAIL_BODY"); + List mailBodyList = mailCfgDao.getMailKeywordList(entity); + List subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity); + dataMap.put("NTC_SUBSCRIBE_ID", subscribeIdList); + dataMap.put("NTC_MAIL_BODY", mailBodyList); + dataMap.put("NTC_MAIL_HDR", mailHdrList); + dataMap.put("NTC_UNIVERSAL_IP", ipPortList); + return dataMap; + } + /** * 保存mail配置 * @param entity diff --git a/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java b/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java index 4e58c35bb..4739fc293 100644 --- a/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java @@ -33,6 +33,7 @@ import com.nis.domain.maat.MaatCfg.DigestCfg; import com.nis.domain.maat.MaatCfg.GroupCfg; import com.nis.domain.maat.MaatCfg.IpCfg; import com.nis.domain.maat.MaatCfg.StringCfg; +import com.nis.domain.specific.ConfigGroupInfo; import com.nis.exceptions.MaatConvertException; import com.nis.util.ConfigServiceUtil; import com.nis.util.Constants; @@ -99,6 +100,19 @@ public class WebsiteCfgService extends CrudService { return dataMap; } + + + public CfgIndexInfo exportdns(CfgIndexInfo entity){ + List ipPortList = websiteCfgDao.getIpPortList(entity); + List domainList = websiteCfgDao.getDnsDomainList(entity); + List subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity); + entity.setIpPortList(ipPortList); + entity.setDomainList(domainList); + entity.setNtcSubscribeIdCfgList(subscribeIdList); + return entity; + } + + public CfgIndexInfo getSslCfg(Long cfgId){ CfgIndexInfo entity = websiteCfgDao.getCfgIndexInfo(cfgId); List ipPortList = websiteCfgDao.getIpPortList(entity); diff --git a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpList.jsp b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpList.jsp index c1f0bebfe..14e5c3baf 100644 --- a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/ftpList.jsp @@ -172,6 +172,7 @@ +
diff --git a/src/main/webapp/WEB-INF/views/cfg/mail/mailList.jsp b/src/main/webapp/WEB-INF/views/cfg/mail/mailList.jsp index 15db80da6..22f30c464 100644 --- a/src/main/webapp/WEB-INF/views/cfg/mail/mailList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/mail/mailList.jsp @@ -169,6 +169,7 @@ +
diff --git a/src/main/webapp/WEB-INF/views/cfg/website/dnsList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/dnsList.jsp index d4de293de..728ab4e17 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/dnsList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/dnsList.jsp @@ -168,6 +168,7 @@ +
diff --git a/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp index 2b379aead..3197fce98 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp @@ -324,9 +324,9 @@
- + - <%-- --%> +
diff --git a/src/main/webapp/WEB-INF/views/cfg/whitelist/domainList.jsp b/src/main/webapp/WEB-INF/views/cfg/whitelist/domainList.jsp index d5dab3e75..5d21fb660 100644 --- a/src/main/webapp/WEB-INF/views/cfg/whitelist/domainList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/whitelist/domainList.jsp @@ -168,6 +168,7 @@ +
diff --git a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipList.jsp b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipList.jsp index ce5c52e09..b4f59f3a6 100644 --- a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipList.jsp @@ -167,6 +167,7 @@ +
From 7c3f452d2b1d4d3cbf47f4a27504b132c5037133 Mon Sep 17 00:00:00 2001 From: leijun Date: Thu, 18 Oct 2018 11:49:12 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=A3=80=E7=B4=A2?= =?UTF-8?q?=E6=A1=86=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp | 2 +- src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp | 2 +- src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/list.jsp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp index f228c308b..16bf91534 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp @@ -160,7 +160,7 @@
- +
diff --git a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp index 48781c7f3..258c106df 100644 --- a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp @@ -164,7 +164,7 @@
- +
diff --git a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/list.jsp b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/list.jsp index 40cb5214a..557ab6e57 100644 --- a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/list.jsp @@ -161,7 +161,7 @@
- +
From 17be1fc436c3ab6c9c18fe10c2bfcd422df89960 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Thu, 18 Oct 2018 13:48:35 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=EF=BC=8Cfunction=5Fregion,function=5Fservice?= =?UTF-8?q?=20,sql=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20181018/add_function_region_mail_address.sql | 9 +++++++++ .../add_function_service_mail_addresss.sql | 12 ++++++++++++ .../resources/sql/20181018/update_sys_menu.sql | 14 ++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 src/main/resources/sql/20181018/add_function_region_mail_address.sql create mode 100644 src/main/resources/sql/20181018/add_function_service_mail_addresss.sql create mode 100644 src/main/resources/sql/20181018/update_sys_menu.sql diff --git a/src/main/resources/sql/20181018/add_function_region_mail_address.sql b/src/main/resources/sql/20181018/add_function_region_mail_address.sql new file mode 100644 index 000000000..2fc09e7ce --- /dev/null +++ b/src/main/resources/sql/20181018/add_function_region_mail_address.sql @@ -0,0 +1,9 @@ +#增加邮件地址头域,subscribe_id +INSERT INTO function_region_dict + (`config_service_type`, `config_multi_keywords`, `config_expr_type`, `config_hex`, `config_match_method`, `dict_id`, `function_id`, `config_region_code`, `config_region_value`, `config_district`, `config_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `is_maat`, `region_type`, `config_ip_type`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`) +VALUES + ('', '1', '0,1', '0,1,2', '0,1,2,3', 599, 37, 1, 'NTC_MAIL_HDR', 'From,To', '邮件地址头域配置', 1, NULL, NULL, NULL, NULL, 1, 3, '', '', '', '', '', '', 1); +INSERT INTO function_region_dict + (`config_service_type`, `config_multi_keywords`, `config_expr_type`, `config_hex`, `config_match_method`, `dict_id`, `function_id`, `config_region_code`, `config_region_value`, `config_district`, `config_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `is_maat`, `region_type`, `config_ip_type`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`) +VALUES + ('', '', '', '', '', 600, 37, 2, 'NTC_SUBSCRIBE_ID', '', '邮件地址subscribeId配置', 1, NULL, NULL, NULL, NULL, 1, 2, '', '', '', '', '', '', 2); diff --git a/src/main/resources/sql/20181018/add_function_service_mail_addresss.sql b/src/main/resources/sql/20181018/add_function_service_mail_addresss.sql new file mode 100644 index 000000000..a9dbbd40f --- /dev/null +++ b/src/main/resources/sql/20181018/add_function_service_mail_addresss.sql @@ -0,0 +1,12 @@ +INSERT INTO function_service_dict + (`function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`) +VALUES + ('37', '5', '128', 'whitelist', '8888', 'mail_address_whitelist', NULL, '0', NULL, NULL, NULL, NULL, '1,2'); +INSERT INTO function_service_dict + (`function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`) +VALUES + ('37', '5', '1', 'monit', '132', 'mail_address_monit', NULL, '1', NULL, NULL, NULL, NULL, '1,2'); +INSERT INTO function_service_dict + (`function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`) +VALUES + ('37', '5', '16', 'reject', '20', 'mail_address_reject', NULL, '1', NULL, NULL, NULL, NULL, '1,2'); diff --git a/src/main/resources/sql/20181018/update_sys_menu.sql b/src/main/resources/sql/20181018/update_sys_menu.sql new file mode 100644 index 000000000..92060098a --- /dev/null +++ b/src/main/resources/sql/20181018/update_sys_menu.sql @@ -0,0 +1,14 @@ +#增加邮件主菜单 +INSERT INTO `sys_menu` VALUES ('1144', '931', '0,1,86,931,', 'mail', '邮件', '5', '', '', '', '1', '', '1', '2018-09-10 14:31:09', '1', '2018-09-10 14:31:09', '', '1', null, '0', '0', ''); +INSERT INTO `sys_menu` VALUES ('1145', '934', '0,1,150,934,', 'mail', '邮件', '5', '', '', '', '1', '', '1', '2018-09-10 14:31:09', '1', '2018-09-10 14:31:09', '', '1', null, '0', '0', ''); +INSERT INTO `sys_menu` VALUES ('1146', '937', '0,1,151,937,', 'mail', '邮件', '5', '', '', '', '1', '', '1', '2018-09-10 14:31:09', '1', '2018-09-10 14:31:09', '', '1', null, '0', '0', ''); +#增加邮件地址菜单 +INSERT INTO `sys_menu` VALUES ('1140', '1144', '0,1,86,931,1144,', 'mail_address', '邮件地址配置', '10', '/ntc/mail/mailList', '', '', '1', 'mail:config', '1', '2018-09-10 14:31:09', '1', '2018-09-10 14:31:09', '', '1', null, '0', '0', '37'); +INSERT INTO `sys_menu` VALUES ('1141', '1145', '0,1,150,934,1145,', 'mail_address', '邮件地址审核', '10', '/ntc/mail/mailList', '', '', '1', 'mail:confirm', '1', '2018-09-10 14:31:09', '1', '2018-09-10 14:31:09', '', '1', null, '0', '0', '37'); +INSERT INTO `sys_menu` VALUES ('1142', '1146', '0,1,151,937,1146,', 'mail_address', '邮件地址审计', '10', '/ntc/mail/mailList', '', '', '1', 'mail:audit', '1', '2018-09-10 14:31:09', '1', '2018-09-10 14:31:09', '', '1', null, '0', '0', '37'); +#修改邮件菜单 +UPDATE sys_menu set parent_id='1144',parent_ids='0,1,86,931,1144,',code='advanced',sort='30' where id=682; +UPDATE sys_menu set parent_id='1145',parent_ids='0,1,150,934,1145,',code='advanced',sort='30' where id=683; +UPDATE sys_menu set parent_id='1146',parent_ids='0,1,151,937,1146,',code='advanced',sort='30' where id=815; + +