From 04e35d5b3c4b3bf37e4737f284b0fcafcb39188e Mon Sep 17 00:00:00 2001 From: zhangwq Date: Thu, 6 Dec 2018 15:00:05 +0800 Subject: [PATCH 1/4] =?UTF-8?q?snat=E7=AD=96=E7=95=A5=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=B1=BB=E5=9E=8B=E9=80=89=E9=A1=B9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configuration/IpReusePolicyCfg.java | 29 ++++ .../web/dao/configuration/IpMultiplexDao.java | 2 + .../web/dao/configuration/IpMultiplexDao.xml | 57 +++++-- .../configuration/IpAddrPoolCfgService.java | 16 +- .../configuration/IpMultiplexService.java | 17 ++- .../resources/messages/message_en.properties | 6 +- .../resources/messages/message_ru.properties | 4 + .../messages/message_zh_CN.properties | 6 +- .../ipmulitiplex/snatPolicyForm2.jsp | 140 ++++++++++++++++-- .../ipmulitiplex/snatPolicyList2.jsp | 19 ++- 10 files changed, 257 insertions(+), 39 deletions(-) diff --git a/src/main/java/com/nis/domain/configuration/IpReusePolicyCfg.java b/src/main/java/com/nis/domain/configuration/IpReusePolicyCfg.java index a43dae6f0..461b8feea 100644 --- a/src/main/java/com/nis/domain/configuration/IpReusePolicyCfg.java +++ b/src/main/java/com/nis/domain/configuration/IpReusePolicyCfg.java @@ -18,6 +18,11 @@ public class IpReusePolicyCfg extends BaseCfg{ private String userName; private String addrPoolName; // 仅用于列表条件检索 + private Integer ipType; + private Integer ipPattern; + private String srcIpAddress; + private String destIpAddress; + public Integer getUserId() { return userId; } @@ -60,5 +65,29 @@ public class IpReusePolicyCfg extends BaseCfg{ public void setAddrPoolName(String addrPoolName) { this.addrPoolName = addrPoolName; } + public Integer getIpType() { + return ipType; + } + public void setIpType(Integer ipType) { + this.ipType = ipType; + } + public String getSrcIpAddress() { + return srcIpAddress; + } + public void setSrcIpAddress(String srcIpAddress) { + this.srcIpAddress = srcIpAddress; + } + public Integer getIpPattern() { + return ipPattern; + } + public void setIpPattern(Integer ipPattern) { + this.ipPattern = ipPattern; + } + public String getDestIpAddress() { + return destIpAddress; + } + public void setDestIpAddress(String destIpAddress) { + this.destIpAddress = destIpAddress; + } } diff --git a/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.java b/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.java index 21aeb7b6c..29d1f222f 100644 --- a/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.java +++ b/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.java @@ -25,4 +25,6 @@ public interface IpMultiplexDao extends CrudDao{ // 校验地址池是否被引用 List checkAddrPoolIsUsed(@Param("addrPoolId")String addrPoolId); + void updatePolicyAuditStatus(IpReusePolicyCfg cfg); + } diff --git a/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.xml b/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.xml index be141427b..bff96a928 100644 --- a/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.xml @@ -8,7 +8,10 @@ - + + + + @@ -38,7 +41,7 @@ - r.CFG_ID,r.CFG_DESC,r.ADDR_POOL_ID,r.USER_NAME,r.USER_TYPE, + r.CFG_ID,r.CFG_DESC,r.ADDR_POOL_ID,r.USER_NAME,r.USER_TYPE,r.IP_TYPE,r.IP_PATTERN,r.SRC_IP_ADDRESS, r.ACTION,r.DO_LOG,r.IS_VALID,r.IS_AUDIT,r.CFG_REGION_CODE,r.CFG_TYPE,r.FUNCTION_ID, r.SERVICE_ID,r.COMPILE_ID,r.REQUEST_ID,r.CLASSIFY,r.ATTRIBUTE,r.LABLE, r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME, @@ -75,13 +78,12 @@ AND r.compile_id=#{compileId,jdbcType=BIGINT} - - AND r.user_id in (SELECT u.id FROM user_manage u - - u.user_name LIKE concat(concat('%',#{userName,jdbcType=VARCHAR}),'%') - - ) + + AND r.src_ip_address=#{srcIpAddress,jdbcType=VARCHAR} + + AND r.user_name LIKE concat(concat('%',#{userName,jdbcType=VARCHAR}),'%') + AND r.addr_pool_id in (SELECT i.cfg_id FROM ip_reuse_addr_pool i @@ -173,6 +175,9 @@ addr_pool_id, user_name, user_type, + ip_type, + ip_pattern, + src_ip_address, action, do_log, is_valid, @@ -204,6 +209,9 @@ #{addrPoolId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{userType,jdbcType=VARCHAR}, + #{ipType,jdbcType=INTEGER}, + #{ipPattern,jdbcType=INTEGER}, + #{srcIpAddress,jdbcType=VARCHAR}, #{action,jdbcType=INTEGER}, #{doLog,jdbcType=INTEGER}, 0, @@ -246,7 +254,7 @@ update ip_reuse_policy_cfg - + user_name = #{userName,jdbcType=VARCHAR}, @@ -258,6 +266,15 @@ addr_pool_id = #{addrPoolId,jdbcType=INTEGER}, + + ip_type = #{ipType,jdbcType=INTEGER}, + + ip_pattern=#{ipPattern,jdbcType=INTEGER}, + + + src_ip_address=#{srcIpAddress,jdbcType=VARCHAR}, + translate_param = #{translateParam,jdbcType=VARCHAR}, @@ -312,6 +329,28 @@ + + update ip_reuse_policy_cfg + + + + is_valid = #{isValid,jdbcType=INTEGER}, + + + is_audit = #{isAudit,jdbcType=INTEGER}, + + + auditor_id = #{auditorId,jdbcType=INTEGER}, + + + audit_time = #{auditTime,jdbcType=TIMESTAMP}, + + + + WHERE cfg_id = #{cfgId,jdbcType=BIGINT} + + + + + -
+
- +
@@ -174,18 +209,90 @@ $(function(){
+
-
- +
+
- +
-
+
-
+
+ + +
+ +
+ + +
+ +
+
+
+ +
+ +
+
+
+
@@ -204,6 +311,7 @@ $(function(){
+ <%--
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%> --%>
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %> diff --git a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList2.jsp b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList2.jsp index c391c8551..a64838f9d 100644 --- a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList2.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList2.jsp @@ -13,6 +13,8 @@ $("#intype").val("${cfg.addrPoolName}"); }else if("${cfg.userName}"){ $("#intype").val("${cfg.userName}"); + }else if("${cfg.srcIpAddress}"){ + $("#intype").val("${cfg.srcIpAddress}"); }else if("${cfg.compileId}"){ $("#intype").val("${cfg.compileId}"); }else{ @@ -97,8 +99,9 @@ - + + @@ -281,7 +284,9 @@ + + <%-- --%> @@ -315,6 +320,17 @@ + + + + + + + + + + + @@ -322,6 +338,7 @@ + ${indexCfg.srcIpAddress } <%-- From d3bbf10f7299dd1dadced95e0f39c3273c3b2168 Mon Sep 17 00:00:00 2001 From: leijun Date: Thu, 6 Dec 2018 15:58:40 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=96=B0=E5=A2=9EIR=5FSNAT=5FLOG=E5=92=8CI?= =?UTF-8?q?R=5FDNAT=5FLOG=E6=97=A5=E5=BF=97=E6=9F=A5=E8=AF=A2=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=AE=9E=E6=97=B6=E6=8A=A5=E8=A1=A8=20=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E5=90=88=E8=AE=A1--=E6=9C=80=E5=90=8E=E4=B8=80?= =?UTF-8?q?=E5=88=97=E6=95=B0=E6=8D=AE=E5=90=88=E8=AE=A1=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nis/domain/log/IrDnatLog.java | 81 ++++ .../java/com/nis/domain/log/IrSnatLog.java | 73 ++++ src/main/java/com/nis/util/Constants.java | 3 + .../log/ntc/IrDnatLogController.java | 70 ++++ .../log/ntc/IrSnatLogController.java | 70 ++++ .../resources/messages/message_en.properties | 5 +- .../messages/message_zh_CN.properties | 5 +- src/main/resources/nis.properties | 4 +- .../WEB-INF/views/log/ntc/irDnatLogList.jsp | 355 ++++++++++++++++++ .../WEB-INF/views/log/ntc/irSnatLogList.jsp | 354 +++++++++++++++++ src/main/webapp/WEB-INF/views/report/list.jsp | 2 +- 11 files changed, 1018 insertions(+), 4 deletions(-) create mode 100644 src/main/java/com/nis/domain/log/IrDnatLog.java create mode 100644 src/main/java/com/nis/domain/log/IrSnatLog.java create mode 100644 src/main/java/com/nis/web/controller/log/ntc/IrDnatLogController.java create mode 100644 src/main/java/com/nis/web/controller/log/ntc/IrSnatLogController.java create mode 100644 src/main/webapp/WEB-INF/views/log/ntc/irDnatLogList.jsp create mode 100644 src/main/webapp/WEB-INF/views/log/ntc/irSnatLogList.jsp diff --git a/src/main/java/com/nis/domain/log/IrDnatLog.java b/src/main/java/com/nis/domain/log/IrDnatLog.java new file mode 100644 index 000000000..132c481e2 --- /dev/null +++ b/src/main/java/com/nis/domain/log/IrDnatLog.java @@ -0,0 +1,81 @@ +package com.nis.domain.log; + +public class IrDnatLog extends BaseLogEntity { + + private static final long serialVersionUID = 5860838446015457328L; + + protected String userId;// 用户名 + protected String natIp;// 复用的ip地址 + protected String creatTime;// 链接建立时间 + protected String closeTime;// 链接结束时间 + protected String c2sPktNum;// c2s包数 + protected String s2cPktNum;// s2c包数 + protected String c2sByteNum;// c2s字节数 + protected String s2cByteNum;// s2c字节数 + + + + public String getUserId() { + return userId; + } + public void setUserId(String userId) { + this.userId = userId; + } + public String getNatIp() { + return natIp; + } + public void setNatIp(String natIp) { + this.natIp = natIp; + } + public String getCreatTime() { + return creatTime; + } + public void setCreatTime(String creatTime) { + this.creatTime = creatTime; + } + public String getCloseTime() { + return closeTime; + } + public void setCloseTime(String closeTime) { + this.closeTime = closeTime; + } + public String getC2sPktNum() { + return c2sPktNum; + } + public void setC2sPktNum(String c2sPktNum) { + this.c2sPktNum = c2sPktNum; + } + public String getS2cPktNum() { + return s2cPktNum; + } + public void setS2cPktNum(String s2cPktNum) { + this.s2cPktNum = s2cPktNum; + } + public String getC2sByteNum() { + return c2sByteNum; + } + public void setC2sByteNum(String c2sByteNum) { + this.c2sByteNum = c2sByteNum; + } + public String getS2cByteNum() { + return s2cByteNum; + } + public void setS2cByteNum(String s2cByteNum) { + this.s2cByteNum = s2cByteNum; + } + + + + + + + + + + + + + + + +} diff --git a/src/main/java/com/nis/domain/log/IrSnatLog.java b/src/main/java/com/nis/domain/log/IrSnatLog.java new file mode 100644 index 000000000..5b1fe3e2a --- /dev/null +++ b/src/main/java/com/nis/domain/log/IrSnatLog.java @@ -0,0 +1,73 @@ +package com.nis.domain.log; + +public class IrSnatLog extends BaseLogEntity { + + private static final long serialVersionUID = 5860838446015457328L; + + protected String natIp;// 复用的ip地址 + protected String creatTime;// 链接建立时间 + protected String closeTime;// 链接结束时间 + protected String c2sPktNum;// c2s包数 + protected String s2cPktNum;// s2c包数 + protected String c2sByteNum;// c2s字节数 + protected String s2cByteNum;// s2c字节数 + + + public String getNatIp() { + return natIp; + } + public void setNatIp(String natIp) { + this.natIp = natIp; + } + public String getCreatTime() { + return creatTime; + } + public void setCreatTime(String creatTime) { + this.creatTime = creatTime; + } + public String getCloseTime() { + return closeTime; + } + public void setCloseTime(String closeTime) { + this.closeTime = closeTime; + } + public String getC2sPktNum() { + return c2sPktNum; + } + public void setC2sPktNum(String c2sPktNum) { + this.c2sPktNum = c2sPktNum; + } + public String getS2cPktNum() { + return s2cPktNum; + } + public void setS2cPktNum(String s2cPktNum) { + this.s2cPktNum = s2cPktNum; + } + public String getC2sByteNum() { + return c2sByteNum; + } + public void setC2sByteNum(String c2sByteNum) { + this.c2sByteNum = c2sByteNum; + } + public String getS2cByteNum() { + return s2cByteNum; + } + public void setS2cByteNum(String s2cByteNum) { + this.s2cByteNum = s2cByteNum; + } + + + + + + + + + + + + + + + +} diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index 7b1e95493..0899aa5d6 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -757,4 +757,7 @@ public final class Constants { public static final String IP_REUSE_CALL_CGI_URL = Configurations.getStringProperty("ip_reuse_call_cgi_url",""); public static final String ALL_IP_GET = Configurations.getStringProperty("allIpGet","AllIpGet"); public static final String IP_NUM_GET = Configurations.getStringProperty("ipNumGet","IpNumGet"); + //日志查询接口URL + public static final String IR_SNAT_LOG = Configurations.getStringProperty("irSnatLog",""); + public static final String IR_DNAT_LOG = Configurations.getStringProperty("irDnatLog",""); } diff --git a/src/main/java/com/nis/web/controller/log/ntc/IrDnatLogController.java b/src/main/java/com/nis/web/controller/log/ntc/IrDnatLogController.java new file mode 100644 index 000000000..e8ab01909 --- /dev/null +++ b/src/main/java/com/nis/web/controller/log/ntc/IrDnatLogController.java @@ -0,0 +1,70 @@ +package com.nis.web.controller.log.ntc; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; +import com.nis.domain.PageLog; +import com.nis.domain.log.IrDnatLog; +import com.nis.domain.maat.LogRecvData; +import com.nis.util.Constants; +import com.nis.util.DictUtils; +import com.nis.util.httpclient.HttpClientUtil; +import com.nis.web.controller.BaseController; + +@Controller +@RequestMapping("${adminPath}/log/ntc/irDnatLogs") +public class IrDnatLogController extends BaseController { + + @RequestMapping(value = {"list", ""}) + public String list(@ModelAttribute("log") IrDnatLog log, Model model, HttpServletRequest request, HttpServletResponse response) { + try { + PageLog page = new PageLog(request, response); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.IR_DNAT_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + + + logger.info("查询结果:" + recv); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>(){}.getType()); + if (fromJson.getStatus().intValue() == 200) { + page.setCount(fromJson.getData().getCount());page.setList(fromJson.getData().getList()); + List list = page.getList(); + for (IrDnatLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l,serviceList); + } + model.addAttribute("page", page); + } + } + } catch (Exception e) { + logger.error("查询失败", e); + addMessageLog(model, e.getMessage()); + } + + return "/log/ntc/irDnatLogList"; + } + +} diff --git a/src/main/java/com/nis/web/controller/log/ntc/IrSnatLogController.java b/src/main/java/com/nis/web/controller/log/ntc/IrSnatLogController.java new file mode 100644 index 000000000..967bc9e13 --- /dev/null +++ b/src/main/java/com/nis/web/controller/log/ntc/IrSnatLogController.java @@ -0,0 +1,70 @@ +package com.nis.web.controller.log.ntc; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; +import com.nis.domain.FunctionServiceDict; +import com.nis.domain.PageLog; +import com.nis.domain.log.IrSnatLog; +import com.nis.domain.maat.LogRecvData; +import com.nis.util.Constants; +import com.nis.util.DictUtils; +import com.nis.util.httpclient.HttpClientUtil; +import com.nis.web.controller.BaseController; + +@Controller +@RequestMapping("${adminPath}/log/ntc/irSnatLogs") +public class IrSnatLogController extends BaseController { + + @RequestMapping(value = {"list", ""}) + public String list(@ModelAttribute("log") IrSnatLog log, Model model, HttpServletRequest request, HttpServletResponse response) { + try { + PageLog page = new PageLog(request, response); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.IR_SNAT_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + + + logger.info("查询结果:" + recv); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>(){}.getType()); + if (fromJson.getStatus().intValue() == 200) { + page.setCount(fromJson.getData().getCount());page.setList(fromJson.getData().getList()); + List list = page.getList(); + for (IrSnatLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l,serviceList); + } + model.addAttribute("page", page); + } + } + } catch (Exception e) { + logger.error("查询失败", e); + addMessageLog(model, e.getMessage()); + } + + return "/log/ntc/irSnatLogList"; + } + +} diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 4ac74af22..adc5a3adc 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1343,4 +1343,7 @@ ip_check=Please enter a correct IP address user_type=User Type policy_vpn_user=VPN access user name policy_sipv4_user=Three tier access to IP(IPv4) -policy_sipv6_user=Three tier access to IP(IPv6) \ No newline at end of file +policy_sipv6_user=Three tier access to IP(IPv6) +creat_time=Creat Time +close_time=Close Time +nat_ip=Multiplexed IP Address \ 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 70f091930..3e3b59a2f 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1341,4 +1341,7 @@ ip_check=\u8BF7\u586B\u5199\u6B63\u786E\u7684IP\u5730\u5740 user_type=\u7528\u6237\u7C7B\u578B policy_vpn_user=VPN\u63A5\u5165\u7528\u6237\u540D policy_sipv4_user=\u4E09\u5C42\u63A5\u5165\u6E90IP(IPv4) -policy_sipv6_user=\u4E09\u5C42\u63A5\u5165\u6E90IP(IPv6) \ No newline at end of file +policy_sipv6_user=\u4E09\u5C42\u63A5\u5165\u6E90IP(IPv6) +creat_time=\u94FE\u63A5\u5EFA\u7ACB\u65F6\u95F4 +close_time=\u94FE\u63A5\u7ED3\u675F\u65F6\u95F4 +nat_ip=\u590d\u7528\u7684IP\u5730\u5740 \ No newline at end of file diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index 4d9512598..6be65fb44 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -570,4 +570,6 @@ ipNumGet=IpNumGet allIpGet=AllIpGet #\u6D41\u91CF\u7EDF\u8BA1\u5E26\u5BBD\u8BE6\u60C5 trafficBandwidthTrans=trafficBandwidthTrans -trafficProtocolList=trafficProtocolList \ No newline at end of file +trafficProtocolList=trafficProtocolList +irSnatLog=irSnatLogs +irDnatLog=irDnatLogs \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/log/ntc/irDnatLogList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/irDnatLogList.jsp new file mode 100644 index 000000000..e67ca4fb0 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/log/ntc/irDnatLogList.jsp @@ -0,0 +1,355 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + IP<spring:message code="log"></spring:message> + + + + + +
+ +

+ +

+ +
+
+
+
+ + + + + + + + + +
+
+ + + + + + + + + + +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ + + +
+ +
+ + + +
+
+
+
+ + + + + + + +
+
+ +
+
+ + + + + + + +
+
+ +
+
+ + + + + + + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+
+
+
+ + +
+
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ <%-- --%> + + ${log.cfgId } + + + + + + ${log.foundTime }${log.recvTime } + + + + + + ${log.natIp }${log.creatTime }${log.closeTime }${log.c2sPktNum }${log.s2cPktNum }${log.c2sByteNum }${log.s2cByteNum }${fns:abbr(log.capIp, 42)} + + + + + + + + + + ${fns:abbr(log.dIp, 42)}${fns:abbr(log.sIp, 42)}${log.dPort }${log.sPort } + + + + + + + + + + + + + + + + ${log.innerSmac }${log.innerDmac } + + ${streamType.itemValue} + + ${log.addrList }${log.serverLocate}${log.clientLocate}${log.sAsn}${log.dAsn}${log.sSubscribeId}${log.dSubscribeId}${log.userRegion}${log.sceneFile}
+
${page}
+
+
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/log/ntc/irSnatLogList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/irSnatLogList.jsp new file mode 100644 index 000000000..9b7fbf723 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/log/ntc/irSnatLogList.jsp @@ -0,0 +1,354 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + IP<spring:message code="log"></spring:message> + + + + + +
+ +

+ +

+ +
+
+
+
+ + + + + + + + + +
+
+ + + + + + + + + + +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ + + +
+ +
+ + + +
+
+
+
+ + + + + + + +
+
+ +
+
+ + + + + + + +
+
+ +
+
+ + + + + + + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+
+
+
+ + +
+
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ <%-- --%> + + ${log.cfgId } + + + + + + ${log.foundTime }${log.recvTime } + + + + + + ${log.natIp }${log.creatTime }${log.closeTime }${log.c2sPktNum }${log.s2cPktNum }${log.c2sByteNum }${log.s2cByteNum }${fns:abbr(log.capIp, 42)} + + + + + + + + + + ${fns:abbr(log.dIp, 42)}${fns:abbr(log.sIp, 42)}${log.dPort }${log.sPort } + + + + + + + + + + + + + + + + ${log.innerSmac }${log.innerDmac } + + ${streamType.itemValue} + + ${log.addrList }${log.serverLocate}${log.clientLocate}${log.sAsn}${log.dAsn}${log.sSubscribeId}${log.dSubscribeId}${log.userRegion}${log.sceneFile}
+
${page}
+
+
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/report/list.jsp b/src/main/webapp/WEB-INF/views/report/list.jsp index 03280ed1b..73e590569 100644 --- a/src/main/webapp/WEB-INF/views/report/list.jsp +++ b/src/main/webapp/WEB-INF/views/report/list.jsp @@ -290,7 +290,7 @@ function customColumnClick(){ } */ for (var i = 1; i < rows.length; i++) { for (var j = s; j Date: Thu, 6 Dec 2018 17:27:04 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=96=B0=E5=A2=9Eapp=E5=BA=94=E7=94=A8=E8=AF=A6=E6=83=85?= =?UTF-8?q?=EF=BC=8C=E9=98=BB=E6=96=AD=E7=9B=91=E6=B5=8B=E5=8A=A8=E4=BD=9C?= =?UTF-8?q?=E8=B6=8B=E5=8A=BF=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nis/util/Constants.java | 3 +- .../TrafficStatisticsInfoController.java | 85 ++++- .../resources/messages/message_en.properties | 3 +- .../resources/messages/message_ru.properties | 3 +- .../messages/message_zh_CN.properties | 3 +- src/main/resources/nis.properties | 6 +- .../views/dashboard/dashBoardIndex.jsp | 16 +- .../dashboard/trafficActionTransList.jsp | 110 +++++++ .../views/dashboard/trafficAppTypeList.jsp | 297 ++++++++++++++++++ .../views/dashboard/trafficBandwidthList.jsp | 3 +- .../webapp/static/pages/css/data_text.css | 10 +- .../webapp/static/pages/scripts/echart.js | 196 ++++++++---- 12 files changed, 653 insertions(+), 82 deletions(-) create mode 100644 src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp create mode 100644 src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index 0899aa5d6..acf15c5f5 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -699,7 +699,8 @@ public final class Constants { public static final String NTC_RADIUS_REPORT=Configurations.getStringProperty("ntcRadiusReport","ntcRadiusReport"); public static final String TRAFFIC_BANDWIDTH_TRANS=Configurations.getStringProperty("trafficBandwidthTrans","trafficBandwidthTrans"); public static final String TRAFFIC_PROTOCOL_LIST=Configurations.getStringProperty("trafficProtocolList","trafficProtocolList"); - + public static final String TRAFFIC_APP_LIST=Configurations.getStringProperty("trafficAppList","trafficAppList"); + public static final String NTC_ACTION_ENTRANCE_REPORT=Configurations.getStringProperty("ntcActionEntranceReport","ntcActionEntranceReport"); /** * httpclient 工具超时时间设置 */ diff --git a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java index 632279c36..b0f32f98f 100644 --- a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java +++ b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java @@ -106,6 +106,37 @@ public class TrafficStatisticsInfoController extends BaseController { public String bandwidthList( HttpServletRequest request, HttpServletResponse response, Model model){ return "/dashboard/trafficBandwidthList"; } + /** + * 流量统计滚动动作查看详情页面 + */ + @RequestMapping(value={"trafficBlockList","trafficMonitorList"}) + public String serviceBlockList(@RequestParam("searchAction")String searchAction,HttpServletRequest request, HttpServletResponse response, Model model){ + model.addAttribute("searchAction", searchAction); + return "/dashboard/trafficActionTransList"; + } + /** + * 根据动作查询entrance趋势 间隔5分钟数据 + */ + @RequestMapping(value="actionEntranceTrans") + @ResponseBody + public List actionTrans(@RequestParam("searchAction")String searchAction){ + Map fromJsonList = new HashMap(); + List resultList = new ArrayList(); + String url = Constants.DASHBOARD_URL+Constants.NTC_ACTION_ENTRANCE_REPORT; + url=url+"?searchAction="+searchAction; + try { + String string = HttpClientUtil.get(url); + Gson gson = new GsonBuilder().create(); + fromJsonList = gson.fromJson(string, new TypeToken(){}.getType()); + logger.info(searchAction+"动作间隔5分钟数据"+fromJsonList); + resultList = (ArrayList) fromJsonList.get("data"); + } catch (Exception e) { + e.printStackTrace(); + logger.error(searchAction+"动作详情数据获取错误"+e); + resultList.add(Maps.newHashMap("error","request_service_failed")); + } + return resultList; + } /** * 根据ip46,协议tcp,udp查询带宽 间隔5分钟数据 */ @@ -190,5 +221,57 @@ public class TrafficStatisticsInfoController extends BaseController { } return list; } - + /** + * App类型详细列表 + */ + @RequestMapping(value="appTypeList") + public String appTypeList(){ + return "/dashboard/trafficAppTypeList"; + } + /** + * 协议详情统计图跟表 + */ + @RequestMapping(value="appList") + @ResponseBody + public List appList(){ + Map fromJsonList = new HashMap(); + List list = new ArrayList(); + String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_APP_LIST; + try { + String string = HttpClientUtil.get(url); + Gson gson = new GsonBuilder().create(); + fromJsonList = gson.fromJson(string, new TypeToken(){}.getType()); + logger.info("app详情5分钟数据"+fromJsonList); + list = (ArrayList) fromJsonList.get("data"); + Long totalLink=0l; + Long totalPackets=0l; + Double totalGByte=0d; + DecimalFormat lf = new DecimalFormat("0"); + DecimalFormat df = new DecimalFormat("0.00000000"); + if(!StringUtil.isEmpty(list)){ + for (Object object : list) { + Map m=(Map) object; + totalGByte+=Double.parseDouble(m.get("GByte").toString()); +// String linkNum = df.format(m.get("linkNum")); + m.put("GByte", df.format(m.get("GByte"))); + m.put("packets", lf.format(m.get("packets"))); + m.put("linkNum", lf.format(m.get("linkNum"))); + totalLink+=Long.parseLong( m.get("linkNum").toString()); + totalPackets+=Long.parseLong(m.get("packets").toString()); + } + for (Object object : list) { + Map m=(Map) object; + m.put("totalLink", totalLink); + m.put("totalPackets", totalPackets); + m.put("totalGByte", totalGByte); + } + } + + } catch (Exception e) { + e.printStackTrace(); + logger.error("app详情数据获取错误"+e); + list.add(Maps.newHashMap("error","request_service_failed")); + } + return list; + } } diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index adc5a3adc..77da54870 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1346,4 +1346,5 @@ policy_sipv4_user=Three tier access to IP(IPv4) policy_sipv6_user=Three tier access to IP(IPv6) creat_time=Creat Time close_time=Close Time -nat_ip=Multiplexed IP Address \ No newline at end of file +nat_ip=Multiplexed IP Address +traffic=Traffic \ 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 06f5b5b17..f4d987047 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1347,4 +1347,5 @@ ip_check=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043F\u0440\u0430\u0432\u04 user_type=User Type policy_vpn_user=VPN access user name policy_sipv4_user=Three tier access to IP(IPv4) -policy_sipv6_user=Three tier access to IP(IPv6) \ No newline at end of file +policy_sipv6_user=Three tier access to IP(IPv6) +traffic=Traffic \ 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 3e3b59a2f..bf808dd33 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1344,4 +1344,5 @@ policy_sipv4_user=\u4E09\u5C42\u63A5\u5165\u6E90IP(IPv4) policy_sipv6_user=\u4E09\u5C42\u63A5\u5165\u6E90IP(IPv6) creat_time=\u94FE\u63A5\u5EFA\u7ACB\u65F6\u95F4 close_time=\u94FE\u63A5\u7ED3\u675F\u65F6\u95F4 -nat_ip=\u590d\u7528\u7684IP\u5730\u5740 \ No newline at end of file +nat_ip=\u590D\u7528\u7684IP\u5730\u5740 +traffic=Traffic \ No newline at end of file diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index 6be65fb44..6b2a44718 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -572,4 +572,8 @@ allIpGet=AllIpGet trafficBandwidthTrans=trafficBandwidthTrans trafficProtocolList=trafficProtocolList irSnatLog=irSnatLogs -irDnatLog=irDnatLogs \ No newline at end of file +irDnatLog=irDnatLogs +trafficBandwidthTrans=trafficBandwidthTrans +trafficProtocolList=trafficProtocolList +trafficAppList=trafficAppList +ntcActionEntranceReport=ntcActionEntranceReport \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp b/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp index 955af296f..97000d781 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp @@ -37,8 +37,8 @@

-

In 0 | Out 0

@@ -47,7 +47,7 @@

@@ -56,7 +56,7 @@

-

0

+

0

@@ -65,15 +65,13 @@
- +
-
-

" class="tooltips" data-flag="false" data-html="true" data-placement="top">

-

0

+

0

@@ -232,7 +230,7 @@
-    +   
diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp new file mode 100644 index 000000000..6e39b688b --- /dev/null +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp @@ -0,0 +1,110 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + <spring:message code="traffic_ip_active"></spring:message> + + + + + +
+ +

+ +

+ +
+ + + +
+ + + + +<%-- --%> + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp new file mode 100644 index 000000000..4d4a30d30 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -0,0 +1,297 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +app类型 + + + + + + + + + +
+ +

+ +

+ +
+
+
+
+ +
+
+
+
+ + + + + + + + + + + + + +
() () ()
+
+
  
+
+
+ + + + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp index 613efdaf7..cbd56d28d 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp @@ -17,7 +17,7 @@

- +

@@ -115,7 +115,6 @@ function rankItemChanged(addrType,transType){ }, error: function(data, textStatus, errorThrown){ closeTip(); -// warning_prompt("获取实时列表数据失败!",1500); }, complete:function(XMLHttpRequest,status){//超时设置 closeTip(); diff --git a/src/main/webapp/static/pages/css/data_text.css b/src/main/webapp/static/pages/css/data_text.css index c2a2072ed..1b828086b 100644 --- a/src/main/webapp/static/pages/css/data_text.css +++ b/src/main/webapp/static/pages/css/data_text.css @@ -127,7 +127,7 @@ p{ overflow: hidden; white-space: nowrap; text-overflow: ellipsis; - margin: -3px; + margin: -2px; margin-left: -20px; } .data_content .data_info>div.info_1 p:nth-child(2){ @@ -186,6 +186,14 @@ p{ margin-top: 1px; margin-left: 0px; } +.data_content .data_info>div.info_1 .fl_fc .numberRun1{ + width:100%; + font-weight: 600; + font-size: 16px; + color:#288dce; + margin-top: 33px; + margin-left: 0px; +} .data_content .data_info>div.info_1 .fl_fc .numberRun4-unit{ font-weight: 500; font-size: 16px; diff --git a/src/main/webapp/static/pages/scripts/echart.js b/src/main/webapp/static/pages/scripts/echart.js index 66934ede5..539190487 100644 --- a/src/main/webapp/static/pages/scripts/echart.js +++ b/src/main/webapp/static/pages/scripts/echart.js @@ -4,13 +4,17 @@ function echart_1(rs) { var data=new Array(); var drillData=new Array(); + var unit="bytes"; $(rs).each(function(i, d) { + var inoctetsNum=d.count; + unit=changeUnit(inoctetsNum); + inoctetsNum=changeNum(inoctetsNum); var pktNum=new Array(); var byteLen=new Array(); //协议图-操作系统 data.push({ name: d.protoType, - y: parseInt(d.count), + y: parseFloat(inoctetsNum), // drilldown: d.protoType, }); @@ -69,12 +73,14 @@ title: { text: null }, - tool: { + /*tool: { enabled: true, - headerFormat: '{point.key}: {point.percentage:.1f}%
', - pointFormat: '{series.name}: {point.y}', - shared: true, - useHTML: true +// headerFormat: '{point.key}- {point.percentage:.1f}%'+unit, + pointFormat: '{series.name} {point.y}'+unit, + },*/ + tooltip: { + headerFormat: '{series.name}
', + pointFormat: '{point.name}
{point.y}
'+unit }, credits:{//是否有highcharts水印 enabled:false @@ -152,7 +158,7 @@ series: [{ type: 'pie', innerSize: '70%',//圆环的大小 - name: 'bytes', + name: ' ', data: data }], // drilldown:{ @@ -188,21 +194,25 @@ var data=new Array(); var xData=new Array(); var drillData=new Array(); + var unit="bytes"; $(rs).each(function(i, d) { - var pktNum=new Array(); - var byteLen=new Array(); + var inoctetsNum=d.linkNum; + unit=changeUnit(inoctetsNum); + inoctetsNum=changeNum(inoctetsNum); + /*var pktNum=new Array(); + var byteLen=new Array();*/ xData.push(d.ipAddr); //活跃IP图 data.push({ name: d.ipAddr, - y: parseInt(d.linkNum), + y: parseFloat(inoctetsNum), // drilldown: d.ipAddr, }); - pktNum[0]="pktNum"; + /*pktNum[0]="pktNum"; pktNum[1]=parseInt(d.pktNum); byteLen[0]="byteLen"; - byteLen[1]=parseInt(d.byteLen); - drillData.push({ + byteLen[1]=parseInt(d.byteLen);*/ + /*drillData.push({ name: d.ipAddr, id: d.ipAddr, type:'pie', @@ -211,7 +221,7 @@ pointFormat: '{series.name}: {point.y} ({point.percentage:.1f}%)' }, data: [pktNum,byteLen], - }); + });*/ }); var chart = Highcharts.chart('chart_main', { chart: { @@ -285,7 +295,7 @@ yAxis: { min: 0, title: { - text: 'bytes', + text: unit, align:'high', style: {//设置字体颜色 color: '#fff', @@ -304,9 +314,9 @@ }, tooltip: { -// valueSuffix: ' 单位' - }, - + headerFormat: '{series.name}
', + pointFormat: '{point.name}
{point.y}
'+unit + }, plotOptions: { bar: { dataLabels: { @@ -327,7 +337,7 @@ enabled:false }, series: [{ - name: 'bytes', + name: ' ', colorByPoint: true, data: data }], @@ -350,23 +360,59 @@ // } }); } - + function changeNum(inoctetsNum){ + // 变化单位 + var inoctetsNumK=inoctetsNum/1024; + var inoctetsNumM=inoctetsNumK/1024; + var inoctetsNumG=inoctetsNumM/1024; + if(inoctetsNumK>1){ + inoctetsNum=inoctetsNumK; + }; + if(inoctetsNumM>1){ + inoctetsNum=inoctetsNumM; + }; + if(inoctetsNumG>1){ + inoctetsNum=inoctetsNumG; + }; + inoctetsNum=inoctetsNum.toFixed(1) + return inoctetsNum; + } + function changeUnit(inoctetsNum){ + // 变化单位 + var unit="bytes"; + var inoctetsNumK=inoctetsNum/1024; + var inoctetsNumM=inoctetsNumK/1024; + var inoctetsNumG=inoctetsNumM/1024; + if(inoctetsNumK>1){ + unit="KB"; + }; + if(inoctetsNumM>1){ + unit="MB"; + }; + if(inoctetsNumG>1){ + unit="GB"; + }; + return unit + } //app应用类型统计 echart_3 function echart_3(rs) { var data=new Array(); var xData=new Array(); var drillData=new Array(); + var unit="bytes"; $(rs).each(function(i, d) { + var inoctetsNum=d.count; + unit=changeUnit(inoctetsNum); + inoctetsNum=changeNum(inoctetsNum); var pktNum=new Array(); var byteLen=new Array(); xData.push(d.appType); - //活跃IP图 data.push({ name: d.appType, - y: parseInt(d.count), + y: parseFloat(inoctetsNum), // drilldown: d.appType, }); - pktNum[0]="pktNum"; +/* pktNum[0]="pktNum"; pktNum[1]=parseInt(d.pktNum); byteLen[0]="byteLen"; byteLen[1]=parseInt(d.byteLen); @@ -374,7 +420,7 @@ name: d.appType, id: d.appType, data: [pktNum,byteLen], - }); + });*/ }); var chart = Highcharts.chart('chart_3',{ chart: { @@ -437,7 +483,7 @@ yAxis: { min: 0, title: { - text: 'bytes', + text: unit, align:'high', style: {//设置字体颜色 color: '#fff', @@ -457,7 +503,7 @@ tooltip: { enabled: true, headerFormat: '{point.key}
', - pointFormat: '{series.name}: {point.y}', + pointFormat: '{point.y:.1f} '+unit, shared: true, useHTML: true }, @@ -479,7 +525,7 @@ }, series: [{ - name: 'bytes', + name: '', colorByPoint: true, data: data }], @@ -502,20 +548,24 @@ }*/ }); } - //终端用户 分操作系统与浏览器 + //终端用户 分操作系统 function echart_2(rs){ var data=new Array(); var drillData=new Array(); + var unit="bytes"; $(rs).each(function(i, d) { - var pktNum=new Array(); - var byteLen=new Array(); + var inoctetsNum=d.count; + unit=changeUnit(inoctetsNum); + inoctetsNum=changeNum(inoctetsNum); +// var pktNum=new Array(); +// var byteLen=new Array(); data.push({ name: d.osType, - y: parseInt(d.count), + y: parseFloat(inoctetsNum), // drilldown: d.osType, }); - pktNum[0]="pktNum"; +/* pktNum[0]="pktNum"; pktNum[1]=parseInt(d.pktNum); byteLen[0]="byteLen"; byteLen[1]=parseInt(d.byteLen); @@ -525,7 +575,7 @@ function echart_2(rs){ id: d.osType, type:'pie', data: [pktNum,byteLen], - }); + });*/ }); // 创建图例 @@ -616,12 +666,12 @@ function echart_2(rs){ tooltip: { enabled: true, headerFormat: '{point.key}: {point.percentage:.1f}%
', - pointFormat: '{series.name}: {point.y}', + pointFormat: '{point.y} '+unit, shared: true, useHTML: true }, series: [{ - name: 'bytes', + name: ' ', colorByPoint: true, data: data }], @@ -648,17 +698,21 @@ function echart_2(rs){ function echart_5(rs){ var data=new Array(); var drillData=new Array(); + var unit="bytes"; $(rs).each(function(i, d) { - var pktNum=new Array(); - var byteLen=new Array(); + var inoctetsNum=d.count; + unit=changeUnit(inoctetsNum); + inoctetsNum=changeNum(inoctetsNum); +// var pktNum=new Array(); +// var byteLen=new Array(); //协议图-操作系统 data.push({ name: d.bsType, - y: parseInt(d.count), + y: parseFloat(inoctetsNum), // drilldown: d.bsType, }); - pktNum[0]="pktNum"; +/* pktNum[0]="pktNum"; pktNum[1]=parseInt(d.pktNum); byteLen[0]="byteLen"; byteLen[1]=parseInt(d.byteLen); @@ -668,7 +722,7 @@ function echart_5(rs){ id: d.bsType, type:'pie', data: [pktNum,byteLen], - }); + });*/ }); // 创建图例 @@ -760,12 +814,12 @@ function echart_5(rs){ tooltip: { enabled: true, headerFormat: '{point.key}: {point.percentage:.1f}%
', - pointFormat: '{series.name}: {point.y}', + pointFormat: '{point.y} '+unit, shared: true, useHTML: true }, series: [{ - name: 'bytes', + name: ' ', colorByPoint: true, data: data }], @@ -792,17 +846,21 @@ function echart_5(rs){ //网站流量分析 function echart_4(rs){ var data=new Array(); - var drillData=new Array(); +// var drillData=new Array(); + var unit="bytes"; $(rs).each(function(i, d) { - var pktNum=new Array(); - var byteLen=new Array(); + var inoctetsNum=d.count; + unit=changeUnit(inoctetsNum); + inoctetsNum=changeNum(inoctetsNum); +// var pktNum=new Array(); +// var byteLen=new Array(); data.push({ name: d.websiteService, - y: parseInt(d.count), + y: parseFloat(inoctetsNum), // drilldown: d.websiteService, }); - pktNum[0]="pktNum"; +/* pktNum[0]="pktNum"; pktNum[1]=parseInt(d.pktNum); byteLen[0]="byteLen"; byteLen[1]=parseInt(d.byteLen); @@ -812,7 +870,7 @@ function echart_4(rs){ id: d.websiteService, type:'pie', data: [pktNum,byteLen], - }); + });*/ }); // 创建图例 @@ -895,15 +953,15 @@ function echart_4(rs){ fontFamily:'Microsoft YaHei', } }, - tooltip: { + tooltip: { enabled: true, headerFormat: '{point.key}: {point.percentage:.1f}%
', - pointFormat: '{series.name}: {point.y}', + pointFormat: '{point.y} '+unit, shared: true, useHTML: true }, series: [{ - name: 'bytes', + name: ' ', colorByPoint: true, data: data, }], @@ -929,18 +987,22 @@ function echart_4(rs){ //网站流量分析-点击列表显示网站分类 function echart_6(rs){ var data=new Array(); - var drillData=new Array(); +// var drillData=new Array(); + var unit="bytes"; $(rs).each(function(i, d) { - var pktNum=new Array(); - var byteLen=new Array(); + var inoctetsNum=d.count; + unit=changeUnit(inoctetsNum); + inoctetsNum=changeNum(inoctetsNum); +// var pktNum=new Array(); +// var byteLen=new Array(); //协议图-操作系统 data.push({ name: d.domain, - y: parseInt(d.count), + y: parseFloat(inoctetsNum), // drilldown: d.domain, }); - pktNum[0]="pktNum"; +/* pktNum[0]="pktNum"; pktNum[1]=parseInt(d.pktNum); byteLen[0]="byteLen"; byteLen[1]=parseInt(d.byteLen); @@ -950,7 +1012,7 @@ function echart_6(rs){ id: d.domain, type:'pie', data: [pktNum,byteLen], - }); + });*/ }); // 创建图例 @@ -1033,15 +1095,15 @@ function echart_6(rs){ fontFamily:'Microsoft YaHei', } }, - tooltip: { + tooltip: { enabled: true, headerFormat: '{point.key}: {point.percentage:.1f}%
', - pointFormat: '{series.name}: {point.y}', + pointFormat: '{point.y} '+unit, shared: true, useHTML: true }, series: [{ - name: 'bytes', + name: ' ', colorByPoint: true, data: data, }], @@ -1070,21 +1132,27 @@ function echart_topic_domain(rs){ 'parent': '', 'name': 'TOPIC' }]; - + var unit="bytes"; $(rs).each(function(i,d){ + var inoctetsNum=d.count; + unit=changeUnit(inoctetsNum); + inoctetsNum=changeNum(inoctetsNum); data.push({ 'id': '1.'+d.topicId, 'parent': '0.0', 'name': d.topic, - 'value':d.count + 'value':parseFloat(inoctetsNum) }); /****主题中的子域名*******/ $(d.domainData).each(function(j,t){ + var domainNum=d.count; + unit=changeUnit(domainNum); + domainNum=changeNum(domainNum); data.push({ 'id': '2.'+t.webId, 'parent': '1.'+d.topicId, 'name': t.domain, - 'value':t.count + 'value':parseFloat(domainNum) }); }) @@ -1186,7 +1254,7 @@ function echart_topic_domain(rs){ }], tooltip: { headerFormat: "", - pointFormat: '{point.name}: {point.value}' + pointFormat: '{point.name} : {point.value} ' +unit } }); } From 7a99f6b758b905a7e3fb10ce012ba419701ce53c Mon Sep 17 00:00:00 2001 From: zhangwq Date: Thu, 6 Dec 2018 18:15:27 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E6=B1=A0=E7=AE=A1=E7=90=86=E6=9F=A5=E7=9C=8B=E6=89=80=E6=9C=89?= =?UTF-8?q?IP=E3=80=81=E7=AD=96=E7=95=A5=E7=AE=A1=E7=90=86=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=B1=BB=E5=9E=8B=E6=A3=80=E7=B4=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../maintenance/IpAddrPoolController.java | 8 ++++ .../nis/web/dao/basics/IpReuseIpCfgDao.java | 1 + .../nis/web/dao/basics/IpReuseIpCfgDao.xml | 9 ++++ .../web/dao/configuration/IpMultiplexDao.xml | 3 ++ .../service/basics/IpReuseIpCfgService.java | 9 ++++ .../resources/messages/message_en.properties | 3 +- .../resources/messages/message_ru.properties | 3 +- .../messages/message_zh_CN.properties | 3 +- .../20181206/update_function_region_dict.sql | 5 +++ .../maintenance/ipMultiplexPool/snatlist2.jsp | 43 ++++++++++++++++--- .../ipmulitiplex/snatPolicyList2.jsp | 32 +++++++++++++- 11 files changed, 108 insertions(+), 11 deletions(-) create mode 100644 src/main/resources/sql/20181206/update_function_region_dict.sql diff --git a/src/main/java/com/nis/web/controller/configuration/maintenance/IpAddrPoolController.java b/src/main/java/com/nis/web/controller/configuration/maintenance/IpAddrPoolController.java index 8906b2b41..e1e8c47e1 100644 --- a/src/main/java/com/nis/web/controller/configuration/maintenance/IpAddrPoolController.java +++ b/src/main/java/com/nis/web/controller/configuration/maintenance/IpAddrPoolController.java @@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.Page; +import com.nis.domain.basics.IpReuseIpCfg; import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.IpAddrPoolCfg; import com.nis.exceptions.MaatConvertException; @@ -175,5 +176,12 @@ public class IpAddrPoolController extends BaseController{ resultMap=ConfigServiceUtil.getCGIInfo(url, cmd, params); return resultMap; } + + @ResponseBody + @RequestMapping(value = {"/getAllIpInfo"}) + public List getAllIpInfo(Integer addrPoolId,HttpServletRequest request,HttpServletResponse response){ + List ipList = ipReuseIpCfgService.getPolicyIpInfo(addrPoolId); + return ipList; + } } diff --git a/src/main/java/com/nis/web/dao/basics/IpReuseIpCfgDao.java b/src/main/java/com/nis/web/dao/basics/IpReuseIpCfgDao.java index 9923e0c0d..d21ece4bd 100644 --- a/src/main/java/com/nis/web/dao/basics/IpReuseIpCfgDao.java +++ b/src/main/java/com/nis/web/dao/basics/IpReuseIpCfgDao.java @@ -14,4 +14,5 @@ public interface IpReuseIpCfgDao extends CrudDao { List findPage(IpReuseIpCfg userIpCfg); IpReuseIpCfg getUserIpCfg(Long cfgId); IpReuseIpCfg getIpByIp(String destIpAddress); + List getPolicyIpInfo(@Param("addrPoolId")Integer addrPoolId); } diff --git a/src/main/java/com/nis/web/dao/basics/IpReuseIpCfgDao.xml b/src/main/java/com/nis/web/dao/basics/IpReuseIpCfgDao.xml index cecd2ccd8..d75bef443 100644 --- a/src/main/java/com/nis/web/dao/basics/IpReuseIpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/basics/IpReuseIpCfgDao.xml @@ -182,6 +182,15 @@ where r.is_valid !=-1 and r.cfg_id=#{cfgId} + + insert into ip_reuse_ip_cfg ( CFG_DESC, diff --git a/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.xml b/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.xml index bff96a928..6e39f9f08 100644 --- a/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/IpMultiplexDao.xml @@ -81,6 +81,9 @@ AND r.src_ip_address=#{srcIpAddress,jdbcType=VARCHAR} + + AND r.user_type=#{userType,jdbcType=VARCHAR} + AND r.user_name LIKE concat(concat('%',#{userName,jdbcType=VARCHAR}),'%') diff --git a/src/main/java/com/nis/web/service/basics/IpReuseIpCfgService.java b/src/main/java/com/nis/web/service/basics/IpReuseIpCfgService.java index 26e628ada..e34ae64b4 100644 --- a/src/main/java/com/nis/web/service/basics/IpReuseIpCfgService.java +++ b/src/main/java/com/nis/web/service/basics/IpReuseIpCfgService.java @@ -102,4 +102,13 @@ public class IpReuseIpCfgService extends BaseService{ ipReuseIpCfgDao.update(entity); } } + + /** + * 策略管理:获取所有IP信息 + * @param addrPoolId + * @return + */ + public List getPolicyIpInfo(Integer addrPoolId) { + return ipReuseIpCfgDao.getPolicyIpInfo(addrPoolId); + } } diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 77da54870..7e0487daf 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1347,4 +1347,5 @@ policy_sipv6_user=Three tier access to IP(IPv6) creat_time=Creat Time close_time=Close Time nat_ip=Multiplexed IP Address -traffic=Traffic \ No newline at end of file +traffic=Traffic +ip_info=IP Info \ 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 f4d987047..35be717d8 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1348,4 +1348,5 @@ user_type=User Type policy_vpn_user=VPN access user name policy_sipv4_user=Three tier access to IP(IPv4) policy_sipv6_user=Three tier access to IP(IPv6) -traffic=Traffic \ No newline at end of file +traffic=Traffic +ip_info=IP Info \ 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 bf808dd33..afd987d4f 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1345,4 +1345,5 @@ policy_sipv6_user=\u4E09\u5C42\u63A5\u5165\u6E90IP(IPv6) creat_time=\u94FE\u63A5\u5EFA\u7ACB\u65F6\u95F4 close_time=\u94FE\u63A5\u7ED3\u675F\u65F6\u95F4 nat_ip=\u590D\u7528\u7684IP\u5730\u5740 -traffic=Traffic \ No newline at end of file +traffic=Traffic +ip_info=IP\u5730\u5740\u4FE1\u606F \ No newline at end of file diff --git a/src/main/resources/sql/20181206/update_function_region_dict.sql b/src/main/resources/sql/20181206/update_function_region_dict.sql new file mode 100644 index 000000000..64eee8937 --- /dev/null +++ b/src/main/resources/sql/20181206/update_function_region_dict.sql @@ -0,0 +1,5 @@ +UPDATE function_region_dict SET config_ip_pattern = '1,3' WHERE dict_id = 68 AND function_id = 300; + +ALTER TABLE ip_reuse_policy_cfg ADD ip_type INT(11) DEFAULT NULL COMMENT 'IPV4=4,IPV6=6'; +ALTER TABLE ip_reuse_policy_cfg ADD ip_pattern INT(11) DEFAULT NULL; +ALTER TABLE ip_reuse_policy_cfg ADD src_ip_address VARCHAR(128) DEFAULT NULL; \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist2.jsp b/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist2.jsp index 838eaed0d..6fddec6bc 100644 --- a/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist2.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/maintenance/ipMultiplexPool/snatlist2.jsp @@ -84,7 +84,7 @@ success:function(data,status){ var dataArr = data.candidate_ip; var html = "" - html = "

" + html = "
" html+=""; html+=""; if(dataArr.length == 0){ @@ -111,6 +111,35 @@ } }); } + + function getAllIpInfo(obj){ + var addrPoolId = $(obj).attr("addrPoolId"); + $.ajax({ + data:{"addrPoolId":addrPoolId}, + url:"${ctx}/maintenance/ipMultiplexPoolCfg/getAllIpInfo", + async:true, + success:function(data,status){ + var html = "" + html = "
" + html+="
"; + html+=""; + if(data.length == 0){ + html+=""; + html+=""; + html+=""; + } + for(i=0;i"; + html+=""; + } + html+=""; + html+="
("+""+")
"; + html+="
"; + top.$.jBox(html,{width: $(document).width()*0.4,height: 380,title:"", buttons:{"":true}}); + } + }); + } @@ -365,11 +394,11 @@ <%-- --%> + - <%-- --%> @@ -420,6 +449,11 @@ --%> + + + + ${cfg.requestName } @@ -478,11 +512,6 @@ ${fns:abbr(lableInfo,20)} - <%-- - - - --%> ${cfg.creatorName } ${cfg.editorName } diff --git a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList2.jsp b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList2.jsp index a64838f9d..68f910199 100644 --- a/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList2.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/manipulation/ipmulitiplex/snatPolicyList2.jsp @@ -20,10 +20,33 @@ }else{ $("#intype").attr("placeholder"," "+$("#seltype").find("option:selected").text()); } + + // 处理用户类型检索条件 + if($("#seltype").val() == "userType"){ + $("#intype").hide();// 隐藏输入框 + $("#isValid").selectpicker("hide"); + }else{ + $("#userType").selectpicker("hide"); + } $("#seltype").change(function(){ + if($(this).val() == "userType"){ + $("#intype").hide();// 隐藏输入框 + $("#intype").val("");// 清空input条件 + $("#userType").find("option").removeAttr("selected",false); + $("#userType").selectpicker("refresh"); + $("#userType").selectpicker("show"); + $("#isValid").selectpicker("hide"); + }else if($(this).val() == "isValid"){ + $("#userType").find("option:first").attr("selected",true); + $("#userType").selectpicker("hide"); + }else{ + $("#userType").find("option:first").attr("selected",true); + $("#userType").selectpicker("hide");// 隐藏下拉框 + } $("#intype").attr("placeholder"," "+$(this).find("option:selected").text()); }); - //筛选功能初始化 + + //筛选功能初始化 filterActionInit(); $("#isAudit").change(function(){ page(); @@ -102,6 +125,7 @@ + @@ -115,6 +139,12 @@ + + + + + +