From e8a7a823891255aa4586ea9417e2dd942f2b6b8b Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 2 Nov 2012 11:12:17 -0700 Subject: [PATCH] cloudstack UI - infrastructure page - resource count - hide resource count whose API hasn't been fixed yet (i.e. zones count, hosts count, secondary storage count) and show resource count whose API has been fixed (i.e. pods count, clusters count, primary storage count, system VMs count, virtual routers count). --- ui/scripts/system.js | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 627b64f3d8b..d27abcccf80 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -207,10 +207,19 @@ $.ajax({ url: createURL('listClusters'), success: function(json) { - dataFns.hostCount($.extend(data, { + /* + dataFns.hostCount($.extend(data, { clusterCount: json.listclustersresponse.count ? json.listclustersresponse.count : 0 })); + */ + + //uncomment the 4 lines above and remove the following 4 lines after "count" in listHosts API is fixed. + dataFns.primaryStorageCount($.extend(data, { + clusterCount: json.listclustersresponse.count ? + json.listclustersresponse.count : 0 + })); + } }); }, @@ -234,10 +243,19 @@ $.ajax({ url: createURL('listStoragePools'), success: function(json) { - dataFns.secondaryStorageCount($.extend(data, { + /* + dataFns.secondaryStorageCount($.extend(data, { primaryStorageCount: json.liststoragepoolsresponse.count ? json.liststoragepoolsresponse.count : 0 })); + */ + + //uncomment the 4 lines above and remove the following 4 lines after "count" in listHosts API is fixed. + dataFns.systemVmCount($.extend(data, { + primaryStorageCount: json.liststoragepoolsresponse.count ? + json.liststoragepoolsresponse.count : 0 + })); + } }); }, @@ -337,7 +355,9 @@ }); }; - dataFns.zoneCount({}); + //dataFns.zoneCount({}); + dataFns.podCount({}); //uncomment the line above and remove this line after "count" in listZones API is fixed. + } },