diff --git a/zun_ui/static/dashboard/container/containers/actions/delete-force.service.js b/zun_ui/static/dashboard/container/containers/actions/delete-force.service.js index fa89ea3..b61994a 100644 --- a/zun_ui/static/dashboard/container/containers/actions/delete-force.service.js +++ b/zun_ui/static/dashboard/container/containers/actions/delete-force.service.js @@ -125,8 +125,11 @@ deleteModalResult.fail.forEach(function markFailed(item) { result.failed(resourceType, getEntity(item).id); }); - if (result.result.failed.length === 0 && result.result.deleted.length > 0) { - $location.path('/project/container/containers'); + var indexPath = '/project/container/containers'; + var currentPath = $location.path(); + if (result.result.failed.length === 0 && result.result.deleted.length > 0 && + currentPath !== indexPath) { + $location.path(indexPath); } else { return result.result; } diff --git a/zun_ui/static/dashboard/container/containers/actions/delete-stop.service.js b/zun_ui/static/dashboard/container/containers/actions/delete-stop.service.js index 95ab5d2..f7d05b6 100644 --- a/zun_ui/static/dashboard/container/containers/actions/delete-stop.service.js +++ b/zun_ui/static/dashboard/container/containers/actions/delete-stop.service.js @@ -125,8 +125,11 @@ deleteModalResult.fail.forEach(function markFailed(item) { result.failed(resourceType, getEntity(item).id); }); - if (result.result.failed.length === 0 && result.result.deleted.length > 0) { - $location.path('/project/container/containers'); + var indexPath = '/project/container/containers'; + var currentPath = $location.path(); + if (result.result.failed.length === 0 && result.result.deleted.length > 0 && + currentPath !== indexPath) { + $location.path(indexPath); } else { return result.result; } diff --git a/zun_ui/static/dashboard/container/containers/actions/delete.service.js b/zun_ui/static/dashboard/container/containers/actions/delete.service.js index c09f0e5..64e8d51 100644 --- a/zun_ui/static/dashboard/container/containers/actions/delete.service.js +++ b/zun_ui/static/dashboard/container/containers/actions/delete.service.js @@ -131,8 +131,11 @@ deleteModalResult.fail.forEach(function markFailed(item) { result.failed(resourceType, getEntity(item).id); }); - if (result.result.failed.length === 0 && result.result.deleted.length > 0) { - $location.path('/project/container/containers'); + var indexPath = '/project/container/containers'; + var currentPath = $location.path(); + if (result.result.failed.length === 0 && result.result.deleted.length > 0 && + currentPath !== indexPath) { + $location.path(indexPath); } else { return result.result; }