diff --git a/src/main/java/com/nis/domain/dashboard/codedic/CodeAppDic.java b/src/main/java/com/nis/domain/dashboard/codedic/CodeAppDic.java index a20996933..bcfa43455 100644 --- a/src/main/java/com/nis/domain/dashboard/codedic/CodeAppDic.java +++ b/src/main/java/com/nis/domain/dashboard/codedic/CodeAppDic.java @@ -1,7 +1,14 @@ package com.nis.domain.dashboard.codedic; -public class CodeAppDic { - private Integer id; +import java.io.Serializable; + +public class CodeAppDic implements Serializable { + /** + * + */ + private static final long serialVersionUID = 8878203808371459079L; + + private Integer id; private String appName; diff --git a/src/main/java/com/nis/domain/dashboard/codedic/CodeBehaviorTypeDic.java b/src/main/java/com/nis/domain/dashboard/codedic/CodeBehaviorTypeDic.java index a57814479..585325b32 100644 --- a/src/main/java/com/nis/domain/dashboard/codedic/CodeBehaviorTypeDic.java +++ b/src/main/java/com/nis/domain/dashboard/codedic/CodeBehaviorTypeDic.java @@ -1,7 +1,14 @@ package com.nis.domain.dashboard.codedic; -public class CodeBehaviorTypeDic { - private Integer id; +import java.io.Serializable; + +public class CodeBehaviorTypeDic implements Serializable { + /** + * + */ + private static final long serialVersionUID = -3093079166837898180L; + + private Integer id; private String behaviorType; diff --git a/src/main/java/com/nis/domain/dashboard/codedic/CodeBrowserTypeDic.java b/src/main/java/com/nis/domain/dashboard/codedic/CodeBrowserTypeDic.java index 04c62dd8f..2702fc247 100644 --- a/src/main/java/com/nis/domain/dashboard/codedic/CodeBrowserTypeDic.java +++ b/src/main/java/com/nis/domain/dashboard/codedic/CodeBrowserTypeDic.java @@ -1,7 +1,14 @@ package com.nis.domain.dashboard.codedic; -public class CodeBrowserTypeDic { - private Integer id; +import java.io.Serializable; + +public class CodeBrowserTypeDic implements Serializable { + /** + * + */ + private static final long serialVersionUID = -2134192971712765277L; + + private Integer id; private String browserType; diff --git a/src/main/java/com/nis/domain/dashboard/codedic/CodeOsTypeDic.java b/src/main/java/com/nis/domain/dashboard/codedic/CodeOsTypeDic.java index 86d4c507b..0422ffb7b 100644 --- a/src/main/java/com/nis/domain/dashboard/codedic/CodeOsTypeDic.java +++ b/src/main/java/com/nis/domain/dashboard/codedic/CodeOsTypeDic.java @@ -1,7 +1,14 @@ package com.nis.domain.dashboard.codedic; -public class CodeOsTypeDic { - private Integer id; +import java.io.Serializable; + +public class CodeOsTypeDic implements Serializable { + /** + * + */ + private static final long serialVersionUID = 3130292317922505634L; + + private Integer id; private String osType; diff --git a/src/main/java/com/nis/domain/dashboard/codedic/CodeProtocolTypeDic.java b/src/main/java/com/nis/domain/dashboard/codedic/CodeProtocolTypeDic.java index a671ae85b..c7dd9021b 100644 --- a/src/main/java/com/nis/domain/dashboard/codedic/CodeProtocolTypeDic.java +++ b/src/main/java/com/nis/domain/dashboard/codedic/CodeProtocolTypeDic.java @@ -1,7 +1,14 @@ package com.nis.domain.dashboard.codedic; -public class CodeProtocolTypeDic { - private Integer id; +import java.io.Serializable; + +public class CodeProtocolTypeDic implements Serializable { + /** + * + */ + private static final long serialVersionUID = 4918506981012927864L; + + private Integer id; private String protocolType; diff --git a/src/main/java/com/nis/domain/dashboard/codedic/CodeServiceTypeDic.java b/src/main/java/com/nis/domain/dashboard/codedic/CodeServiceTypeDic.java index 4b4588685..d599dd426 100644 --- a/src/main/java/com/nis/domain/dashboard/codedic/CodeServiceTypeDic.java +++ b/src/main/java/com/nis/domain/dashboard/codedic/CodeServiceTypeDic.java @@ -1,7 +1,14 @@ package com.nis.domain.dashboard.codedic; -public class CodeServiceTypeDic { - private Integer id; +import java.io.Serializable; + +public class CodeServiceTypeDic implements Serializable { + /** + * + */ + private static final long serialVersionUID = 4684291961768554944L; + + private Integer id; private String serviceType; diff --git a/src/main/java/com/nis/domain/dashboard/codedic/CodeWebServiceDic.java b/src/main/java/com/nis/domain/dashboard/codedic/CodeWebServiceDic.java index d99624362..f0ed0f2b2 100644 --- a/src/main/java/com/nis/domain/dashboard/codedic/CodeWebServiceDic.java +++ b/src/main/java/com/nis/domain/dashboard/codedic/CodeWebServiceDic.java @@ -1,7 +1,14 @@ package com.nis.domain.dashboard.codedic; -public class CodeWebServiceDic { - private Integer id; +import java.io.Serializable; + +public class CodeWebServiceDic implements Serializable { + /** + * + */ + private static final long serialVersionUID = 3695848998373942822L; + + private Integer id; private String website; diff --git a/src/main/java/com/nis/domain/log/NtcAppLog.java b/src/main/java/com/nis/domain/log/NtcAppLog.java new file mode 100644 index 000000000..6ea1a9838 --- /dev/null +++ b/src/main/java/com/nis/domain/log/NtcAppLog.java @@ -0,0 +1,11 @@ +package com.nis.domain.log; + +public class NtcAppLog extends BaseLogEntity { + + /** + * + */ + private static final long serialVersionUID = 6025543701060412591L; + + +} diff --git a/src/main/java/com/nis/domain/log/NtcDdosLog.java b/src/main/java/com/nis/domain/log/NtcDdosLog.java new file mode 100644 index 000000000..32ccf19a1 --- /dev/null +++ b/src/main/java/com/nis/domain/log/NtcDdosLog.java @@ -0,0 +1,81 @@ +package com.nis.domain.log; + +import java.util.Date; + +import com.wordnik.swagger.annotations.ApiModelProperty; + +public class NtcDdosLog extends BaseLogEntity { + + /** + * + */ + private static final long serialVersionUID = 9080132009178985910L; + + @ApiModelProperty(value = "攻击类型", required = true) + protected Integer attackType; + @ApiModelProperty(value = "攻击起始时间", required = true) + protected Date attackStartTime; + @ApiModelProperty(value = "最后一次攻击包时间", required = true) + protected Date lastAttackTime; + @ApiModelProperty(value = "攻击最大流量, 包数/秒", required = true) + protected String attackMaxPps; + @ApiModelProperty(value = "攻击最大流量, bit数/秒", required = true) + protected String attackMaxBps; + @ApiModelProperty(value = "攻击累积包数", required = true) + protected String attackTotalPkt; + @ApiModelProperty(value = "攻击累积字节数", required = true) + protected String attackTotalByte; + @ApiModelProperty(value = "攻击流量是否被丢弃", required = true) + protected Integer isBlcok; + + + public Integer getAttackType() { + return attackType; + } + public void setAttackType(Integer attackType) { + this.attackType = attackType; + } + public Date getAttackStartTime() { + return attackStartTime; + } + public void setAttackStartTime(Date attackStartTime) { + this.attackStartTime = attackStartTime; + } + public Date getLastAttackTime() { + return lastAttackTime; + } + public void setLastAttackTime(Date lastAttackTime) { + this.lastAttackTime = lastAttackTime; + } + public String getAttackMaxPps() { + return attackMaxPps; + } + public void setAttackMaxPps(String attackMaxPps) { + this.attackMaxPps = attackMaxPps; + } + public String getAttackMaxBps() { + return attackMaxBps; + } + public void setAttackMaxBps(String attackMaxBps) { + this.attackMaxBps = attackMaxBps; + } + public String getAttackTotalPkt() { + return attackTotalPkt; + } + public void setAttackTotalPkt(String attackTotalPkt) { + this.attackTotalPkt = attackTotalPkt; + } + public String getAttackTotalByte() { + return attackTotalByte; + } + public void setAttackTotalByte(String attackTotalByte) { + this.attackTotalByte = attackTotalByte; + } + public Integer getIsBlcok() { + return isBlcok; + } + public void setIsBlcok(Integer isBlcok) { + this.isBlcok = isBlcok; + } + +} diff --git a/src/main/java/com/nis/util/CodeDicUtils.java b/src/main/java/com/nis/util/CodeDicUtils.java index 54e6b1a43..580042d61 100644 --- a/src/main/java/com/nis/util/CodeDicUtils.java +++ b/src/main/java/com/nis/util/CodeDicUtils.java @@ -2,7 +2,6 @@ package com.nis.util; import java.util.ArrayList; import java.util.List; -import org.springframework.stereotype.Service; import com.nis.domain.dashboard.codedic.CodeAppDic; import com.nis.domain.dashboard.codedic.CodeBehaviorTypeDic; @@ -20,7 +19,7 @@ import com.nis.web.dao.dashboard.codedic.CodeResult; import com.nis.web.dao.dashboard.codedic.CodeServiceTypeDicDao; import com.nis.web.dao.dashboard.codedic.CodeWebServiceDicDao; import com.nis.web.service.SpringContextHolder; -@Service + public class CodeDicUtils { private final static CodeAppDicDao codeAppDicDao = SpringContextHolder.getBean(CodeAppDicDao.class); private final static CodeBehaviorTypeDicDao codeBehaviorTypeDicDao = SpringContextHolder.getBean(CodeBehaviorTypeDicDao.class); diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index 6c74e7fbf..d2d7c1a10 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -366,6 +366,8 @@ public final class Constants { public static final String NTC_SSH_LOG = Configurations.getStringProperty("ntcSshLog",""); public static final String NTC_MAIL_LOG = Configurations.getStringProperty("ntcMailLog",""); public static final String NTC_FTP_LOG = Configurations.getStringProperty("ntcFtpLog",""); + public static final String NTC_APP_LOG = Configurations.getStringProperty("ntcAppLog", ""); + public static final String NTC_DDOS_LOG = Configurations.getStringProperty("ntcDdosLog", ""); //报表类型,1- 配置命中总量业务 public static final Integer BUSINESSTYPE_CONFIG=Configurations.getIntProperty("businesstype_config", 1); //报表类型,2- 配置报表业务 diff --git a/src/main/java/com/nis/web/controller/dashboard/DashboardServiceController.java b/src/main/java/com/nis/web/controller/dashboard/DashboardServiceController.java new file mode 100644 index 000000000..80bd0c9fe --- /dev/null +++ b/src/main/java/com/nis/web/controller/dashboard/DashboardServiceController.java @@ -0,0 +1,188 @@ +package com.nis.web.controller.dashboard; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; + +import com.google.gson.Gson; +import com.nis.util.JsonMapper; +import com.nis.web.controller.BaseController; +import com.nis.web.service.dashboard.DashboardService; +import com.wordnik.swagger.annotations.Api; +import com.wordnik.swagger.annotations.ApiOperation; +@SuppressWarnings({ "rawtypes", "unchecked" }) +@RestController +@RequestMapping(value = "${servicePath}/log/v1") +@Api(value = "DashboardServiceController", description = "首页图表基本服务接口") +public class DashboardServiceController extends BaseController{ + + @Autowired + public DashboardService dashboardService; + + /** + * 协议统计 + */ + @RequestMapping(value="trafficProtocol", method = RequestMethod.GET) + @ApiOperation(value = "协议统计", httpMethod = "GET", notes = "对应协议统计实时统计查询服务。") + public String trafficProtocol(){ + dashboardService.systemList(); + + Map map = new HashMap(); + try { + List ipActiveChart = dashboardService.protocolChart(); + if (ipActiveChart.size() > 0) { + String jsonString = JsonMapper.toJsonString(ipActiveChart); + List list = (java.util.List) JsonMapper.fromJsonList(jsonString, + HashMap.class); + map.put("data", list); + logger.info(list); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error(e); + } + return JsonMapper.toJsonString(map); + } + + + /** + * 活跃IP TOP10 + */ + @RequestMapping(value = "trafficIpActive", method = RequestMethod.GET) + @ApiOperation(value = "活跃IP统计", httpMethod = "GET", notes = "对应活跃IP实时统计查询服务。") + public String trafficIpActive(/*Model model, HttpServletRequest request, + HttpServletResponse response*/) { + + Map map = new LinkedHashMap(); + try { + List ipActiveChart = dashboardService.ipActiveChart(); + if (ipActiveChart.size() > 0) { + String jsonString = JsonMapper.toJsonString(ipActiveChart); + ArrayList list = (ArrayList) JsonMapper.fromJsonList(jsonString, + LinkedHashMap.class); + map.put("data", list); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error(e); + } + String jsonString = JsonMapper.toJsonString(map); + return jsonString; + } + /** + * app流量分析 TOP10 + */ + @RequestMapping(value = "trafficApp", method = RequestMethod.GET) + @ApiOperation(value = "app流量分析统计", httpMethod = "GET", notes = "对应app流量分析实时统计查询服务。") + public String trafficApp(/*Model model, HttpServletRequest request, + HttpServletResponse response*/) { + + Map map = new HashMap(); + try { + List appChart = dashboardService.appChart(); + if (appChart.size() > 0) { + String jsonString = JsonMapper.toJsonString(appChart); + List list = (java.util.List) JsonMapper.fromJsonList(jsonString, + HashMap.class); + map.put("data", list); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error(e); + } + return JsonMapper.toJsonString(map); + } + @RequestMapping(value = "trafficOsList", method = RequestMethod.GET) + @ApiOperation(value = "操作系统流量分析统计", httpMethod = "GET", notes = "对应终端用户的操作系统列表显示") + public String trafficOsList(/*,Model model, HttpServletRequest request, + HttpServletResponse response*/) { + + Map map = new HashMap(); + try { + List osChart = dashboardService.systemList(); + if (osChart.size() > 0) { + String jsonString = JsonMapper.toJsonString(osChart); + List list = (java.util.List) JsonMapper.fromJsonList(jsonString, + HashMap.class); + map.put("data", list); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error(e); + } + return JsonMapper.toJsonString(map); + } + @RequestMapping(value = "trafficBrowserChart", method = RequestMethod.GET) + @ApiOperation(value = "操作系统下浏览器流量分析统计", httpMethod = "GET", notes = "对应终端用户某个操作系统的浏览器分类统计显示") + public String trafficBrowserChart(Integer osType/*,Model model, HttpServletRequest request, + HttpServletResponse response*/) { + + Map map = new HashMap(); + try { + List osChart = dashboardService.getBrowserBySystem(osType); + if (osChart.size() > 0) { + String jsonString = JsonMapper.toJsonString(osChart); + List list = (java.util.List) JsonMapper.fromJsonList(jsonString, + HashMap.class); + map.put("data", list); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error(e); + } + return JsonMapper.toJsonString(map); + } + @RequestMapping(value = "trafficBsList", method = RequestMethod.GET) + @ApiOperation(value = "浏览器流量分析统计", httpMethod = "GET", notes = "对应终端用户的浏览器列表显示") + public String trafficBsList(/*,Model model, HttpServletRequest request, + HttpServletResponse response*/) { + + Map map = new HashMap(); + try { + List bsChart = dashboardService.browserList(); + if (bsChart.size() > 0) { + String jsonString = JsonMapper.toJsonString(bsChart); + List list = (java.util.List) JsonMapper.fromJsonList(jsonString, + HashMap.class); + map.put("data", list); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error(e); + } + return JsonMapper.toJsonString(map); + } + @RequestMapping(value = "trafficSystemChart", method = RequestMethod.GET) + @ApiOperation(value = "浏览器下操作系统流量分析统计", httpMethod = "GET", notes = "对应终端用户某个浏览器的操作系统分类统计显示") + public String trafficSystemChart(Integer bsType/*,Model model, HttpServletRequest request, + HttpServletResponse response*/) { + + Map map = new HashMap(); + try { + List bsChart = dashboardService.getSystemBybrowser(bsType); + if (bsChart.size() > 0) { + String jsonString = JsonMapper.toJsonString(bsChart); + List list = (java.util.List) JsonMapper.fromJsonList(jsonString, + HashMap.class); + map.put("data", list); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error(e); + } + return JsonMapper.toJsonString(map); + } +} diff --git a/src/main/java/com/nis/web/controller/log/ntc/AppLogController.java b/src/main/java/com/nis/web/controller/log/ntc/AppLogController.java new file mode 100644 index 000000000..d08c120c7 --- /dev/null +++ b/src/main/java/com/nis/web/controller/log/ntc/AppLogController.java @@ -0,0 +1,81 @@ +package com.nis.web.controller.log.ntc; + +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.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 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.NtcAppLog; +import com.nis.domain.maat.LogRecvData; +import com.nis.util.Constants; +import com.nis.util.httpclient.HttpClientUtil; +import com.nis.web.controller.BaseController; + +@Controller +@RequestMapping(value = "${adminPath}/log/ntc/ntcAppLogs") +public class AppLogController extends BaseController{ + + /** + * @param model + * @param entry + * @param request + * @param response + * @return + * @throws ClientProtocolException + * @throws IOException + */ + @RequestMapping(value={"list",""}) + public String list(Model model,@ModelAttribute("log")NtcAppLog entry,HttpServletRequest request, HttpServletResponse response) throws ClientProtocolException, IOException { + + try { + + Page page = new Page(request, response); + Map params=new HashMap<>(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + //查询值判断 + initLogSearchValue(entry,params); + + String url = ""; + url = Constants.LOG_BASE_URL+Constants.NTC_APP_LOG; + String jsonString = HttpClientUtil.getMsg(url,params,request); + + Gson gson = new GsonBuilder().create(); + //gson泛型支持 + LogRecvData fromJson = gson.fromJson(jsonString, new TypeToken>(){}.getType()); + + if (fromJson.getStatus().intValue() == 200) { +// BeanUtils.copyProperties(fromJson.getData(), page); + Page data = fromJson.getData(); + page.setCount(200); + page.setList(data.getList()); + List list = page.getList(); + for (NtcAppLog l : list) { + l.setFunctionId(entry.getFunctionId()); + setLogAction(l); + } + model.addAttribute("page", page); + logger.info("查询App日志成功"); + } + } catch (Exception e) { + logger.info("查询App日志失败", e); + addMessage(model, e.getMessage()); + } + return "/log/ntc/appList"; + } + +} diff --git a/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java b/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java new file mode 100644 index 000000000..802da000d --- /dev/null +++ b/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java @@ -0,0 +1,80 @@ +package com.nis.web.controller.log.ntc; + +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.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.NtcDdosLog; +import com.nis.domain.maat.LogRecvData; +import com.nis.util.Constants; +import com.nis.util.httpclient.HttpClientUtil; +import com.nis.web.controller.BaseController; + +@Controller +@RequestMapping(value = "${adminPath}/log/ntc/ntcDdosLogs") +public class DdosLogController extends BaseController{ + + /** + * @param model + * @param entry + * @param request + * @param response + * @return + * @throws ClientProtocolException + * @throws IOException + */ + @RequestMapping(value={"list",""}) + public String list(Model model,@ModelAttribute("log")NtcDdosLog entry,HttpServletRequest request, HttpServletResponse response) throws ClientProtocolException, IOException { + + try { + + Page page = new Page(request, response); + Map params=new HashMap<>(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + //查询值判断 + initLogSearchValue(entry,params); + + String url = ""; + url = Constants.LOG_BASE_URL+Constants.NTC_DDOS_LOG; + String jsonString = HttpClientUtil.getMsg(url,params,request); + + Gson gson = new GsonBuilder().create(); + //gson泛型支持 + LogRecvData fromJson = gson.fromJson(jsonString, new TypeToken>(){}.getType()); + + if (fromJson.getStatus().intValue() == 200) { +// BeanUtils.copyProperties(fromJson.getData(), page); + Page data = fromJson.getData(); + page.setCount(200); + page.setList(data.getList()); + List list = page.getList(); + for (NtcDdosLog l : list) { + l.setFunctionId(entry.getFunctionId()); + setLogAction(l); + } + model.addAttribute("page", page); + logger.info("查询Ddos日志成功"); + } + } catch (Exception e) { + logger.info("查询Ddos日志失败", e); + addMessage(model, e.getMessage()); + } + return "/log/ntc/ddosList"; + } + +} diff --git a/src/main/java/com/nis/web/controller/log/ntc/FtpController.java b/src/main/java/com/nis/web/controller/log/ntc/FtpLogController.java similarity index 94% rename from src/main/java/com/nis/web/controller/log/ntc/FtpController.java rename to src/main/java/com/nis/web/controller/log/ntc/FtpLogController.java index 9ca44495b..934bbd931 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/FtpController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/FtpLogController.java @@ -27,7 +27,7 @@ import com.nis.web.controller.BaseController; @Controller @RequestMapping(value = "${adminPath}/log/ntc/NtcFtpLogs") -public class FtpController extends BaseController{ +public class FtpLogController extends BaseController{ /** * @param model diff --git a/src/main/java/com/nis/web/controller/log/ntc/IpsecController.java b/src/main/java/com/nis/web/controller/log/ntc/IpsecLogController.java similarity index 94% rename from src/main/java/com/nis/web/controller/log/ntc/IpsecController.java rename to src/main/java/com/nis/web/controller/log/ntc/IpsecLogController.java index e8ab8a476..90de63189 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/IpsecController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/IpsecLogController.java @@ -28,7 +28,7 @@ import com.nis.web.controller.BaseController; @Controller @RequestMapping(value = "${adminPath}/log/ntc/ntcIpsecLogs") -public class IpsecController extends BaseController{ +public class IpsecLogController extends BaseController{ /** * @param model diff --git a/src/main/java/com/nis/web/controller/log/ntc/LogChartController.java b/src/main/java/com/nis/web/controller/log/ntc/LogChartController.java deleted file mode 100644 index 6bb5118c7..000000000 --- a/src/main/java/com/nis/web/controller/log/ntc/LogChartController.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.nis.web.controller.log.ntc; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -import com.nis.web.controller.BaseController; -@Controller -@RequestMapping(value = "/log") -public class LogChartController extends BaseController{ - @RequestMapping(value="logChart") - public String logChart(){ - - return "/log/chart"; - } - @RequestMapping(value="ajaxChart") - @ResponseBody - public String ajaxChart(){ - - return ""; - } -} diff --git a/src/main/java/com/nis/web/controller/log/ntc/OpenVpnController.java b/src/main/java/com/nis/web/controller/log/ntc/OpenVpnLogController.java similarity index 88% rename from src/main/java/com/nis/web/controller/log/ntc/OpenVpnController.java rename to src/main/java/com/nis/web/controller/log/ntc/OpenVpnLogController.java index 4bfa47265..ecad610e9 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/OpenVpnController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/OpenVpnLogController.java @@ -28,7 +28,7 @@ import com.nis.web.controller.BaseController; @Controller @RequestMapping(value = "${adminPath}/log/ntc/ntcOpenvpnLogs") -public class OpenVpnController extends BaseController{ +public class OpenVpnLogController extends BaseController{ /** * @param model @@ -60,7 +60,10 @@ public class OpenVpnController extends BaseController{ LogRecvData fromJson = gson.fromJson(jsonString, new TypeToken>(){}.getType()); if (fromJson.getStatus().intValue() == 200) { - BeanUtils.copyProperties(fromJson.getData(), page); +// BeanUtils.copyProperties(fromJson.getData(), page); + Page data = fromJson.getData(); + page.setCount(200); + page.setList(data.getList()); List list = page.getList(); for (NtcOpenVpnLog l : list) { l.setFunctionId(entry.getFunctionId()); diff --git a/src/main/java/com/nis/web/controller/log/ntc/SshController.java b/src/main/java/com/nis/web/controller/log/ntc/SshLogController.java similarity index 94% rename from src/main/java/com/nis/web/controller/log/ntc/SshController.java rename to src/main/java/com/nis/web/controller/log/ntc/SshLogController.java index f42004fdc..d6e01741f 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/SshController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/SshLogController.java @@ -28,7 +28,7 @@ import com.nis.web.controller.BaseController; @Controller @RequestMapping(value = "${adminPath}/log/ntc/ntcSshLogs") -public class SshController extends BaseController{ +public class SshLogController extends BaseController{ /** * @param model diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 1932a5773..35bb9756e 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -713,6 +713,14 @@ data_tunnel=Data Tuunel contrl_message=Control Message data_message=Data Message user_name=User Name +attack_type=Attack Type +attack_start_time=Attack Start Time +last_attack_time=Last Attack Time +attack_max_pps=Attack Max Pps num/s +attack_max_bps=Attack Max Bps bit/s +attack_total_pkt=Attack Total pkt +attack_total_byte=Attack Total byte +is_blcok=Is Blcok #===========log end ============= #=============about proxy========= intercept_policy=Intercept Policy diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 57d2a4a25..aced402f8 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -664,6 +664,14 @@ data_tunnel=data tunnel contrl_message=contrl message data_message=data message user_name=user name +attack_type=Attack Type +attack_start_time=Attack Start Time +last_attack_time=Last Attack Time +attack_max_pps=Attack Max Pps num/s +attack_max_bps=Attack Max Bps bit/s +attack_total_pkt=Attack Total pkt +attack_total_byte=Attack Total byte +is_blcok=Is Blcok #===========log end ============= #=============about proxy========= intercept_policy=intercept policy diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index 040df42fd..375fae086 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -710,6 +710,14 @@ data_tunnel=\u6570\u636E\u901A\u9053 contrl_message=\u63A7\u5236\u62A5\u6587 data_message=\u6570\u636E\u62A5\u6587 user_name=\u7528\u6237\u540D\u79F0 +attack_type=\u653B\u51FB\u7C7B\u578B +attack_start_time=\u653B\u51FB\u8D77\u59CB\u65F6\u95F4 +last_attack_time=\u6700\u540E\u4E00\u6B21\u653B\u51FB\u5305\u65F6\u95F4 +attack_max_pps=\u653B\u51FB\u6700\u5927\u6D41\u91CF \u5305\u6570/\u79D2 +attack_max_bps=\u653B\u51FB\u6700\u5927\u6D41\u91CF bit\u6570/\u79D2 +attack_total_pkt=\u653B\u51FB\u7D2F\u79EF\u5305\u6570 +attack_total_byte=\u653B\u51FB\u7D2F\u79EF\u5B57\u8282\u6570 +is_blcok=\u653B\u51FB\u6D41\u91CF\u662F\u5426\u88AB\u4E22\u5F03 #===========log end ============= #=============about proxy========= intercept_policy=\u62E6\u622A\u7B56\u7565 diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index caa632ee4..a0d799891 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -241,6 +241,8 @@ ntcIpsecLog=ntcIpsecLogs ntcSshLog=ntcSshLogs ntcMailLog=ntcMailLogs ntcFtpLog=ntcFtpLogs +ntcAppLog=ntcAppLogs +ntcDdosLog=ntcDdosLogs client_connect_timeout=300000 client_read_timeout=300000 diff --git a/src/main/webapp/WEB-INF/views/log/ntc/appList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/appList.jsp new file mode 100644 index 000000000..ff8f5a161 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/log/ntc/appList.jsp @@ -0,0 +1,234 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + + + + +
+

+ APP + +

+ + +
+
+
+
+
+ + + + + + + + + + +
+
+ + + + + +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+ +
+ + + +
+ + +
+ + +
+
+
+
+ + + + + + + + +
+
+ +
+
+ + + + + + + +
+
+
+
+ + +
+
+
+
+ + + + + + + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
${log.cfgId}${log.entranceId} + + + + + + + ${log.foundTime}${log.recvTime}${log.transProto} + + + + ${log.dIp}${log.sIp}${log.dPort}${log.sPort}${log.deviceId} + + + + ${log.capIp}${log.addrList}${log.userRegion}
+
${page}
+
+
+
+
+
+
+ + diff --git a/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp new file mode 100644 index 000000000..c1109e513 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp @@ -0,0 +1,252 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + + + + +
+

+ DDOS + +

+ + +
+
+
+
+
+ + + + + + + + + + +
+
+ + + + + +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+ +
+ + + +
+ + +
+ + +
+
+
+
+ + + + + + + + +
+
+ +
+
+ + + + + + + +
+
+
+
+ + +
+
+
+
+ + + + + + + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
${log.cfgId}${log.entranceId} + + + + + + + ${log.foundTime}${log.recvTime}${log.transProto} + + + + ${log.dIp}${log.sIp}${log.dPort}${log.sPort}${log.deviceId} + + + + ${log.capIp}${log.addrList}${log.userRegion}${log.attackType}${log.attackStartTime}${log.lastAttackTime}${log.attackMaxPps}${log.attackMaxBps}${log.attackTotalPkt}${log.attackTotalByte}${log.isBlcok}
+
${page}
+
+
+
+
+
+
+ +