Authored by qinchao

恶意ip接口

... ... @@ -13,4 +13,5 @@ public class MaliciousIpRecordReq extends PageRequest {
private String ip;
private String type;
private long timestamp;
private String cloudType;
}
... ...
... ... @@ -94,8 +94,8 @@ public class MaliciousIpCtrl {
*/
@RequestMapping("/getMipsFromOpsReids")
@ResponseBody
public BaseResponse<List<Object>> getMipsFromOpsReids() {
BaseResponse<List<Object>> response = httpClient.defaultPost(HttpUriContants.GET_MIPS_FROM_OPS_REIDS, null,
public BaseResponse<List<Object>> getMipsFromOpsReids(MaliciousIpRecordReq req) {
BaseResponse<List<Object>> response = httpClient.defaultPost(HttpUriContants.GET_MIPS_FROM_OPS_REIDS, req,
BaseResponse.class);
return response;
}
... ...
... ... @@ -233,6 +233,8 @@
url: contextPath + "maliciousIp/getMipsFromOpsReids",
dataType: 'json',
striped: true,
pagination: true,
pageSize: 10,
panelClass: "panel-success",
loadFilter: function (data) {
return defaultLoadFilter(data);
... ... @@ -260,7 +262,7 @@
}, {
title: "reason",
width: "30%",
field: "reasonDur",
field: "reason",
styler : function(value, rowData, rowIndex){
return {
"vertical-align" : "middle"
... ... @@ -296,9 +298,15 @@
field: "dur"
},
{
title: "时间",
title: "createtime",
width: "15%",
field: "time"
field: "createTime",
formatter:function (value,rowData,rowIndex) {
if(value !=null && value!=""){
return format(value);
}
return value;
}
},
{
title: "操作",
... ... @@ -449,4 +457,19 @@
}
removeMips(listip);
}
//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);
}
function add0(m){
return m<10 ? '0'+m : m;
}
</script>
\ No newline at end of file
... ...
... ... @@ -313,8 +313,6 @@
return format(value);
}
return value;
}
},{
title: "status",
... ... @@ -341,28 +339,29 @@
$("<button onclick=\"fobidMip(\'" + rowData.ip + "\')\">").addClass("btn btn-xs btn-success").html("封杀").appendTo(div);
}
div.append("&nbsp;");
$("<button onclick=\"qpsDetailMip(\'" + rowData.ip +"\'"+ ","+"\'"+rowData.hbaseTime+"\')\">").addClass("btn btn-xs btn-info").html("详情").appendTo(div);
$("<button onclick=\"qpsDetailMip(\'" + rowData.ip +"\'"+ ","+"\'"+rowData.hbaseTime+"\'"+ ","+"\'"+rowData.hbaseSource+"\')\">").addClass("btn btn-xs btn-info").html("详情").appendTo(div);
return div;
}
}]
});
}
function qpsDetailMip(mip,hbaseTime){
function qpsDetailMip(mip,hbaseTime,hbaseSource){
if(!hbaseTime){
hbaseTime=0;
}
$("#hbasePrefix").val(mip+":"+hbaseTime+":");
refreshHbaseTable(mip,hbaseTime);
$("#hbasePrefix").val(hbaseSource+" "+mip+":"+hbaseTime+":");
refreshHbaseTable(mip,hbaseTime,hbaseSource);
$("#myModal").modal('show');
}
function refreshHbaseTable(mip,hbaseTime){
function refreshHbaseTable(mip,hbaseTime,hbaseSource){
$("#hbaseTable").table("loadLoaclData",[]);
var param={
ip:mip,
timestamp:hbaseTime,
cloudType:hbaseSource,
type:"alarm"
};
... ...