|
269 | 269 | }, |
270 | 270 |
|
271 | 271 | primaryStorageCount: function(data) { |
| 272 | + var data2 = { |
| 273 | + page: 1, |
| 274 | + 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. |
| 275 | + }; |
| 276 | + if(cloudStack.context.zoneType != null && cloudStack.context.zoneType.length > 0) { //Basic type or Advanced type |
| 277 | + $.extend(data2, { |
| 278 | + zonetype: cloudStack.context.zoneType |
| 279 | + }); |
| 280 | + } |
272 | 281 | $.ajax({ |
273 | 282 | url: createURL('listStoragePools'), |
274 | | - data: { |
275 | | - page: 1, |
276 | | - 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. |
277 | | - }, |
| 283 | + data: data2, |
278 | 284 | success: function(json) { |
279 | | - dataFns.secondaryStorageCount($.extend(data, { |
280 | | - primaryStorageCount: json.liststoragepoolsresponse.count ? |
281 | | - json.liststoragepoolsresponse.count : 0 |
| 285 | + dataFns.secondaryStorageCount($.extend(data, { |
| 286 | + primaryStorageCount: json.liststoragepoolsresponse.count ? json.liststoragepoolsresponse.count : 0 |
282 | 287 | })); |
283 | 288 | } |
284 | 289 | }); |
285 | 290 | }, |
286 | 291 |
|
287 | 292 | secondaryStorageCount: function(data) { |
| 293 | + var data2 = { |
| 294 | + type: 'SecondaryStorage', |
| 295 | + page: 1, |
| 296 | + 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. |
| 297 | + }; |
| 298 | + if(cloudStack.context.zoneType != null && cloudStack.context.zoneType.length > 0) { //Basic type or Advanced type |
| 299 | + $.extend(data2, { |
| 300 | + zonetype: cloudStack.context.zoneType |
| 301 | + }); |
| 302 | + } |
288 | 303 | $.ajax({ |
289 | 304 | url: createURL('listHosts'), |
290 | | - data: { |
291 | | - type: 'SecondaryStorage', |
292 | | - page: 1, |
293 | | - 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. |
294 | | - }, |
| 305 | + data: data2, |
295 | 306 | success: function(json) { |
296 | 307 | dataFns.systemVmCount($.extend(data, { |
297 | 308 | secondaryStorageCount: json.listhostsresponse.count ? |
|
0 commit comments