You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/08/11 08:51:51 UTC

[GitHub] [cloudstack] davidjumani commented on a change in pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

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



##########
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:
       10 is a placeholder now since `default.ui.page.size` is generally 500 and it would be difficult to see it in the test env. Will change it to `default.ui.page.size` after people test and get back




-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org