日志openvpn页面提交;公共类修改;日志公共字段,openvpn配置文件国际化
This commit is contained in:
@@ -32,7 +32,7 @@ public class BaseLogEntity<T> extends BaseEntity<T> {
|
|||||||
//自定义字段
|
//自定义字段
|
||||||
protected String seltype;//选中类型,页面搜索用
|
protected String seltype;//选中类型,页面搜索用
|
||||||
protected String searchFoundStartTime;//开始时间,格式为yyyy-mm-dd hh24:mi:ss
|
protected String searchFoundStartTime;//开始时间,格式为yyyy-mm-dd hh24:mi:ss
|
||||||
protected String searchFoundendTime;//结束时间,格式同上
|
protected String searchFoundEndTime;//结束时间,格式同上
|
||||||
|
|
||||||
|
|
||||||
public String getSearchFoundStartTime() {
|
public String getSearchFoundStartTime() {
|
||||||
@@ -41,11 +41,11 @@ public class BaseLogEntity<T> extends BaseEntity<T> {
|
|||||||
public void setSearchFoundStartTime(String searchFoundStartTime) {
|
public void setSearchFoundStartTime(String searchFoundStartTime) {
|
||||||
this.searchFoundStartTime = searchFoundStartTime;
|
this.searchFoundStartTime = searchFoundStartTime;
|
||||||
}
|
}
|
||||||
public String getSearchFoundendTime() {
|
public String getSearchFoundEndTime() {
|
||||||
return searchFoundendTime;
|
return searchFoundEndTime;
|
||||||
}
|
}
|
||||||
public void setSearchFoundendTime(String searchFoundendTime) {
|
public void setSearchFoundEndTime(String searchFoundEndTime) {
|
||||||
this.searchFoundendTime = searchFoundendTime;
|
this.searchFoundEndTime = searchFoundEndTime;
|
||||||
}
|
}
|
||||||
public String getSeltype() {
|
public String getSeltype() {
|
||||||
return seltype;
|
return seltype;
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
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.http.client.ClientProtocolException;
|
||||||
|
import org.aspectj.util.FileUtil;
|
||||||
|
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.Page;
|
||||||
|
import com.nis.domain.log.NtcOpenVpnLog;
|
||||||
|
import com.nis.domain.maat.LogRecvData;
|
||||||
|
import com.nis.util.httpclient.HttpClientUtil;
|
||||||
|
import com.nis.web.controller.BaseController;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping(value = "${adminPath}/log/ntc/ntcOpenvpnLogs")
|
||||||
|
public class OpenVpnController extends BaseController{
|
||||||
|
|
||||||
|
@RequestMapping(value={"list",""})
|
||||||
|
public String list(Model model,@ModelAttribute("log")NtcOpenVpnLog testEntry,HttpServletRequest request, HttpServletResponse response) throws ClientProtocolException, IOException {
|
||||||
|
|
||||||
|
Page<NtcOpenVpnLog> page = new Page<NtcOpenVpnLog>(request, response);
|
||||||
|
int pageSize = page.getPageSize();
|
||||||
|
int pageNo = page.getPageNo();
|
||||||
|
Map<String, Object> params=new HashMap<>();
|
||||||
|
// String jsonString = HttpClientUtil.getMsg("http://localhost:8080/gwall/view/logs/test",params);
|
||||||
|
|
||||||
|
String readAsString = FileUtil.readAsString(new File("D:/FeigeDownload/logTest.txt"));
|
||||||
|
Gson gson = new GsonBuilder().create();
|
||||||
|
//gson泛型支持
|
||||||
|
LogRecvData<NtcOpenVpnLog> fromJson = gson.fromJson(readAsString, new TypeToken<LogRecvData<NtcOpenVpnLog>>(){}.getType());
|
||||||
|
|
||||||
|
Page<NtcOpenVpnLog> data = fromJson.getData();
|
||||||
|
List<NtcOpenVpnLog> list = data.getList();
|
||||||
|
page.setList(list);
|
||||||
|
page.setCount(data.getCount());
|
||||||
|
model.addAttribute("page", page);
|
||||||
|
logger.info("查询OpenVpn日志成功");
|
||||||
|
return "/log/ntc/openVpnList";
|
||||||
|
}
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String readAsString;
|
||||||
|
try {
|
||||||
|
readAsString = FileUtil.readAsString(new File("D:/FeigeDownload/logTest.txt"));
|
||||||
|
Gson gson = new GsonBuilder().create();
|
||||||
|
//gson泛型支持
|
||||||
|
LogRecvData<NtcOpenVpnLog> fromJson = gson.fromJson(readAsString, new TypeToken<LogRecvData<NtcOpenVpnLog>>(){}.getType());
|
||||||
|
|
||||||
|
Page<NtcOpenVpnLog> page = fromJson.getData();
|
||||||
|
NtcOpenVpnLog object = page.getList().get(0);
|
||||||
|
System.err.println(object.getCfgId());
|
||||||
|
} catch (IOException e) {
|
||||||
|
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -607,4 +607,24 @@ val_direction=The value mast 0(bidirectional) or 1(unidirectional)
|
|||||||
|
|
||||||
#===========log begin=============
|
#===========log begin=============
|
||||||
log=log
|
log=log
|
||||||
|
cfg_id=cfg id
|
||||||
|
found_time=found time
|
||||||
|
recv_time=recvreceive time
|
||||||
|
protocol_type=protocol type
|
||||||
|
addr_type=addr type
|
||||||
|
serverip=server ip
|
||||||
|
clientip=client ip
|
||||||
|
serverport=server port
|
||||||
|
clientport=client port
|
||||||
|
entrance_id=entrance
|
||||||
|
deviceid=device id
|
||||||
|
direct=direction
|
||||||
|
stream_type=stream type
|
||||||
|
clj_ip=processor ip
|
||||||
|
nest_addr_list=nest addr list
|
||||||
|
user_region=user region
|
||||||
|
version=version
|
||||||
|
encrypt_mode=encrypt mode
|
||||||
|
hmac=HMAC
|
||||||
|
tunnel_type=tunnel type
|
||||||
#===========log end =============
|
#===========log end =============
|
||||||
@@ -433,4 +433,24 @@ val_direction=The value mast 0(bidirectional) or 1(unidirectional)
|
|||||||
|
|
||||||
#===========log begin=============
|
#===========log begin=============
|
||||||
log=log
|
log=log
|
||||||
|
cfg_id=cfg id
|
||||||
|
found_time=found time
|
||||||
|
recv_time=recvreceive time
|
||||||
|
protocol_type=protocol type
|
||||||
|
addr_type=addr type
|
||||||
|
serverip=server ip
|
||||||
|
clientip=client ip
|
||||||
|
serverport=server port
|
||||||
|
clientport=client port
|
||||||
|
entrance_id=entrance
|
||||||
|
deviceid=device id
|
||||||
|
direct=direction
|
||||||
|
stream_type=stream type
|
||||||
|
clj_ip=processor ip
|
||||||
|
nest_addr_list=nest addr list
|
||||||
|
user_region=user region
|
||||||
|
version=version
|
||||||
|
encrypt_mode=encrypt mode
|
||||||
|
hmac=HMAC
|
||||||
|
tunnel_type=tunnel type
|
||||||
#===========log end =============
|
#===========log end =============
|
||||||
@@ -633,4 +633,24 @@ val_direction=\u65B9\u5411\u503C\u53EA\u80FD\u4E3A0(bidirectional)\u62161(unidir
|
|||||||
|
|
||||||
#===========log begin=============
|
#===========log begin=============
|
||||||
log=\u65E5\u5FD7
|
log=\u65E5\u5FD7
|
||||||
|
cfg_id=\u914d\u7f6eID
|
||||||
|
found_time=\u53d1\u73b0\u65f6\u95f4
|
||||||
|
recv_time=\u63a5\u6536\u65f6\u95f4
|
||||||
|
protocol_type=\u534f\u8bae\u7c7b\u578b
|
||||||
|
addr_type=ip\u5730\u5740\u7c7b\u578b
|
||||||
|
serverip=\u670d\u52a1\u7aefip\u5730\u5740
|
||||||
|
clientip=\u5ba2\u6237\u7aefip\u5730\u5740
|
||||||
|
serverport=\u670d\u52a1\u7aefip\u7aef\u53e3
|
||||||
|
clientport=\u5ba2\u6237\u7aefip\u7aef\u53e3
|
||||||
|
entrance_id=\u51fa\u5165\u53e3\u7f16\u53f7
|
||||||
|
deviceid=\u4e32\u8054\u8bbe\u5907\u7f16\u53f7
|
||||||
|
direct=\u4f20\u8f93\u65b9\u5411
|
||||||
|
stream_type=\u6d41\u7c7b\u578b
|
||||||
|
clj_ip=\u5904\u7406\u673aIP
|
||||||
|
nest_addr_list=\u5d4c\u5957\u5730\u5740\u5217\u8868
|
||||||
|
user_region=\u7528\u6237\u81ea\u5b9a\u4e49
|
||||||
|
version=\u7248\u672c\u53f7
|
||||||
|
encrypt_mode=\u52a0\u5bc6\u65b9\u5f0f
|
||||||
|
hmac=\u662f\u5426\u6709HMAC
|
||||||
|
tunnel_type=\u901a\u9053\u7c7b\u578b
|
||||||
#===========log end =============
|
#===========log end =============
|
||||||
235
src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp
Normal file
235
src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp
Normal file
@@ -0,0 +1,235 @@
|
|||||||
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){
|
||||||
|
//搜索框提示语初始化
|
||||||
|
if("${log.clientIp}"){
|
||||||
|
$("#intype").val("${log.clientIp}");
|
||||||
|
}else if("${log.serverIp}"){
|
||||||
|
$("#intype").val("${log.serverIp}");
|
||||||
|
}else if("${log.cljIp}"){
|
||||||
|
$("#intype").val("${log.cljIp}");
|
||||||
|
}else if("${log.entranceId}"){
|
||||||
|
$("#intype").val("${log.entranceId}");
|
||||||
|
} else{
|
||||||
|
$("#intype").attr("placeholder","<spring:message code='input'/>"+$("#seltype").find("option:selected").text());
|
||||||
|
}
|
||||||
|
$("#seltype").change(function(){
|
||||||
|
$("#intype").attr("placeholder","<spring:message code='input'/>"+$(this).find("option:selected").text());
|
||||||
|
});
|
||||||
|
//筛选功能
|
||||||
|
filterActionInit();
|
||||||
|
//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",'');
|
||||||
|
$("#intype").attr("placeholder","<spring:message code='input'/>"+$("#seltype").find("option:selected").text());
|
||||||
|
$("#searchForm")[0].reset();
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
//查询
|
||||||
|
function page(n,s){
|
||||||
|
$("#intype").attr("name",$("#seltype").val());
|
||||||
|
$("#pageNo").val(n);
|
||||||
|
$("#pageSize").val(s);
|
||||||
|
$("#searchForm").attr("action","${ctx}/log/ntc/ntcOpenvpnLogs");
|
||||||
|
$("#searchForm").submit();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<h3 class="page-title">
|
||||||
|
OpenVPN
|
||||||
|
<small><spring:message code="date_list"/></small>
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<h5 class="page-header"></h5>
|
||||||
|
<div class="row">
|
||||||
|
<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/ntcOpenvpnLogs" 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="isFilterAction" name="isFilterAction" type="hidden" value="${log.isFilterAction }"/>
|
||||||
|
|
||||||
|
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}" callback="page();"/>
|
||||||
|
|
||||||
|
<!-- 搜索内容与操作按钮栏 -->
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="pull-left">
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-btn">
|
||||||
|
<c:set var="select"><spring:message code='select'/></c:set>
|
||||||
|
<form:select path="protocol" class="selectpicker select2 input-small" data-live-search="true" data-live-search-placeholder="search">
|
||||||
|
<form:option value=""><spring:message code="protocol_type"/></form:option>
|
||||||
|
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="dict">
|
||||||
|
<form:option value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/></form:option>
|
||||||
|
</c:forEach>
|
||||||
|
</form:select>
|
||||||
|
</div></div>
|
||||||
|
</div>
|
||||||
|
<div class="pull-left">
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-btn">
|
||||||
|
<form:select path="direction" class="selectpicker select2 input-small">
|
||||||
|
<form:option value=""><spring:message code="direct"/></form:option>
|
||||||
|
<c:forEach items="${fns:getDictList('DIRECTION')}" var="dict">
|
||||||
|
<form:option value="${dict.itemCode}"><spring:message code="${dict.itemValue}"/></form:option>
|
||||||
|
</c:forEach>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pull-left">
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-btn">
|
||||||
|
<form:select path="seltype" class="selectpicker select2 input-small" >
|
||||||
|
<form:option value="clientIp"><spring:message code="clientip"></spring:message></form:option>
|
||||||
|
<form:option value="serverIp"><spring:message code="serverip"></spring:message></form:option>
|
||||||
|
<form:option value="cljIp"><spring:message code="clj_ip"></spring:message></form:option>
|
||||||
|
<form:option value="entranceId"><spring:message code="entrance_id"></spring:message></form:option>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
<input id="intype" class="form-control input-medium" type="text" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pull-left">
|
||||||
|
<button type="button" class="btn blue" onClick="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"></spring:message> <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-4">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label"><spring:message code="begin_date"/>:</label>
|
||||||
|
<input name="searchFoundStartTime" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||||
|
value="<fmt:formatDate value="${log.searchFoundStartTime}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="form-group">
|
||||||
|
<label><spring:message code="end_date"/>:</label>
|
||||||
|
<input name="searchFoundEndTime" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||||
|
value="<fmt:formatDate value="${log.searchFoundEndTime}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||||
|
</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">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><spring:message code='cfg_id'/></th>
|
||||||
|
<th class="sort-column r.foundTime"><spring:message code='found_time'/></th>
|
||||||
|
<th class="sort-column r.recvTime"><spring:message code='recv_time'/></th>
|
||||||
|
<th><spring:message code='protocol_type'/></th>
|
||||||
|
<th><spring:message code='addr_type'/></th>
|
||||||
|
<th><spring:message code='serverip'/></th>
|
||||||
|
<th><spring:message code='clientip'/></th>
|
||||||
|
<th><spring:message code='serverport'/></th>
|
||||||
|
<th><spring:message code='clientport'/></th>
|
||||||
|
<th><spring:message code='entrance_id'/></th>
|
||||||
|
<th><spring:message code='deviceid'/></th>
|
||||||
|
<th><spring:message code='direct'/></th>
|
||||||
|
<th><spring:message code='stream_type'/></th>
|
||||||
|
<th><spring:message code='clj_ip'/></th>
|
||||||
|
<th><spring:message code='nest_addr_list'/></th>
|
||||||
|
<th><spring:message code='user_region'/></th>
|
||||||
|
<th><spring:message code='version'/></th>
|
||||||
|
<th><spring:message code='encrypt_mode'/></th>
|
||||||
|
<th><spring:message code='hmac'/></th>
|
||||||
|
<th><spring:message code='tunnel_type'/></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<c:forEach items="${page.list}" var="log" varStatus="status" step="1">
|
||||||
|
<tr>
|
||||||
|
<td>${log.cfgId}</td>
|
||||||
|
<td>${log.foundTime}</td>
|
||||||
|
<td>${log.recvTime}</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="dic">
|
||||||
|
<c:if test="${log.protocol==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</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>${log.serverIp}</td>
|
||||||
|
<td>${log.clientIp}</td>
|
||||||
|
<td>${log.serverPort}</td>
|
||||||
|
<td>${log.clientPort}</td>
|
||||||
|
<td>${log.entranceId}</td>
|
||||||
|
<td>${log.deviceId}</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('LOG_DIRECTION')}" var="dic">
|
||||||
|
<c:if test="${log.direction==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('LOG_STREAM_TYPE')}" var="dic">
|
||||||
|
<c:if test="${log.streamType==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td>${log.cljIp}</td>
|
||||||
|
<td>${log.nestAddrList}</td>
|
||||||
|
<td>${log.userRegion}</td>
|
||||||
|
<td>${log.version}</td>
|
||||||
|
<td>${log.encryptMode}</td>
|
||||||
|
<td>${log.hmac}</td>
|
||||||
|
<td>
|
||||||
|
<c:if test="${log.tunnelType==1}">TCP</c:if>
|
||||||
|
<c:if test="${log.tunnelType==2}">UDP"</c:if>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</c:forEach>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div class="page">${page}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user