Authored by qinchao

恶意ip写入mysql接口及查询页面

... ... @@ -299,6 +299,8 @@ public class HttpUriContants {
* 恶意请求ip
* 获取
*/
public static final String GET_MIPS_RECORD_FROM_OPS_DB = "/maliciousIp/getMaliciousIpRecordList";
public static final String GET_MIPS_FROM_OPS_REIDS = "/maliciousIp/getMipsFromOpsReids";
public static final String DEL_MIPS_FROM_OPS_REDIS = "/maliciousIp/delMipsFromOpsRedis";
public static final String GET_MALICIOUS_IP = "/maliciousIp/getIps";
... ...
... ... @@ -40,6 +40,23 @@ public class MaliciousIpCtrl {
return new ModelAndView("malicious/maliciousIpListNew");
}
@RequestMapping("/toMaliciousIpRecordList")
public ModelAndView toMaliciousIpRecordList(Model model) {
return new ModelAndView("malicious/maliciousIpRecordList");
}
/**
* 从运维系统的mysql获取恶意ip
* @return
*/
@RequestMapping("/getMaliciousIpRecordList")
@ResponseBody
public BaseResponse getMaliciousIpRecordList(PageRequest req) {
BaseResponse response = httpClient.defaultPost(HttpUriContants.GET_MIPS_RECORD_FROM_OPS_DB, req,
BaseResponse.class);
return response;
}
/**
* 从运维系统的redis获取恶意ip
* @return
... ...
... ... @@ -244,7 +244,7 @@
</div>
</div>
</body>
<script src="<%=basePath %>script/common/genarate_left_panel.js?v=20171127-2"></script>
<script src="<%=basePath %>script/common/genarate_left_panel.js?v=20171130"></script>
<script type="text/javascript">
$("#li_dashboard").addClass("active");
</script>
... ...
<%--
Created by IntelliJ IDEA.
User: meiling.ge
Date: 2017/9/21
Time: 16:25
To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=basePath %>css/bootstrap.min.css"/>
<link rel="stylesheet" href="<%=basePath %>css/unicorn.main.css"/>
<link rel="stylesheet" href="<%=basePath %>css/unicorn.grey.css"/>
<link rel="stylesheet" href="<%=basePath %>css/jquery-ui.css"/>
<link rel="stylesheet" href="<%=basePath %>css/bootstrap-responsive.min.css"/>
<link rel="stylesheet" href="<%=basePath %>css/uniform.css"/>
<link rel="stylesheet" href="<%=basePath %>css/select2.css"/>
<script src="<%=basePath %>js/excanvas.min.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jquery-1.12.0.min.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jquery-ui.custom.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>/js/bootstrap.min.js"></script>
<script src="<%=basePath %>/js/unicorn.js"></script>
<script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/moment-with-locales.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/bootstrap-datetimepicker.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/global.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.pagination.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.table.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.dialog.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.panel.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.alerts.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.accordion.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.breadcrumb.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.validate.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/layer/layer.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.select.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jstree/jstree.min.js"></script>
<script src="<%=basePath %>js/jquery.toaster.js"></script>
<script>
var contextPath = '<%=basePath %>';
</script>
<title>YOHO!运维</title>
</head>
<body>
<!-- 头部 -->
<div id="head">
</div>
<!-- 右侧具体内容 -->
<div id="content">
<div id="breadcrumb">
<a href="#" title="Go to Home" class="tip-bottom"><i
class="icon-home"></i> Home</a> <a href="#" class="current">恶意ip记录</a>
</div>
<div class="container-fluid">
<div class="widget-box">
<div class="widget-title">
<h5>恶意ip记录</h5>
</div>
<div class="widget-title" style="height: 56px;">
<div>
<div class="form-inline" role="form" id="inBoxQueryDiv" style=" margin-top: 12px;margin-left: 25px;float: left;">
<%--<div class="input-group" style="float: left">
<input id="timeType" name="timeType" type="hidden" class="form-control" style="width:50px;" value="2" />
<button id="lookIps" class="btn-primary" style="margin-left: 10px;" onclick="refreshTable()">查询
</button>
</div>--%>
</div>
</div>
</div>
<div id="ipTable" style="overflow-y: auto; overflow-x:hidden;max-height: 700px" />
</div>
</div>
</div>
</body>
<script src="<%=basePath %>js/pagination.js"></script>
<script src="<%=basePath %>script/common/genarate_left_panel.js"></script>
<script src="<%=basePath %>js/malicious/maliciousIpFilterList.js"></script>
<script>
$("#li_mip").addClass("active open");
$("#li_malicious_ips_record").addClass("active");
</script>
<script type="text/javascript">
$(function () {
refreshTable();
});
function refreshTable(){
$("#ipTable").table({
url: contextPath + "maliciousIp/getMaliciousIpRecordList",
dataType: 'json',
striped: true,
pagination: true,
pageSize: 10,
//sortName: 'count', // 设置默认排序为 name
//sortOrder: 'desc', // 设置排序为反序 desc
panelClass: "panel-success",
loadFilter: function (data) {
return defaultLoadFilter(data);
},
columns: [
{
title: "ip",
width: "100px",
field: "ip"
},
{
title: "reason",
width: "120px",
field: "reason",
// align: "left",
styler : function(value, rowData, rowIndex){
return {
"vertical-align" : "middle"
};
}
},
{
title: "时间",
field: "createTime",
width: "80px",
formatter:function (value,rowData,rowIndex) {
if(value !=null && value!=""){
return format(value);
}
return value;
}
}]
});
}
//timeValue---时间戳
function format(timeValue){
var time = new Date(timeValue);
var y = time.getFullYear();
var m = time.getMonth()+1;
var d = time.getDate();
var h = time.getHours();
var mm = time.getMinutes();
var s = time.getSeconds();
return y+'-'+add0(m)+'-'+add0(d)+' '+add0(h)+':'+add0(mm)+':'+add0(s);
}
</script>
</html>
... ...
... ... @@ -126,10 +126,11 @@ innerHTML += "<li id='li_yoho_event_taskConfigure'><a id='li_yoho_event_taskConf
innerHTML += "</ul></li>";
/*恶意ip撞库管理*/
innerHTML += "<li class='submenu' id='li_mip'><a id='li_mip_a' href='#'><i class='icon icon-th-list'></i> <span>撞库管理</span><span class='label'>3</span></a>";
innerHTML += "<li class='submenu' id='li_mip'><a id='li_mip_a' href='#'><i class='icon icon-th-list'></i> <span>撞库管理</span><span class='label'>4</span></a>";
innerHTML += "<ul><li id='li_malicious_ip_rules'><a id='li_malicious_ip_rules_a' href=''><i class='icon icon-th'></i> <span>恶意ip规则配置</span></a></li>";
innerHTML += "<li id='li_malicious_ips_new'><a id='li_malicious_ips_a_new' href=''><i class='icon icon-th'></i> <span>恶意ip管理_新</span></a></li>";
innerHTML += "<li id='li_malicious_ips_filter'><a id='li_malicious_ips_filter_a' href=''><i class='icon icon-th'></i> <span>恶意ip过滤集</span></a></li>";
innerHTML += "<li id='li_malicious_record'><a id='li_malicious_ips_record_a' href=''><i class='icon icon-th'></i> <span>恶意ip记录</span></a></li>";
/*innerHTML += "<li id='li_malicious_ips'><a id='li_malicious_ips_a' href=''><i class='icon icon-th'></i> <span>恶意ip管理</span></a></li>";
innerHTML += "<li id='li_malicious_ips_bl'><a id='li_malicious_ips_bl_a' href=''><i class='icon icon-th'></i> <span>恶意ip管理 | 敏感接口比例</span></a></li>";
innerHTML += "<li id='li_malicious_ips_cs'><a id='li_malicious_ips_cs_a' href=''><i class='icon icon-th'></i> <span>恶意ip管理 | 敏感接口次数</span></a></li>";*/
... ... @@ -202,6 +203,7 @@ document.getElementById("li_malicious_ip_rules_a").setAttribute("href", path + "
//document.getElementById("li_malicious_ips_a").setAttribute("href", path + "/maliciousIp/toMaliciousIps");
document.getElementById("li_malicious_ips_a_new").setAttribute("href", path + "/maliciousIp/toMaliciousIpsNew");
document.getElementById("li_malicious_ips_filter_a").setAttribute("href", path + "/maliciousIp/toMaliciousIpFilterList");
document.getElementById("li_malicious_ips_record_a").setAttribute("href", path + "/maliciousIp/toMaliciousIpRecordList");
//document.getElementById("li_malicious_ips_bl_a").setAttribute("href", path + "/maliciousIp/toMaliciousIpsBL");
//document.getElementById("li_malicious_ips_cs_a").setAttribute("href", path + "/maliciousIp/toMaliciousIpsCS");
... ...