From 088c38e65cade1db421161efa3d3225cd600da26 Mon Sep 17 00:00:00 2001 From: xusongfu Date: Wed, 23 Feb 2022 22:37:01 +0800 Subject: [PATCH] fix: Fix the router port & security group 1. The name of router port is empty but it is id in the download file, we need to modify the column to get the correct name in download file 2. Incorrect routing path parameters cause errors in jumping to the security group details page Change-Id: I91bd0873c7b767da5b9b2cdc566389897c230ae1 --- src/pages/network/containers/Router/Port/index.jsx | 1 - .../VirtualAdapter/Detail/SecurityGroups/index.jsx | 2 +- .../VirtualAdapter/actions/ManageSecurityGroup.jsx | 5 ++++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pages/network/containers/Router/Port/index.jsx b/src/pages/network/containers/Router/Port/index.jsx index 0e7d74b7..88063990 100644 --- a/src/pages/network/containers/Router/Port/index.jsx +++ b/src/pages/network/containers/Router/Port/index.jsx @@ -52,7 +52,6 @@ export default class Ports extends Base { { title: t('ID/Name'), dataIndex: 'name', - stringify: (name, record) => name || record.id, routeName: this.getRouteName('routerPortDetail'), routeParamsFunc: (data) => ({ routeId: this.id, diff --git a/src/pages/network/containers/VirtualAdapter/Detail/SecurityGroups/index.jsx b/src/pages/network/containers/VirtualAdapter/Detail/SecurityGroups/index.jsx index 62355ff9..7685a013 100644 --- a/src/pages/network/containers/VirtualAdapter/Detail/SecurityGroups/index.jsx +++ b/src/pages/network/containers/VirtualAdapter/Detail/SecurityGroups/index.jsx @@ -68,7 +68,7 @@ export class SecurityGroup extends React.Component { const { security_groups: { data }, } = this.store; - const detailUrl = this.getDetailUrl(item); + const detailUrl = this.getDetailUrl(item.id); return ( diff --git a/src/pages/network/containers/VirtualAdapter/actions/ManageSecurityGroup.jsx b/src/pages/network/containers/VirtualAdapter/actions/ManageSecurityGroup.jsx index 22de6396..3c1046d1 100644 --- a/src/pages/network/containers/VirtualAdapter/actions/ManageSecurityGroup.jsx +++ b/src/pages/network/containers/VirtualAdapter/actions/ManageSecurityGroup.jsx @@ -21,6 +21,7 @@ import { securityGroupFilter, } from 'resources/security-group'; import { toJS } from 'mobx'; +import { get as _get } from 'lodash'; @inject('rootStore') @observer @@ -36,7 +37,9 @@ export default class ManageSecurityGroup extends ModalAction { static policy = 'update_port:port_security_enabled'; static allowed = (item) => - Promise.resolve(item.origin_data.allowed_address_pairs.length === 0); + Promise.resolve( + _get(item, 'origin_data.allowed_address_pairs', []).length === 0 + ); init() { this.securityGroupStore = new SecurityGroupStore();