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