@@ -38,41 +38,75 @@
}
}
$("td[addrPoolId]"). each(function(){
var td = $(this);
var audi t = $(this).attr("audit")
var addrPoolId = $(this).attr("addrPoolId ");
var timeout=$.validator.messages.timeout ;
var failed =$.validator.messages.failed ;
// 判断是否为审核通过状态
if(audit == 1){
$.ajax( {
type:'get',
timeout:10000,// 超时时间
url:'http://192.168.11.137:8090/command/?cmd=IpNumGet&addr_pool_id='+addrPoolId ,
dataType:'json',
async:true ,
success:function(data){
//alert(JSON.stringify(data));
$(td).html(data.num);
},
complete:function(XMLHttpRequest,status){
if(status=="timeout"){
$(td).html(timeout);
}else if(status !="success "){
$(td).html(failed );
var requestUrl = "http://192.168.11.137:8090/command/?cmd=IpNumGet&addr_pool_id=";
//var requestUrl = "https://api.douban.com/v2/book/s ear ch?q=javascript&count=1";
$("td[addrPoolId]").each(function(){
var td = $(this);
var audit = $(this).attr("audit ")
var addrPoolId = $(this).attr("addrPoolId") ;
var timeout =$.validator.messages.timeout ;
var failed=$.validator.messages.failed;
// 判断是否为审核通过状态
if(audit == 1) {
// $.getJSON(requestUrl,function(data,status){});
$.ajax({
type:'get' ,
timeout:15000,// 超时时间
url:requestUrl+addrPoolId ,
dataType:'jsonp',
async:true,
success:function(data,status){
if(status == "success"){
$(td).html(data.num);
}
},
complete:function(XMLHttpRequest,status){
if(status=="timeout "){
$(td).html(timeout );
}else if(status !="success"){
$(td).html(failed);
}
}
}
});
});
}else {
$(td).html(0);
}else {
$(td).html(0);
}
});
}
});
});
function getInfo(obj){
var addrPoolId = $(obj).attr("addrPoolId");
$.ajax({
type:'get',
url:'http://192.168.11.137:8090/command/?cmd=AllIpGet&addr_pool_id='+addrPoolId,
dataType:'jsonp',
async:true,
success:function(data,status){
//var dataArr = [];
var dataArr = data.candidate_ip;
var html = ""
html = "<div style='width:98%;overflow: auto;margin-top: 10px;height: 300px;margin-left: 1%;margin-right: 1%;'>"
html+="<table class='table table-bordered table-condensed text-nowrap' style='width: 100%;'>";
html+="<tbody>";
if(dataArr.length == 0){
html+="<tr>";
html+="<td>( "+"<spring:message code="nothing"/>"+") </td>";
html+="</tr>";
}
for(i=0;i<dataArr.length;i++){
html+="<tr>";
html+="<td>"+dataArr[i]+"</td>";
html+="</tr>";
}
html+="</tbody>";
html+="</table>";
html+="</div>";
top.$.jBox(html,{width: $(document).width()*0.4,height: 380,persistent: false,title:"<spring:message code="available_ip"/>", buttons:{"<spring:message code="close"/>":true}});
}
});
}
</script>
</head>
<body>
@@ -449,7 +483,7 @@
<td>
<!-- <a href="#">新增IP</a>
<a href="#">删除IP</a> -->
<a href="# "><spring:message code="show_detail"/></a>
<a href="javascript:;" onclick="getInfo(this)" addrPoolId="${cfg.addrPoolId } "><spring:message code="show_detail"/></a>
</td>
<td>${cfg.creatorName }</td>
<td><fmt:formatDate value="${cfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>