From 57a17b83d2f40d74d19ae09b83ddefdd216a149d Mon Sep 17 00:00:00 2001 From: "Jingwei.Zhang" Date: Wed, 10 Aug 2022 17:44:10 +0800 Subject: [PATCH] refactor: Update Label component to support floating ip's icon 1. Update Label component to support floating ip's icon 2. Update the floating ip display in the associate fip form 3. Update the floating ip display in the create port forwarding form 4. Update the floating ip display in the edit port forwarding form Change-Id: I38ee2354c387d213cdd574f966be96afb8fcd433 --- src/components/FormItem/Label/index.jsx | 2 ++ .../FloatingIp/Detail/PortForwarding/actions/Edit.jsx | 4 +--- src/pages/network/containers/FloatingIp/actions/Associate.jsx | 3 +-- .../network/containers/FloatingIp/actions/CreateDNAT.jsx | 4 +--- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/components/FormItem/Label/index.jsx b/src/components/FormItem/Label/index.jsx index 6f1e5244..a4b1e632 100644 --- a/src/components/FormItem/Label/index.jsx +++ b/src/components/FormItem/Label/index.jsx @@ -36,6 +36,7 @@ import { LoadingOutlined, TeamOutlined, ProjectOutlined, + AimOutlined, } from '@ant-design/icons'; import styles from './index.less'; @@ -70,6 +71,7 @@ const iconTypeMap = { lb: LBIcon, group: , project: , + floatingIp: , }; export default class index extends Component { diff --git a/src/pages/network/containers/FloatingIp/Detail/PortForwarding/actions/Edit.jsx b/src/pages/network/containers/FloatingIp/Detail/PortForwarding/actions/Edit.jsx index 23c8267c..d3454bd8 100644 --- a/src/pages/network/containers/FloatingIp/Detail/PortForwarding/actions/Edit.jsx +++ b/src/pages/network/containers/FloatingIp/Detail/PortForwarding/actions/Edit.jsx @@ -12,14 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import React from 'react'; import { inject, observer } from 'mobx-react'; import globalPortForwardingStore from 'stores/neutron/port-forwarding'; import globalPortStore, { PortStore } from 'stores/neutron/port'; import { getCanReachSubnetIdsWithRouterIdInComponent } from 'resources/neutron/router'; import { getInterfaceWithReason } from 'resources/neutron/floatingip'; import { getPortFormItem, getPortsAndReasons } from 'resources/neutron/port'; -import { DesktopOutlined } from '@ant-design/icons'; import { ModalAction } from 'containers/Action'; export class Edit extends ModalAction { @@ -204,7 +202,7 @@ export class Edit extends ModalAction { name: 'floatingIp', label: t('Floating Ip'), type: 'label', - icon: , + iconType: 'floatingIp', }, { name: 'protocol', diff --git a/src/pages/network/containers/FloatingIp/actions/Associate.jsx b/src/pages/network/containers/FloatingIp/actions/Associate.jsx index 5d661f5a..46e1d077 100644 --- a/src/pages/network/containers/FloatingIp/actions/Associate.jsx +++ b/src/pages/network/containers/FloatingIp/actions/Associate.jsx @@ -14,7 +14,6 @@ import React from 'react'; import { inject, observer } from 'mobx-react'; -import { DesktopOutlined } from '@ant-design/icons'; import { ModalAction } from 'containers/Action'; import globalServerStore, { ServerStore } from 'stores/nova/instance'; import globalRouterStore, { RouterStore } from 'stores/neutron/router'; @@ -231,7 +230,7 @@ export class Associate extends ModalAction { name: 'floatingIp', label: t('Floating Ip'), type: 'label', - icon: , + iconType: 'floatingIp', }, { name: 'resourceType', diff --git a/src/pages/network/containers/FloatingIp/actions/CreateDNAT.jsx b/src/pages/network/containers/FloatingIp/actions/CreateDNAT.jsx index a002175d..4cfe0aea 100644 --- a/src/pages/network/containers/FloatingIp/actions/CreateDNAT.jsx +++ b/src/pages/network/containers/FloatingIp/actions/CreateDNAT.jsx @@ -12,9 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import React from 'react'; import { inject, observer } from 'mobx-react'; -import { DesktopOutlined } from '@ant-design/icons'; import { ModalAction } from 'containers/Action'; import { isNull } from 'lodash'; import { getCanReachSubnetIdsWithRouterIdInComponent } from 'resources/neutron/router'; @@ -142,7 +140,7 @@ export class CreateDNAT extends ModalAction { name: 'floatingIp', label: t('Floating Ip'), type: 'label', - icon: , + iconType: 'floatingIp', }, { name: 'protocol',