mirror of
https://github.com/ansible/awx.git
synced 2026-02-22 05:30:18 -03:30
add advanced search keys to host filter lookup
This commit is contained in:
@@ -124,7 +124,7 @@ function HostFilterLookup({
|
|||||||
const searchColumns = buildSearchColumns(i18n);
|
const searchColumns = buildSearchColumns(i18n);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
result: { count, hosts },
|
result: { count, hosts, relatedSearchableKeys, searchableKeys },
|
||||||
error: contentError,
|
error: contentError,
|
||||||
request: fetchHosts,
|
request: fetchHosts,
|
||||||
isLoading,
|
isLoading,
|
||||||
@@ -135,9 +135,16 @@ function HostFilterLookup({
|
|||||||
const { data } = await HostsAPI.read(
|
const { data } = await HostsAPI.read(
|
||||||
mergeParams(params, { inventory__organization: orgId })
|
mergeParams(params, { inventory__organization: orgId })
|
||||||
);
|
);
|
||||||
|
const { data: actions } = await HostsAPI.readOptions();
|
||||||
return {
|
return {
|
||||||
count: data.count,
|
count: data.count,
|
||||||
hosts: data.results,
|
hosts: data.results,
|
||||||
|
relatedSearchableKeys: (
|
||||||
|
actions?.related_search_fields || []
|
||||||
|
).map(val => val.slice(0, -8)),
|
||||||
|
searchableKeys: Object.keys(actions?.actions.GET || {}).filter(
|
||||||
|
key => actions.actions?.GET[key].filterable
|
||||||
|
),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
[location.search]
|
[location.search]
|
||||||
@@ -145,6 +152,8 @@ function HostFilterLookup({
|
|||||||
{
|
{
|
||||||
count: 0,
|
count: 0,
|
||||||
hosts: [],
|
hosts: [],
|
||||||
|
relatedSearchableKeys: [],
|
||||||
|
searchableKeys: [],
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -316,6 +325,8 @@ function HostFilterLookup({
|
|||||||
key: 'modified',
|
key: 'modified',
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
|
toolbarSearchableKeys={searchableKeys}
|
||||||
|
toolbarRelatedSearchableKeys={relatedSearchableKeys}
|
||||||
/>
|
/>
|
||||||
</ModalList>
|
</ModalList>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
Reference in New Issue
Block a user