From d55f42c12c4a5d98a0df4f7b1a1c44df7ccd2e28 Mon Sep 17 00:00:00 2001 From: "Jingwei.Zhang" Date: Tue, 12 Jul 2022 15:42:12 +0800 Subject: [PATCH] feat: support fixed ip filter in port-form-item Support fixed ip filter in port-form-item, the related actions below: 1. Support fixed ip filter when instance associate fip 2. Suppport fixed ip filter when fip create dnat 3. Support fixed ip filter when edit dnat Change-Id: I2bfbca000d2a6699010c40e225eab2ce8514c9e0 --- src/resources/neutron/port.jsx | 4 ++++ src/stores/neutron/port.js | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/resources/neutron/port.jsx b/src/resources/neutron/port.jsx index e09c9bc8..ca1640b0 100644 --- a/src/resources/neutron/port.jsx +++ b/src/resources/neutron/port.jsx @@ -103,6 +103,10 @@ export function getPortFormItem(device_owner) { label: t('Name'), name: 'name', }, + { + label: t('Fixed IP'), + name: 'fixedIP', + }, ], columns: [ { diff --git a/src/stores/neutron/port.js b/src/stores/neutron/port.js index 09882548..b5d9582c 100644 --- a/src/stores/neutron/port.js +++ b/src/stores/neutron/port.js @@ -30,6 +30,17 @@ export class PortStore extends Base { return client.neutron.routers; } + get paramsFuncPage() { + return (params) => { + const { current, fixedIP, ...rest } = params; + const newParams = { ...rest }; + if (fixedIP) { + newParams.fixed_ips = `ip_address=${fixedIP}`; + } + return newParams; + }; + } + async detailDidFetch(item) { const { network_id } = item; try {