resource page - add cluster total number.

This commit is contained in:
Jessica Wang 2010-12-30 10:39:51 -08:00
parent dfecc1f448
commit 10fb37d90d
2 changed files with 27 additions and 0 deletions

View File

@ -53,6 +53,22 @@
</div>
</div>
<div class="dbrow odd" style="margin-top:10px; border:1px solid #CCC;">
<div class="dbrow_cell" style="width: 64%; border: none; ">
<div class="resource_titlebox">
<h2><span> # of </span> Clusters</h2>
</div>
</div>
<div class="dbrow_cell" style="width: 25%; border: none; background:#cacaca repeat top left; ">
<div class="resources_totalbg">
<p id="cluster_total">0</p>
</div>
</div>
<div class="dbrow_cell" style="width: 10%; border: none;">
<div id="add_pod_shortcut" class="resadd_button" title="Add Cluster"></div>
</div>
</div>
<div class="dbrow even" style="margin-top:10px; border:1px solid #CCC;">
<div class="dbrow_cell" style="width: 64%; border: none;">
<div class="resource_titlebox">

View File

@ -883,6 +883,17 @@ function resourceCountTotal() {
}
});
$.ajax({
data: createURL("command=listClusters"),
dataType: "json",
success: function(json) {
var items = json.listclustersresponse.cluster;
if (items != null) {
$("#cluster_total").text(items.length.toString());
}
}
});
$.ajax({
data: createURL("command=listHosts&type=Routing"),
dataType: "json",