After deleting the trunk, jump to the correct page

Change-Id: Ie1835e67d7c5e0879cd372cee996853c4d7a36bc
Closes-Bug: #1821835
This commit is contained in:
pengyuesheng 2019-03-27 10:06:42 +08:00
parent 1d2145b888
commit 0d8fba2a3d
1 changed files with 12 additions and 1 deletions

View File

@ -23,6 +23,7 @@
deleteService.$inject = [
'$q',
'$location',
'horizon.app.core.openstack-service-api.neutron',
'horizon.app.core.openstack-service-api.policy',
'horizon.app.core.trunks.resourceType',
@ -32,6 +33,7 @@
function deleteService(
$q,
$location,
neutron,
policy,
resourceType,
@ -81,7 +83,16 @@
actionResult.failed(resourceType, item.context.id);
});
return actionResult.result;
var path = "admin/trunks";
if ($location.url().indexOf("admin") === -1) {
path = "project/trunks";
}
if ($location.url() !== path && actionResult.result.failed.length === 0 &&
actionResult.result.deleted.length > 0) {
$location.path(path);
} else {
return actionResult.result;
}
}
}