Merge branch 'develop' of http://192.168.10.125/k18_web/NFS.git into develop

This commit is contained in:
DuanDongmei
2018-11-30 09:13:36 +08:00
4 changed files with 75 additions and 38 deletions

View File

@@ -1337,4 +1337,5 @@ available_ip_total=Available IP Total
address_pool_id=Address Pool ID address_pool_id=Address Pool ID
log_to_cfg=Config log_to_cfg=Config
address_pool_is_used=Address pool is used and cannot perform this operation! address_pool_is_used=Address pool is used and cannot perform this operation!
cgi_service_failed=Request CGI server failed cgi_service_failed=Request CGI server failed
available_ip=Available IP

View File

@@ -1336,4 +1336,5 @@ ip_total=IP Total
available_ip_total=Available IP Total available_ip_total=Available IP Total
address_pool_id=Address Pool ID address_pool_id=Address Pool ID
log_to_cfg=\u041A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044F log_to_cfg=\u041A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044F
address_pool_is_used=Address pool is used and cannot perform this operation! address_pool_is_used=Address pool is used and cannot perform this operation!
available_ip=Available IP

View File

@@ -1335,4 +1335,5 @@ available_ip_total=\u53EF\u7528IP\u6570
address_pool_id=\u5730\u5740\u6C60ID address_pool_id=\u5730\u5740\u6C60ID
log_to_cfg=\u914D\u7F6E log_to_cfg=\u914D\u7F6E
address_pool_is_used=\u5730\u5740\u6C60\u5DF2\u88AB\u4F7F\u7528\uFF0C\u65E0\u6CD5\u6267\u884C\u8BE5\u64CD\u4F5C\uFF01 address_pool_is_used=\u5730\u5740\u6C60\u5DF2\u88AB\u4F7F\u7528\uFF0C\u65E0\u6CD5\u6267\u884C\u8BE5\u64CD\u4F5C\uFF01
cgi_service_failed=\u8BF7\u6C42CGI\u670D\u52A1\u63A5\u53E3\u5931\u8D25 cgi_service_failed=\u8BF7\u6C42CGI\u670D\u52A1\u63A5\u53E3\u5931\u8D25
available_ip=\u53EF\u7528IP\u5730\u5740

View File

@@ -37,42 +37,76 @@
$("#exportValue").val($("#intype").val()); $("#exportValue").val($("#intype").val());
} }
} }
var requestUrl = "http://192.168.11.137:8090/command/?cmd=IpNumGet&addr_pool_id=";
$("td[addrPoolId]").each(function(){ //var requestUrl = "https://api.douban.com/v2/book/search?q=javascript&count=1";
var td = $(this); $("td[addrPoolId]").each(function(){
var audit = $(this).attr("audit") var td = $(this);
var addrPoolId = $(this).attr("addrPoolId"); var audit = $(this).attr("audit")
var timeout=$.validator.messages.timeout; var addrPoolId = $(this).attr("addrPoolId");
var failed=$.validator.messages.failed; var timeout=$.validator.messages.timeout;
// 判断是否为审核通过状态 var failed=$.validator.messages.failed;
if(audit == 1){ // 判断是否为审核通过状态
$.ajax({ if(audit == 1){
type:'get', // $.getJSON(requestUrl,function(data,status){});
timeout:10000,// 超时时间 $.ajax({
url:'http://192.168.11.137:8090/command/?cmd=IpNumGet&addr_pool_id='+addrPoolId, type:'get',
dataType:'json', timeout:15000,// 超时时间
async:true, url:requestUrl+addrPoolId,
success:function(data){ dataType:'jsonp',
//alert(JSON.stringify(data)); async:true,
$(td).html(data.num); success:function(data,status){
if(status == "success"){
}, $(td).html(data.num);
complete:function(XMLHttpRequest,status){ }
if(status=="timeout"){ },
$(td).html(timeout); complete:function(XMLHttpRequest,status){
}else if(status !="success"){ if(status=="timeout"){
$(td).html(failed); $(td).html(timeout);
}else if(status !="success"){
$(td).html(failed);
}
} }
} });
});
}else {
}else { $(td).html(0);
$(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> </script>
</head> </head>
<body> <body>
@@ -449,7 +483,7 @@
<td> <td>
<!-- <a href="#">新增IP</a> <!-- <a href="#">新增IP</a>
<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>
<td>${cfg.creatorName }</td> <td>${cfg.creatorName }</td>
<td><fmt:formatDate value="${cfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td> <td><fmt:formatDate value="${cfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>