添加P2P日志查询
This commit is contained in:
@@ -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_NTC_ENTRANCE_REPORT=Configurations.getStringProperty("ntcEntranceReport","ntcEntranceReport");
|
||||||
public static final String NTC_IP_LOG = Configurations.getStringProperty("ntcIpLog","");
|
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_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_HTTP_LOG = Configurations.getStringProperty("ntcHttpLog","");
|
||||||
public static final String NTC_DNS_LOG = Configurations.getStringProperty("ntcDnsLog","");
|
public static final String NTC_DNS_LOG = Configurations.getStringProperty("ntcDnsLog","");
|
||||||
public static final String NTC_SSL_LOG = Configurations.getStringProperty("ntcSslLog","");
|
public static final String NTC_SSL_LOG = Configurations.getStringProperty("ntcSslLog","");
|
||||||
|
|||||||
@@ -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<NtcIpLog> page = new PageLog<NtcIpLog>(request, response);
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("pageSize", page.getPageSize());
|
||||||
|
params.put("pageNo", page.getPageNo());
|
||||||
|
initLogSearchValue(log, params);
|
||||||
|
|
||||||
|
List<FunctionServiceDict> 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<NtcIpLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcIpLog>>(){}.getType());
|
||||||
|
if (fromJson.getStatus().intValue() == 200) {
|
||||||
|
page.setList(fromJson.getData().getList());
|
||||||
|
List<NtcIpLog> 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";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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_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=Server port is empty or incorrectly formatting(0-65535)
|
||||||
val_dst_port_mask=Server port mask format is incorrect(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)
|
val_direction=Direction should be 0(bidirectional) or 1(unidirectional)
|
||||||
#===============protocol IP Import end=================
|
#===============protocol IP Import end=================
|
||||||
|
|
||||||
@@ -1078,3 +1078,4 @@ ip_intercepter_ratelimit=IP Intercept Ratelimit
|
|||||||
domain_intercepter_ratelimit=Domain Intercept Ratelimit
|
domain_intercepter_ratelimit=Domain Intercept Ratelimit
|
||||||
app_built_in_features_config=APP Built-in Features
|
app_built_in_features_config=APP Built-in Features
|
||||||
app_ssl_config=APP SSL Cert Feature
|
app_ssl_config=APP SSL Cert Feature
|
||||||
|
p2p_control=P2P
|
||||||
@@ -1076,3 +1076,4 @@ ip_intercepter_ratelimit=IP\u62E6\u622A\u9650\u901F
|
|||||||
domain_intercepter_ratelimit=\u57DF\u540D\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_built_in_features_config=APP\u5185\u7F6E\u7279\u5F81\u7EF4\u62A4
|
||||||
app_ssl_config=APP SSL\u8BC1\u4E66\u7279\u5F81
|
app_ssl_config=APP SSL\u8BC1\u4E66\u7279\u5F81
|
||||||
|
p2p_control=P2P
|
||||||
260
src/main/webapp/WEB-INF/views/log/ntc/p2pList.jsp
Normal file
260
src/main/webapp/WEB-INF/views/log/ntc/p2pList.jsp
Normal file
@@ -0,0 +1,260 @@
|
|||||||
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>
|
||||||
|
P2P<spring:message code="log"></spring:message>
|
||||||
|
</title>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
//reset
|
||||||
|
$("#resetBtn").on("click",function(){
|
||||||
|
$("select.selectpicker").each(function(){
|
||||||
|
$(this).selectpicker('val',$(this).find('option:first').val());
|
||||||
|
$(this).find("option").attr("selected",false);
|
||||||
|
$(this).find("option:first").attr("selected",true);
|
||||||
|
});
|
||||||
|
$(".Wdate").attr("value",'');
|
||||||
|
$(':input','#searchForm')
|
||||||
|
.not(':button,:submit,:reset,:hidden')
|
||||||
|
.attr("value",'');
|
||||||
|
$("#searchForm")[0].reset();
|
||||||
|
});
|
||||||
|
//筛选功能
|
||||||
|
filterActionInit();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="theme-panel hidden-xs hidden-sm">
|
||||||
|
</div>
|
||||||
|
<h3 class="page-title">
|
||||||
|
<spring:message code="p2p_control"/>
|
||||||
|
<small><spring:message code="date_list"/></small>
|
||||||
|
</h3>
|
||||||
|
<h5 class="page-header"></h5>
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="portlet">
|
||||||
|
<div class="portlet-body">
|
||||||
|
<div class="row" >
|
||||||
|
<form:form id="searchForm" modelAttribute="log" action="${ctx}/log/ntc/p2pLogs" method="post" class="form-search">
|
||||||
|
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||||
|
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||||
|
<input id="functionId" name="functionId" type="hidden" value="${log.functionId}"/>
|
||||||
|
<!-- 筛选按钮展开状态-->
|
||||||
|
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${log.isFilterAction }"/>
|
||||||
|
<!-- 搜索内容与操作按钮栏 -->
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="pull-left">
|
||||||
|
<select path="action" class="selectpicker select2 input-small">
|
||||||
|
<option value=""><spring:message code="action"/></option>
|
||||||
|
<c:forEach items="${serviceList}" var="service"
|
||||||
|
varStatus="satus">
|
||||||
|
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
||||||
|
<c:if test="${(dict.itemCode eq service.action) && (service.action ne 128) && (service.action ne 32)}"> --%>
|
||||||
|
<option value="${dict.itemCode}"
|
||||||
|
<c:if test="${log.action eq dict.itemCode}">
|
||||||
|
selected
|
||||||
|
</c:if>
|
||||||
|
>
|
||||||
|
<spring:message code="${dict.itemValue}"/>
|
||||||
|
</option>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="pull-left">
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-btn">
|
||||||
|
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
||||||
|
</div>
|
||||||
|
<input name="searchFoundStartTime" type="text" readonly="readonly" maxlength="20" class="form-control Wdate input-medium"
|
||||||
|
value="${log.searchFoundStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pull-left">
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-btn">
|
||||||
|
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
||||||
|
</div>
|
||||||
|
<input name="searchFoundEndTime" type="text" readonly="readonly" maxlength="20" class="form-control Wdate input-medium"
|
||||||
|
value="${log.searchFoundEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pull-left">
|
||||||
|
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
|
||||||
|
<button type="button" class="btn btn-default" id="resetBtn"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||||
|
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/><i class="fa fa-angle-double-down"></i></button>
|
||||||
|
</div>
|
||||||
|
<div class="pull-right">
|
||||||
|
<a class="btn btn-icon-only btn-default setfields tooltips"
|
||||||
|
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
|
||||||
|
<i class="icon-wrench"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 搜索内容与操作按钮栏 -->
|
||||||
|
|
||||||
|
<!-- 筛选搜索内容栏默认隐藏-->
|
||||||
|
<div class="col-md-12 filter-action-select-panle hide" >
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label"><spring:message code='protocol_type'/>:</label>
|
||||||
|
<form:select path="transProto" class="selectpicker form-control">
|
||||||
|
<form:option value=""><spring:message code="select"/></form:option>
|
||||||
|
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="protocol" >
|
||||||
|
<form:option value="${protocol.itemCode}"><spring:message code="${protocol.itemValue}"></spring:message></form:option>
|
||||||
|
</c:forEach>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label"><spring:message code='direct'/>:</label>
|
||||||
|
<form:select path="direction" class="selectpicker form-control">
|
||||||
|
<form:option value=""><spring:message code="select"/></form:option>
|
||||||
|
<c:forEach items="${fns:getDictList('DIRECTION')}" var="direction" >
|
||||||
|
<form:option value="${direction.itemCode}"><spring:message code="${direction.itemValue}"></spring:message></form:option>
|
||||||
|
</c:forEach>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label><spring:message code="entrance"/>:</label>
|
||||||
|
<form:select path="entranceId" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
|
||||||
|
<form:option value=""><spring:message code="select"/></form:option>
|
||||||
|
<c:forEach items="${fns:getDictList('ENTRANCE')}" var="entrance" >
|
||||||
|
<form:option value="${entrance.itemCode}"><spring:message code="${entrance.itemValue}"></spring:message></form:option>
|
||||||
|
</c:forEach>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label><spring:message code="clj_ip"></spring:message>:</label>
|
||||||
|
<input name="capIp" type="text" class="form-control" value="${log.capIp }"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label><spring:message code="clientip"></spring:message>:</label>
|
||||||
|
<input name="sIp" type="text" class="form-control" value="${log.sIp }"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label><spring:message code="serverip"></spring:message>:</label>
|
||||||
|
<input name="dIp" type="text" class="form-control" value="${log.dIp }"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /筛选搜索内容栏 结束-->
|
||||||
|
</form:form>
|
||||||
|
</div>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<sys:message content="${message}"/>
|
||||||
|
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap logTb">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><spring:message code="cfg_id"/></th>
|
||||||
|
<th><spring:message code="action"/></th>
|
||||||
|
<th><spring:message code="found_time"/></th>
|
||||||
|
<th><spring:message code="entrance"/></th>
|
||||||
|
<th><spring:message code="clj_ip"/></th>
|
||||||
|
<th><spring:message code="protocol"/></th>
|
||||||
|
<th><spring:message code='addr_type'/></th>
|
||||||
|
<th><spring:message code="server_ip"/></th>
|
||||||
|
<th><spring:message code="client_ip"/></th>
|
||||||
|
<th><spring:message code="server_port"/></th>
|
||||||
|
<th><spring:message code="client_port"/></th>
|
||||||
|
<th><spring:message code="deviceid"/></th>
|
||||||
|
<th><spring:message code="direction"/></th>
|
||||||
|
<th><spring:message code="stream_type"/></th>
|
||||||
|
<%-- <th><spring:message code="nest_addr_list"/></th> --%>
|
||||||
|
<th><spring:message code='server_locate'/></th>
|
||||||
|
<th><spring:message code='client_locate'/></th>
|
||||||
|
<th><spring:message code='s_asn'/></th>
|
||||||
|
<th><spring:message code='d_asn'/></th>
|
||||||
|
<th><spring:message code='s_subscribe_id'/></th>
|
||||||
|
<th><spring:message code='d_subscribe_id'/></th>
|
||||||
|
<th><spring:message code='scene_file'/></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<c:forEach var="log" items="${page.list }" varStatus="status">
|
||||||
|
<tr>
|
||||||
|
<td>${log.cfgId }
|
||||||
|
<a href="javascript:void(0)" name="viewLogInfo"><i class="icon-book-open"></i></a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('SERVICE_ACTION')}" var="dict">
|
||||||
|
<c:if test="${dict.itemCode eq log.action}">
|
||||||
|
<spring:message code="${dict.itemValue}"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td>${log.foundTime }</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('ENTRANCE')}" var="dic">
|
||||||
|
<c:if test="${dic.itemCode eq log.entranceId}">
|
||||||
|
<spring:message code="${dic.itemValue}"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td title="${log.capIp }">${fns:abbr(log.capIp, 42)}</td>
|
||||||
|
<td>${log.transProto }</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="dic">
|
||||||
|
<c:if test="${log.addrType==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td title="${log.dIp }">${fns:abbr(log.dIp, 42)}</td>
|
||||||
|
<td title="${log.sIp }">${fns:abbr(log.sIp, 42)}</td>
|
||||||
|
<td>${log.dPort }</td>
|
||||||
|
<td>${log.sPort }</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('DEVICE')}" var="device">
|
||||||
|
<c:if test="${device.itemCode eq log.deviceId}"><spring:message code="${device.itemValue}"/></c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('DIRECTION')}" var="direction">
|
||||||
|
<c:if test="${direction.itemCode eq log.direction}"><spring:message code="${direction.itemValue}"/></c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('LOG_STREAM_TYPE')}" var="streamType">
|
||||||
|
<c:if test="${streamType.itemCode eq log.streamDir}">${streamType.itemValue}</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<%-- <td>${log.addrList }</td> --%>
|
||||||
|
<td>${log.serverLocate}</td>
|
||||||
|
<td>${log.clientLocate}</td>
|
||||||
|
<td>${log.sAsn}</td>
|
||||||
|
<td>${log.dAsn}</td>
|
||||||
|
<td>${log.sSubscribeId}</td>
|
||||||
|
<td>${log.dSubscribeId}</td>
|
||||||
|
<td>${log.sceneFile}</td>
|
||||||
|
</tr>
|
||||||
|
</c:forEach>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div class="page">${page}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user