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