From 032d9b313f7e8c07a2ccb3cf1bb48fe82d138e34 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 22 Jul 2011 14:29:37 -0700 Subject: [PATCH] bug 10441: cloudStack - physical resources page - get total count number from new property "count" in listXXXXXXXXX API response. --- ui/scripts/cloud.core.resource.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ui/scripts/cloud.core.resource.js b/ui/scripts/cloud.core.resource.js index 155cc9fca56..be701f3e346 100644 --- a/ui/scripts/cloud.core.resource.js +++ b/ui/scripts/cloud.core.resource.js @@ -430,10 +430,10 @@ function listZonesUpdate() { data: createURL("command=listZones&available=true"), dataType: "json", async: false, - success: function(json) { + success: function(json) { + $("#zone_total").text(json.listzonesresponse.count.toString()); var items = json.listzonesresponse.zone; - if (items != null && items.length > 0) { - $("#zone_total").text(items.length.toString()); + if (items != null && items.length > 0) { for(var i=0; i" + fromdb(items[i].name) + ""); } @@ -1027,7 +1027,7 @@ function resourceCountTotal() { success: function(json) { var items = json.listzonesresponse.zone; if (items != null) { - $("#zone_total").text(items.length.toString()); + $("#zone_total").text(json.listzonesresponse.count.toString()); } } }); @@ -1039,7 +1039,7 @@ function resourceCountTotal() { success: function(json) { var items = json.listpodsresponse.pod; if (items != null) { - $("#pod_total").text(items.length.toString()); + $("#pod_total").text(json.listpodsresponse.count.toString()); } } }); @@ -1050,7 +1050,7 @@ function resourceCountTotal() { success: function(json) { var items = json.listclustersresponse.cluster; if (items != null) { - $("#cluster_total").text(items.length.toString()); + $("#cluster_total").text(json.listclustersresponse.count.toString()); } } }); @@ -1062,7 +1062,7 @@ function resourceCountTotal() { success: function(json) { var items = json.listhostsresponse.host; if (items != null) { - $("#host_total").text(items.length.toString()); + $("#host_total").text(json.listhostsresponse.count.toString()); } } }); @@ -1074,7 +1074,7 @@ function resourceCountTotal() { success: function(json) { var items = json.liststoragepoolsresponse.storagepool; if (items != null) { - $("#primarystorage_total").text(items.length.toString()); + $("#primarystorage_total").text(json.liststoragepoolsresponse.count.toString()); } } });