Skip to content

Commit 74c98a1

Browse files
Jessica Wangchaturvedia
authored andcommitted
CLOUDSTACK-6031: UI > infrastructure > count > pass listAll=true to all listXXXXXXX API for counting resource.
(cherry picked from commit e0dfe0a) Signed-off-by: Animesh Chaturvedi <animesh@apache.org>
1 parent 3c891fc commit 74c98a1

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

‎ui/scripts/system.js‎

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@
203203
zoneCount: function(data) {
204204
$.ajax({
205205
url: createURL('listZones'),
206+
data: {
207+
listAll: true,
208+
page: 1,
209+
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.
210+
},
206211
success: function(json) {
207212
dataFns.podCount($.extend(data, {
208213
zoneCount: json.listzonesresponse.count ? json.listzonesresponse.count : 0,
@@ -216,6 +221,7 @@
216221
$.ajax({
217222
url: createURL('listPods'),
218223
data: {
224+
listAll: true,
219225
page: 1,
220226
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.
221227
},
@@ -231,6 +237,7 @@
231237
$.ajax({
232238
url: createURL('listClusters'),
233239
data: {
240+
listAll: true,
234241
page: 1,
235242
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.
236243
},
@@ -254,6 +261,7 @@
254261
hostCount: function(data) {
255262
var data2 = {
256263
type: 'routing',
264+
listAll: true,
257265
page: 1,
258266
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.
259267
};
@@ -270,6 +278,7 @@
270278

271279
primaryStorageCount: function(data) {
272280
var data2 = {
281+
listAll: true,
273282
page: 1,
274283
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.
275284
};
@@ -287,6 +296,7 @@
287296
secondaryStorageCount: function(data) {
288297
var data2 = {
289298
type: 'SecondaryStorage',
299+
listAll: true,
290300
page: 1,
291301
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.
292302
};
@@ -305,6 +315,7 @@
305315
$.ajax({
306316
url: createURL('listSystemVms'),
307317
data: {
318+
listAll: true,
308319
page: 1,
309320
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.
310321
},
@@ -318,6 +329,7 @@
318329

319330
virtualRouterCount: function(data) {
320331
var data2 = {
332+
listAll: true,
321333
page: 1,
322334
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.
323335
};
@@ -336,7 +348,7 @@
336348
if (cloudStack.context && cloudStack.context.projects == null) { //non-project view
337349
var data3 = {
338350
listAll: true,
339-
projectid: -1,
351+
projectid: -1,
340352
page: 1,
341353
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.
342354
};
@@ -350,11 +362,11 @@
350362
});
351363
}
352364

353-
dataFns.capacity($.extend(data, {
354-
virtualRouterCount: (total1 + total2)
355-
}));
356-
}
357-
});
365+
dataFns.capacity($.extend(data, {
366+
virtualRouterCount: (total1 + total2)
367+
}));
368+
}
369+
});
358370
},
359371

360372
capacity: function(data) {

0 commit comments

Comments
 (0)