From 44b8a7d2974ec355c2e082a5268e54a4db4dc80c Mon Sep 17 00:00:00 2001 From: zhuyue Date: Wed, 1 Sep 2021 16:05:01 +0800 Subject: [PATCH] fix: Fix for security groups 1. fix for security groups page in port detail 2. add loading for security groups in port detail Change-Id: I825050097ec763fa6ef6db2bbd9a2955e62f7a13 --- jsconfig.json | 1 + src/components/TableButton/RuleButton.jsx | 4 ++++ .../Detail/SecurityGroups/index.jsx | 19 +++++++++---------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/jsconfig.json b/jsconfig.json index 827a2714..a03e0f1c 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -5,6 +5,7 @@ "experimentalDecorators": true, "paths": { "@/*": ["./src/*"], + "client/*": ["./src/client/*"], "src/*": ["./src/*"], "asset/*": ["./src/asset/*"], "image/*": ["./src/asset/image/*"], diff --git a/src/components/TableButton/RuleButton.jsx b/src/components/TableButton/RuleButton.jsx index 3fd83769..5f3e3962 100644 --- a/src/components/TableButton/RuleButton.jsx +++ b/src/components/TableButton/RuleButton.jsx @@ -17,6 +17,10 @@ import TableButton from 'components/TableButton'; import { getSelfColumns } from 'resources/security-group-rule'; export default class RuleButton extends Component { + getUrl(path, adminStr) { + return this.isAdminPage ? `${path}${adminStr || '-admin'}` : path; + } + render() { const { item: { security_group_rules: datas = [] } = {} } = this.props; const configs = { diff --git a/src/pages/network/containers/VirtualAdapter/Detail/SecurityGroups/index.jsx b/src/pages/network/containers/VirtualAdapter/Detail/SecurityGroups/index.jsx index a5b8be4a..d70cce7e 100644 --- a/src/pages/network/containers/VirtualAdapter/Detail/SecurityGroups/index.jsx +++ b/src/pages/network/containers/VirtualAdapter/Detail/SecurityGroups/index.jsx @@ -124,7 +124,6 @@ export default class SecurityGroup extends React.Component { render() { const { security_groups } = this.store; - return (
{this.isAdminPage ? null : ( @@ -136,8 +135,8 @@ export default class SecurityGroup extends React.Component { />
)} - {security_groups.data && security_groups.data.length !== 0 ? ( - + + {security_groups.data && security_groups.data.length !== 0 ? ( - - ) : ( - - )} + ) : ( + + )} + ); }