shwstppr commented on a change in pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#discussion_r685985535



##########
File path: ui/src/api/index.js
##########
@@ -29,14 +29,73 @@ export function api (command, args = {}, method = 'GET', 
data = {}) {
     })
   }
 
-  return axios({
-    params: {
-      ...args
-    },
-    url: '/',
-    method,
-    data: params || {}
-  })
+  const exemptedAPIs = ['listLdapConfigurations', 'listCapabilities', 
'listIdps', 'listApis', 'listInfrastructure', 'listAndSwitchSamlAccount']
+
+  if ('page' in args || exemptedAPIs.includes(command) || 
!command.startsWith('list')) {
+    return axios({
+      params: {
+        ...args
+      },
+      url: '/',
+      method,
+      data: params || {}
+    })
+  }
+
+  const pagesize = 10
+  let page = 1
+  let items = []
+  let done = false
+  let response = null
+
+  while (!done) {
+    args.page = page
+    args.pagesize = pagesize

Review comment:
       @davidjumani do we use `default.ui.page.size` global setting in the UI?
   
   And just want to know if I have 1000 VMs in my env and I open AttachVolume 
form will this call listVirtualMachines API 100 times?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to