mirror of
https://github.com/ansible/awx.git
synced 2026-04-13 22:19:27 -02:30
properly deprovisions instance
This commit is contained in:
committed by
Jeff Bradberry
parent
d4b25058cd
commit
6619cc39f7
@@ -27,7 +27,7 @@ class Instances extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
deprovisionInstance(instanceId) {
|
deprovisionInstance(instanceId) {
|
||||||
return this.http.post(`${this.baseUrl}${instanceId}`, {
|
return this.http.patch(`${this.baseUrl}${instanceId}/`, {
|
||||||
node_state: 'deprovisioning',
|
node_state: 'deprovisioning',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ function InstanceList() {
|
|||||||
Promise.all(
|
Promise.all(
|
||||||
selected.map(({ id }) => InstancesAPI.deprovisionInstance(id))
|
selected.map(({ id }) => InstancesAPI.deprovisionInstance(id))
|
||||||
),
|
),
|
||||||
{ fetchItems: fetchInstances }
|
{ fetchItems: fetchInstances, qsConfig: QS_CONFIG }
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ function RemoveInstanceButton({ itemsToRemove, onRemove, isK8s }) {
|
|||||||
const toggleModal = async (isOpen) => {
|
const toggleModal = async (isOpen) => {
|
||||||
setRemoveDetails(null);
|
setRemoveDetails(null);
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
if (isOpen && itemsToRemove.length === 1) {
|
if (isOpen && itemsToRemove.length > 0) {
|
||||||
const { results, error } = await getRelatedResourceDeleteCounts(
|
const { results, error } = await getRelatedResourceDeleteCounts(
|
||||||
relatedResourceDeleteRequests.instance(itemsToRemove[0])
|
relatedResourceDeleteRequests.instance(itemsToRemove[0])
|
||||||
);
|
);
|
||||||
@@ -85,7 +85,7 @@ function RemoveInstanceButton({ itemsToRemove, onRemove, isK8s }) {
|
|||||||
<Plural
|
<Plural
|
||||||
value={itemsToRemove.length}
|
value={itemsToRemove.length}
|
||||||
one="This intance is currently being used by other resources. Are you sure you want to delete it?"
|
one="This intance is currently being used by other resources. Are you sure you want to delete it?"
|
||||||
other="Deleting these instances could impact other resources that rely on them. Are you sure you want to delete anyway?"
|
other="Deprovisioning these instances could impact other resources that rely on them. Are you sure you want to delete anyway?"
|
||||||
/>
|
/>
|
||||||
{removeDetails &&
|
{removeDetails &&
|
||||||
Object.entries(removeDetails).map(([key, value]) => (
|
Object.entries(removeDetails).map(([key, value]) => (
|
||||||
|
|||||||
Reference in New Issue
Block a user