CLOUDSTACK-6031: UI > infrastructure > count > pass listAll=true to all listXXXXXXX API for counting resource. (cherry picked from commit e0dfe0ab15ee71c2cdf8fe7cce46b73258120a8e)
Signed-off-by: Animesh Chaturvedi <anim...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/74c98a1d Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/74c98a1d Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/74c98a1d Branch: refs/heads/4.3 Commit: 74c98a1d3fd4dc6ffe5a9fdcd811375164f79df3 Parents: 3c891fc Author: Jessica Wang <jessicaw...@apache.org> Authored: Wed Feb 5 14:09:27 2014 -0800 Committer: Animesh Chaturvedi <anim...@apache.org> Committed: Fri Feb 7 13:20:17 2014 -0800 ---------------------------------------------------------------------- ui/scripts/system.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/74c98a1d/ui/scripts/system.js ---------------------------------------------------------------------- diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 6b89182..743427b 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -203,6 +203,11 @@ zoneCount: function(data) { $.ajax({ url: createURL('listZones'), + data: { + listAll: true, + page: 1, + pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property. + }, success: function(json) { dataFns.podCount($.extend(data, { zoneCount: json.listzonesresponse.count ? json.listzonesresponse.count : 0, @@ -216,6 +221,7 @@ $.ajax({ url: createURL('listPods'), data: { + listAll: true, page: 1, pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property. }, @@ -231,6 +237,7 @@ $.ajax({ url: createURL('listClusters'), data: { + listAll: true, page: 1, pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property. }, @@ -254,6 +261,7 @@ hostCount: function(data) { var data2 = { type: 'routing', + listAll: true, page: 1, pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property. }; @@ -270,6 +278,7 @@ primaryStorageCount: function(data) { var data2 = { + listAll: true, page: 1, pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property. }; @@ -287,6 +296,7 @@ secondaryStorageCount: function(data) { var data2 = { type: 'SecondaryStorage', + listAll: true, page: 1, pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property. }; @@ -305,6 +315,7 @@ $.ajax({ url: createURL('listSystemVms'), data: { + listAll: true, page: 1, pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property. }, @@ -318,6 +329,7 @@ virtualRouterCount: function(data) { var data2 = { + listAll: true, page: 1, pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property. }; @@ -336,7 +348,7 @@ if (cloudStack.context && cloudStack.context.projects == null) { //non-project view var data3 = { listAll: true, - projectid: -1, + projectid: -1, page: 1, pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property. }; @@ -350,11 +362,11 @@ }); } - dataFns.capacity($.extend(data, { - virtualRouterCount: (total1 + total2) - })); - } - }); + dataFns.capacity($.extend(data, { + virtualRouterCount: (total1 + total2) + })); + } + }); }, capacity: function(data) {