fix: disable associate action when fip has port forwardings

Disable fip associate action  when the fip has port forwardings

Change-Id: Ie310d2935d23817ad32c6b2088361b9747722936
This commit is contained in:
Jingwei.Zhang 2022-07-15 17:54:07 +08:00
parent a0d2ed54a7
commit 2c0eb3858e

View File

@ -28,7 +28,10 @@ import globalFloatingIpsStore from 'stores/neutron/floatingIp';
import { PortStore } from 'stores/neutron/port';
import { instanceSelectTablePropsBackend } from 'resources/nova/instance';
import { getPortFormItem, getPortsAndReasons } from 'resources/neutron/port';
import { getInterfaceWithReason } from 'resources/neutron/floatingip';
import {
getInterfaceWithReason,
disableFIPAssociate,
} from 'resources/neutron/floatingip';
export class Associate extends ModalAction {
static id = 'associate';
@ -180,6 +183,7 @@ export class Associate extends ModalAction {
static allowed = (item) =>
Promise.resolve(
!disableFIPAssociate(item) &&
isNull(item.fixed_ip_address) &&
item.status === 'DOWN' &&
isNull(item.port_details)