Authored by qinchao

恶意ip显示bug

... ... @@ -10,6 +10,7 @@ import com.ui.model.BaseResponse;
import com.ui.model.domain.MalIpRule;
import com.ui.model.req.MaliciousIpRecordReq;
import com.ui.model.req.PageRequest;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
... ... @@ -79,6 +80,9 @@ public class MaliciousIpCtrl {
@RequestMapping("/getMaliciousDetection")
@ResponseBody
public BaseResponse getMaliciousDetection(MaliciousIpRecordReq req) {
if(StringUtils.isBlank(req.getIp())){
return null;
}
BaseResponse response = httpClient.defaultPost(HttpUriContants.GET_MIPS_RECORD_FROM_OPS_HBASE, req,
BaseResponse.class);
return response;
... ...
... ... @@ -129,6 +129,27 @@
<script>
$(function () {
refreshTable();
$("#hbaseTable").table({
url: contextPath + "maliciousIp/getMaliciousDetection",
queryParams:{},
dataType: 'json',
striped: true,
pagination: false,
//pageSize: 10,
//sortName: 'count', // 设置默认排序为 name
//sortOrder: 'desc', // 设置排序为反序 desc
panelClass: "panel-success",
loadFilter: function (data) {
return defaultLoadFilter(data);
},
columns: [
{
title: "内容",
field: "reason",
width: "100%"
}]
});
});
function refreshTable() {
... ... @@ -233,33 +254,22 @@
}
$("#hbasePrefix").val(mip+":"+hbaseTime+":");
$("#hbaseTable").table({
url: contextPath + "maliciousIp/getMaliciousDetection",
queryParams:{
ip:mip,
timestamp:hbaseTime,
type:"forbid"
},
dataType: 'json',
striped: true,
pagination: false,
//pageSize: 10,
//sortName: 'count', // 设置默认排序为 name
//sortOrder: 'desc', // 设置排序为反序 desc
panelClass: "panel-success",
loadFilter: function (data) {
return defaultLoadFilter(data);
},
columns: [
{
title: "内容",
field: "reason",
width: "100%"
}]
});
refreshHbaseTable(mip,hbaseTime);
$("#myModal").modal('show');
}
function refreshHbaseTable(mip,hbaseTime) {
$("#hbaseTable").table("loadLoaclData",[]);
var param= {
ip:mip,
timestamp:hbaseTime,
type:"forbid"
};
$("#hbaseTable").table("load", param);
}
function showResons(elememt){
var that = elememt;
var btnText = $(that).attr("value");
... ...