fix associate floating IP in the port list if allowed
Show Associate Floating IP in port list if allowed Closes-Bug: #1991078 Change-Id: I100b2bc184bb8e3e861cfd6437745ab799ca02da
This commit is contained in:
parent
cd72ae0ae1
commit
a92c6aa9ce
@ -174,9 +174,7 @@ export class PortStore extends Base {
|
||||
return items;
|
||||
}
|
||||
const { subnetId } = filters;
|
||||
if (!subnetId) {
|
||||
return items;
|
||||
}
|
||||
if (subnetId) {
|
||||
const newItems = [];
|
||||
items.forEach((it) => {
|
||||
const { fixed_ips = [] } = it;
|
||||
@ -199,6 +197,17 @@ export class PortStore extends Base {
|
||||
});
|
||||
return newItems;
|
||||
}
|
||||
const fips = (await globalFloatingIpsStore.pureFetchList()) || [];
|
||||
const newItems = items.map((it) => {
|
||||
it.associatedDetail = fips.filter(
|
||||
(f) =>
|
||||
f.port_id === it.id &&
|
||||
it.fixed_ips.find((ff) => ff.ip_address === f.fixed_ip_address)
|
||||
);
|
||||
return it;
|
||||
});
|
||||
return newItems;
|
||||
}
|
||||
}
|
||||
|
||||
const globalPortStore = new PortStore();
|
||||
|
Loading…
Reference in New Issue
Block a user