mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 14:27:42 -02:30
allow more than 400 credential types in drop down while adding new credential
This commit is contained in:
@@ -86,14 +86,19 @@ function CredentialAdd({ me }) {
|
|||||||
const { data } = await CredentialTypesAPI.read({ page_size: 200 });
|
const { data } = await CredentialTypesAPI.read({ page_size: 200 });
|
||||||
const credTypes = data.results;
|
const credTypes = data.results;
|
||||||
if (data.next && data.next.includes('page=2')) {
|
if (data.next && data.next.includes('page=2')) {
|
||||||
const {
|
let pageNo = 2;
|
||||||
data: { results },
|
/* eslint-disable no-await-in-loop */
|
||||||
} = await CredentialTypesAPI.read({
|
do {
|
||||||
page_size: 200,
|
const {
|
||||||
page: 2,
|
data: { results },
|
||||||
});
|
} = await CredentialTypesAPI.read({
|
||||||
credTypes.concat(results);
|
page_size: 200,
|
||||||
}
|
page: pageNo,
|
||||||
|
});
|
||||||
|
credTypes.push(...results);
|
||||||
|
pageNo++;
|
||||||
|
} while (data.count !== credTypes.length);
|
||||||
|
} /* eslint-enable no-await-in-loop */
|
||||||
|
|
||||||
const creds = credTypes.reduce((credentialTypesMap, credentialType) => {
|
const creds = credTypes.reduce((credentialTypesMap, credentialType) => {
|
||||||
credentialTypesMap[credentialType.id] = credentialType;
|
credentialTypesMap[credentialType.id] = credentialType;
|
||||||
|
|||||||
Reference in New Issue
Block a user