From e8b6c7b33da77fadef337168f43074802c1bf4d2 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 25 Apr 2013 11:11:55 -0700 Subject: [PATCH] CLOUDSTACK-2120: mixed zone management - UI: count total number of hosts based on selected option in zone type dropdown on top menu. --- ui/scripts/system.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 4692b61ad88..312d5f4906e 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -246,13 +246,19 @@ }, hostCount: function(data) { + var data2= { + type: 'routing', + 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. + }; + if(cloudStack.context.zoneType != null && cloudStack.context.zoneType.length > 0) { //Basic type or Advanced type + $.extend(data2, { + zonetype: cloudStack.context.zoneType + }); + } $.ajax({ url: createURL('listHosts'), - data: { - type: 'routing', - 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. - }, + data: data2, success: function(json) { dataFns.primaryStorageCount($.extend(data, { hostCount: json.listhostsresponse.count ?