Authored by qinchao

恶意ip页面bug

... ... @@ -124,7 +124,7 @@
columns: [
{
title: "",
width:"20px",
width:"10%",
field: "ip",
formatter: function (value, rowData, rowIndex) {
var div = $("<div>");
... ... @@ -139,11 +139,11 @@
},
{
title: "ip",
width: "80px",
width: "20%",
field: "ip"
}, {
title: "reason",
width: "120px",
width: "60%",
field: "reasonDur",
styler : function(value, rowData, rowIndex){
return {
... ... @@ -188,7 +188,7 @@
},*/
{
title: "操作",
width: "50px",
width: "10%",
field: "ip",
formatter: function (value, rowData, rowIndex) {
var div = $("<div>");
... ...
... ... @@ -120,14 +120,35 @@
columns: [
{
title: "ip",
width: "100px",
width: "20%",
field: "ip"
},
{
title: "reason",
width: "120px",
width: "60%",
field: "reason",
// align: "left",
align: "left",
formatter:function(value,rowData,rowIndex){
var allReasonDiv = "<div name='allReasonDiv' style='display:none'><a onclick='showResons(this)' style='color:#333;cursor:pointer' value='true' >";
allReasonDiv +=value;
allReasonDiv +="</a></div>";
var simpleReasonDiv = "<div name='simpleReasonDiv'>";
if(value != null && value.length > 0){
simpleReasonDiv += "<a onclick='showResons(this)' style='color:#333;cursor:pointer' value='true' >";
var str_array=value.split("<br>");
for (var i = 0; i < str_array.length; i ++){
if(i <=2 ){
simpleReasonDiv = simpleReasonDiv + str_array[i] + ";&nbsp;&nbsp;&nbsp;";
}
}
simpleReasonDiv+="......</a>";
}
simpleReasonDiv += "</div>";
return simpleReasonDiv + allReasonDiv;
},
styler : function(value, rowData, rowIndex){
return {
"vertical-align" : "middle"
... ... @@ -137,7 +158,7 @@
{
title: "时间",
field: "createTime",
width: "80px",
width: "20%",
formatter:function (value,rowData,rowIndex) {
if(value !=null && value!=""){
return format(value);
... ... @@ -150,6 +171,31 @@
});
}
function showResons(elememt){
var that = elememt;
var btnText = $(that).attr("value");
if("true" == btnText){
var ipsDiv = $(that).closest("tr").find("div[name='simpleReasonDiv']").each(function (index,el) {
$(this).hide();//隐藏当前显示的(仅两个ip)
});
var ipsDiv = $(that).closest("tr").find("div[name='allReasonDiv']").each(function (index,el) {
$(this).show();//显示所有的ips
});
$(that).attr("value","false");
// $(that).text("隐藏详情");
}else{
var ipsDiv = $(that).closest("tr").find("div[name='simpleReasonDiv']").each(function (index,el) {
$(this).show();//隐藏当前显示的(仅两个ip)
});
var ipsDiv = $(that).closest("tr").find("div[name='allReasonDiv']").each(function (index,el) {
$(this).hide();//显示所有的ips
});
$(that).attr("value","true");
// $(that).text("显示详情");
}
}
//timeValue---时间戳
function format(timeValue){
var time = new Date(timeValue);
... ...