diff --git a/src/main/java/com/nis/domain/log/BaseLogEntity.java b/src/main/java/com/nis/domain/log/BaseLogEntity.java index 994373620..9d889236b 100644 --- a/src/main/java/com/nis/domain/log/BaseLogEntity.java +++ b/src/main/java/com/nis/domain/log/BaseLogEntity.java @@ -32,7 +32,7 @@ public class BaseLogEntity extends BaseEntity { //自定义字段 protected String seltype;//选中类型,页面搜索用 protected String searchFoundStartTime;//开始时间,格式为yyyy-mm-dd hh24:mi:ss - protected String searchFoundendTime;//结束时间,格式同上 + protected String searchFoundEndTime;//结束时间,格式同上 public String getSearchFoundStartTime() { @@ -41,11 +41,11 @@ public class BaseLogEntity extends BaseEntity { public void setSearchFoundStartTime(String searchFoundStartTime) { this.searchFoundStartTime = searchFoundStartTime; } - public String getSearchFoundendTime() { - return searchFoundendTime; + public String getSearchFoundEndTime() { + return searchFoundEndTime; } - public void setSearchFoundendTime(String searchFoundendTime) { - this.searchFoundendTime = searchFoundendTime; + public void setSearchFoundEndTime(String searchFoundEndTime) { + this.searchFoundEndTime = searchFoundEndTime; } public String getSeltype() { return seltype; diff --git a/src/main/java/com/nis/web/controller/log/ntc/OpenVpnController.java b/src/main/java/com/nis/web/controller/log/ntc/OpenVpnController.java new file mode 100644 index 000000000..f3ae1a987 --- /dev/null +++ b/src/main/java/com/nis/web/controller/log/ntc/OpenVpnController.java @@ -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 page = new Page(request, response); + int pageSize = page.getPageSize(); + int pageNo = page.getPageNo(); + Map 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 fromJson = gson.fromJson(readAsString, new TypeToken>(){}.getType()); + + Page data = fromJson.getData(); + List 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 fromJson = gson.fromJson(readAsString, new TypeToken>(){}.getType()); + + Page page = fromJson.getData(); + NtcOpenVpnLog object = page.getList().get(0); + System.err.println(object.getCfgId()); + } catch (IOException e) { + + e.printStackTrace(); + } + } + +} diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index eeddee858..b927fd36d 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -607,4 +607,24 @@ val_direction=The value mast 0(bidirectional) or 1(unidirectional) #===========log begin============= 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 ============= \ 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 b0cb6dc71..0ff641048 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -433,4 +433,24 @@ val_direction=The value mast 0(bidirectional) or 1(unidirectional) #===========log begin============= 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 ============= \ 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 5679ac713..fc4aa8ebe 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -633,4 +633,24 @@ val_direction=\u65B9\u5411\u503C\u53EA\u80FD\u4E3A0(bidirectional)\u62161(unidir #===========log begin============= 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 ============= \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp new file mode 100644 index 000000000..71bc42172 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp @@ -0,0 +1,235 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + + + + + +
+

+ OpenVPN + +

+ + +
+
+
+
+
+ + + + + + + + + + +
+
+
+
+ + + + + + + +
+
+
+
+
+ + + + + + +
+
+
+ +
+
+
+ + + + + + +
+ +
+
+ +
+ + + +
+ + +
+ + + +
+
+
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> +
+
+
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
${log.cfgId}${log.foundTime}${log.recvTime} + + + + + + + + ${log.serverIp}${log.clientIp}${log.serverPort}${log.clientPort}${log.entranceId}${log.deviceId} + + + + + + + + ${log.cljIp}${log.nestAddrList}${log.userRegion}${log.version}${log.encryptMode}${log.hmac} + TCP + UDP" +
+
${page}
+
+
+
+
+
+
+ +