diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 312d5f4906e..fea76693b13 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -269,29 +269,40 @@ }, primaryStorageCount: function(data) { + var data2 = { + 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('listStoragePools'), - data: { - 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.secondaryStorageCount($.extend(data, { - primaryStorageCount: json.liststoragepoolsresponse.count ? - json.liststoragepoolsresponse.count : 0 + dataFns.secondaryStorageCount($.extend(data, { + primaryStorageCount: json.liststoragepoolsresponse.count ? json.liststoragepoolsresponse.count : 0 })); } }); }, secondaryStorageCount: function(data) { + var data2 = { + type: 'SecondaryStorage', + 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: 'SecondaryStorage', - 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.systemVmCount($.extend(data, { secondaryStorageCount: json.listhostsresponse.count ?