diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 3e1905e78..66bdefdd3 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -45,6 +45,7 @@ import com.nis.domain.configuration.NumBoundaryCfg; import com.nis.domain.configuration.RequestInfo; import com.nis.domain.configuration.StringCfgTemplate; import com.nis.domain.log.BaseLogEntity; +import com.nis.domain.log.NtcOpenVpnLog; import com.nis.util.Configurations; //import com.nis.main.ConvertTool; import com.nis.util.Constants; @@ -476,4 +477,43 @@ public class BaseController { List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); model.addAttribute("serviceList", serviceList); } + //初始化查询值判断 + public void initLogSearchValue(BaseLogEntity entry,Map params){ + + if (StringUtils.isNotBlank(entry.getSearchFoundStartTime())&&StringUtils.isNotBlank(entry.getSearchFoundEndTime())) { + params.put("searchFoundStartTime", entry.getSearchFoundStartTime()); + params.put("searchFoundEndTime", entry.getSearchFoundEndTime()); + }else{ + //设置默认查询当前时间及前五分钟 + String startTime = DateUtils.getDateTime(); + Date dateEnd = new Date(new Date().getTime()-Constants.LOG_TIME_RANGE); + String endTime = DateUtils.formatDateTime(dateEnd); + params.put("searchFoundStartTime", startTime); + params.put("searchFoundEndTime",endTime ); + entry.setSearchFoundStartTime(startTime); + entry.setSearchFoundEndTime(endTime); + } + + if (StringUtils.isNotBlank(entry.getProtocol())) { + params.put("searchProtocol", entry.getProtocol()); + } + if (entry.getServiceType()!=null) { + params.put("searchServiceType", entry.getServiceType()); + } + if (StringUtils.isNotBlank(entry.getServerIp())) { + params.put("searchServerIp", entry.getServerIp()); + } + if (StringUtils.isNotBlank(entry.getClientIp())) { + params.put("searchClientIp", entry.getClientIp()); + } + if (StringUtils.isNotBlank(entry.getCljIp())) { + params.put("searchCljIp", entry.getCljIp()); + } + if (entry.getDirection()!=null) { + params.put("searchDirection", entry.getDirection()); + } + if (entry.getEntranceId()!=null) { + params.put("searchEntranceId", entry.getEntranceId()); + } + } } 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 index bb230ead5..68cbc12e6 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/OpenVpnController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/OpenVpnController.java @@ -1,6 +1,5 @@ package com.nis.web.controller.log.ntc; -import java.io.File; import java.io.IOException; import java.util.Date; import java.util.HashMap; @@ -11,7 +10,6 @@ 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; @@ -46,46 +44,16 @@ public class OpenVpnController extends BaseController{ public String list(Model model,@ModelAttribute("log")NtcOpenVpnLog entry,HttpServletRequest request, HttpServletResponse response) throws ClientProtocolException, IOException { try { + //初始化action + initLogServiceType(model, entry); + Page page = new Page(request, response); Map params=new HashMap<>(); params.put("pageSize", page.getPageSize()); params.put("pageNo", page.getPageNo()); + //查询值判断 + initLogSearchValue(entry,params); - if (StringUtils.isNotBlank(entry.getSearchFoundStartTime())&&StringUtils.isNotBlank(entry.getSearchFoundEndTime())) { - params.put("searchFoundStartTime", entry.getSearchFoundStartTime()); - params.put("searchFoundEndTime", entry.getSearchFoundEndTime()); - }else{ - //设置默认查询当前时间及前五分钟 - String startTime = DateUtils.getDateTime(); - Date dateEnd = new Date(new Date().getTime()-Constants.LOG_TIME_RANGE); - String endTime = DateUtils.formatDateTime(dateEnd); - params.put("searchFoundStartTime", startTime); - params.put("searchFoundEndTime",endTime ); - entry.setSearchFoundStartTime(startTime); - entry.setSearchFoundEndTime(endTime); - } - - if (StringUtils.isNotBlank(entry.getProtocol())) { - params.put("searchProtocol", entry.getProtocol()); - } - if (entry.getServiceType()!=null) { - params.put("searchServiceType", entry.getServiceType()); - } - if (StringUtils.isNotBlank(entry.getServerIp())) { - params.put("searchServerIp", entry.getServerIp()); - } - if (StringUtils.isNotBlank(entry.getClientIp())) { - params.put("searchClientIp", entry.getClientIp()); - } - if (StringUtils.isNotBlank(entry.getCljIp())) { - params.put("searchCljIp", entry.getCljIp()); - } - if (entry.getDirection()!=null) { - params.put("searchDirection", entry.getDirection()); - } - if (entry.getEntranceId()!=null) { - params.put("searchEntranceId", entry.getEntranceId()); - } String url = ""; url = Constants.LOG_BASE_URL+Constants.NTC_OPENVPN_LOG; String jsonString = HttpClientUtil.getMsg(url,params); diff --git a/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp index 319dc2b28..dbc1ad923 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/openVpnList.jsp @@ -58,14 +58,26 @@ $(document).ready(function(){
-
-
-
- -
- -
-
+
+
+
+ + + + + + + +
+
+
+ + + + + + +
@@ -78,19 +90,14 @@ $(document).ready(function(){
- -
-
-
- - - - - - - -
-
+
+
+
+ +
+ +
+
@@ -117,7 +124,7 @@ $(document).ready(function(){
-
+
-
+
-
+
- +
-
+
- +
@@ -184,7 +191,7 @@ $(document).ready(function(){ ${log.cfgId} ${log.entranceId} - + @@ -215,7 +222,10 @@ $(document).ready(function(){ ${log.userRegion} ${log.version} ${log.encryptMode} - ${log.hmac} + + + + TCP UDP