mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -03:30
Filter out instances with node_type equal to 'control'.
This commit is contained in:
parent
cc7488bc15
commit
cde0df937f
@ -90,9 +90,14 @@ function InstanceList() {
|
||||
useCallback(
|
||||
() =>
|
||||
Promise.all(
|
||||
selected.map((instance) =>
|
||||
InstanceGroupsAPI.disassociateInstance(instanceGroupId, instance.id)
|
||||
)
|
||||
selected
|
||||
.filter((s) => s.node_type !== 'control')
|
||||
.map((instance) =>
|
||||
InstanceGroupsAPI.disassociateInstance(
|
||||
instanceGroupId,
|
||||
instance.id
|
||||
)
|
||||
)
|
||||
),
|
||||
[instanceGroupId, selected]
|
||||
),
|
||||
@ -107,9 +112,11 @@ function InstanceList() {
|
||||
useCallback(
|
||||
async (instancesToAssociate) => {
|
||||
await Promise.all(
|
||||
instancesToAssociate.map((instance) =>
|
||||
InstanceGroupsAPI.associateInstance(instanceGroupId, instance.id)
|
||||
)
|
||||
instancesToAssociate
|
||||
.filter((i) => i.node_type !== 'control')
|
||||
.map((instance) =>
|
||||
InstanceGroupsAPI.associateInstance(instanceGroupId, instance.id)
|
||||
)
|
||||
);
|
||||
fetchInstances();
|
||||
},
|
||||
@ -187,7 +194,9 @@ function InstanceList() {
|
||||
verifyCannotDisassociate={false}
|
||||
key="disassociate"
|
||||
onDisassociate={handleDisassociate}
|
||||
itemsToDisassociate={selected}
|
||||
itemsToDisassociate={selected.filter(
|
||||
(s) => s.node_type !== 'control'
|
||||
)}
|
||||
modalTitle={t`Disassociate instance from instance group?`}
|
||||
/>,
|
||||
]}
|
||||
|
||||
@ -106,7 +106,7 @@ function InstanceListItem({
|
||||
<Td
|
||||
select={{
|
||||
rowIndex,
|
||||
isSelected,
|
||||
isSelected: isSelected && instance.node_type !== 'control',
|
||||
onSelect,
|
||||
disable: instance.node_type === 'control',
|
||||
}}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user