diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index ab7c702b4..2365f5b10 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -390,6 +390,7 @@ public final class Constants { public static final String NTC_NTC_ENTRANCE_REPORT=Configurations.getStringProperty("ntcEntranceReport","ntcEntranceReport"); public static final String NTC_IP_LOG = Configurations.getStringProperty("ntcIpLog",""); public static final String NTC_BGP_LOG = Configurations.getStringProperty("ntcBgpLog",""); + public static final String NTC_P2P_LOG = Configurations.getStringProperty("ntcP2pLog",""); public static final String NTC_HTTP_LOG = Configurations.getStringProperty("ntcHttpLog",""); public static final String NTC_DNS_LOG = Configurations.getStringProperty("ntcDnsLog",""); public static final String NTC_SSL_LOG = Configurations.getStringProperty("ntcSslLog",""); diff --git a/src/main/java/com/nis/web/controller/log/ntc/B2pLogController.java b/src/main/java/com/nis/web/controller/log/ntc/B2pLogController.java new file mode 100644 index 000000000..0cca62917 --- /dev/null +++ b/src/main/java/com/nis/web/controller/log/ntc/B2pLogController.java @@ -0,0 +1,75 @@ +package com.nis.web.controller.log.ntc; + +import java.io.File; +import java.io.IOException; +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.aspectj.util.FileUtil; +import org.springframework.beans.BeanUtils; +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 org.springframework.web.bind.annotation.ResponseBody; + +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.Page; +import com.nis.domain.PageLog; +import com.nis.domain.log.NtcIpLog; +import com.nis.domain.maat.LogRecvData; +import com.nis.exceptions.MaatConvertException; +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/p2pLogs") +public class B2pLogController extends BaseController { + + @RequestMapping(value = {"list", ""}) + public String list(@ModelAttribute("log") NtcIpLog 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.NTC_P2P_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.setList(fromJson.getData().getList()); + List list = page.getList(); + for (NtcIpLog 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/p2pList"; + } + +} diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 9a8d8e5f7..681f0a848 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -617,7 +617,7 @@ val_dst_ip=Server IP format is incorrect or inconsistent with IP type val_dst_mask=Server IP mask format is incorrect or inconsistent with IP type val_dst_port=Server port is empty or incorrectly formatting(0-65535) val_dst_port_mask=Server port mask format is incorrect(0-65535) -val_protocol=Protocol Can't be empty,and should be 6(TCP),17(UDP),0(\u4EFB\u610F) +val_protocol=Protocol Can't be empty,and should be 6(TCP),17(UDP),0(\u4efb\u610f) val_direction=Direction should be 0(bidirectional) or 1(unidirectional) #===============protocol IP Import end================= @@ -1078,3 +1078,4 @@ ip_intercepter_ratelimit=IP Intercept Ratelimit domain_intercepter_ratelimit=Domain Intercept Ratelimit app_built_in_features_config=APP Built-in Features app_ssl_config=APP SSL Cert Feature +p2p_control=P2P \ 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 ccaf6b343..7c59efeb4 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1076,3 +1076,4 @@ ip_intercepter_ratelimit=IP\u62E6\u622A\u9650\u901F domain_intercepter_ratelimit=\u57DF\u540D\u62E6\u622A\u9650\u901F app_built_in_features_config=APP\u5185\u7F6E\u7279\u5F81\u7EF4\u62A4 app_ssl_config=APP SSL\u8BC1\u4E66\u7279\u5F81 +p2p_control=P2P \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/log/ntc/p2pList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/p2pList.jsp new file mode 100644 index 000000000..1d691911d --- /dev/null +++ b/src/main/webapp/WEB-INF/views/log/ntc/p2pList.jsp @@ -0,0 +1,260 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + P2P<spring:message code="log"></spring:message> + + + + + +
+ +

+ + +

+ +
+
+
+
+ + + + + + + +
+
+ +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ + + +
+ +
+ + + +
+
+
+
+ + + + + + + +
+
+ +
+
+ + + + + + + +
+
+ +
+
+ + + + + + + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + <%-- --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> + + + + + + + + + + +
${log.cfgId } + + + + + + + + ${log.foundTime } + + + + + + ${fns:abbr(log.capIp, 42)}${log.transProto } + + + + ${fns:abbr(log.dIp, 42)}${fns:abbr(log.sIp, 42)}${log.dPort }${log.sPort } + + + + + + + + + + ${streamType.itemValue} + + ${log.addrList }${log.serverLocate}${log.clientLocate}${log.sAsn}${log.dAsn}${log.sSubscribeId}${log.dSubscribeId}${log.sceneFile}
+
${page}
+
+
+
+
+
+ + \ No newline at end of file