new UI - resource page - show total number of zone, pod, host, primary storage.

This commit is contained in:
Jessica Wang 2010-11-09 19:44:41 -08:00
parent dd72bbea09
commit 0b4c865b36
2 changed files with 53 additions and 6 deletions

View File

@ -30,7 +30,7 @@
</div>
<div class="dbrow_cell" style="width: 25%; border: none; background:#cacaca repeat top left; ">
<div class="resources_totalbg">
<p>10</p>
<p id="zone_total">N</p>
</div>
</div>
<div class="dbrow_cell" style="width: 10%; border: none;">
@ -45,23 +45,24 @@
</div>
<div class="dbrow_cell" style="width: 25%; border: none; background:#cacaca repeat top left; ">
<div class="resources_totalbg">
<p>120</p>
<p id="pod_total">N</p>
</div>
</div>
<div class="dbrow_cell" style="width: 10%; border: none;">
<div class="resadd_button" title="Add Pod"></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">
<h2><span> # of </span> Cluster - Host</h2>
<h2><span> # of </span> Host</h2>
</div>
</div>
<div class="dbrow_cell" style="width: 25%; border: none; background:#cacaca repeat top left; ">
<div class="resources_totalbg">
<p>15</p>
<p id="host_total">N</p>
</div>
</div>
<div class="dbrow_cell" style="width: 10%; border: none;">
@ -72,13 +73,13 @@
<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> Cluster - Primary Storage</h2>
<h2><span> # of </span> Primary Storage</h2>
</div>
</div>
<div class="dbrow_cell" style="width: 25%; border: none; background:#cacaca repeat top left; ">
<div class="resources_totalbg">
<p>12</p>
<p id="primarystorage_total">N</p>
</div>
</div>
<div class="dbrow_cell" style="width: 10%; border: none;">

View File

@ -250,6 +250,52 @@ function afterLoadResourceJSP($midmenuItem1) {
initUpdateConsoleCertButton($("#midmenu_add2_link"));
initDialog("dialog_add_zone");
initDialog("dialog_update_cert", 450);
$.ajax({
data: createURL("command=listZones&available=true"),
dataType: "json",
success: function(json) {
var items = json.listzonesresponse.zone;
if (items != null) {
$("#zone_total").text(items.length.toString());
}
}
});
$.ajax({
data: createURL("command=listPods&available=true"),
dataType: "json",
success: function(json) {
var items = json.listpodsresponse.pod;
if (items != null) {
$("#pod_total").text(items.length.toString());
}
}
});
$.ajax({
data: createURL("command=listHosts&type=Routing"),
dataType: "json",
async: false,
success: function(json) {
var items = json.listhostsresponse.host;
if (items != null) {
$("#host_total").text(items.length.toString());
}
}
});
$.ajax({
data: createURL("command=listStoragePools"),
dataType: "json",
async: false,
success: function(json) {
var items = json.liststoragepoolsresponse.storagepool;
if (items != null) {
$("#primarystorage_total").text(items.length.toString());
}
}
});
}
function initUpdateConsoleCertButton($midMenuAddLink2) {