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
This commit is contained in:
zhuyue 2021-09-01 16:05:01 +08:00
parent cd917640eb
commit 44b8a7d297
3 changed files with 14 additions and 10 deletions

View File

@ -5,6 +5,7 @@
"experimentalDecorators": true, "experimentalDecorators": true,
"paths": { "paths": {
"@/*": ["./src/*"], "@/*": ["./src/*"],
"client/*": ["./src/client/*"],
"src/*": ["./src/*"], "src/*": ["./src/*"],
"asset/*": ["./src/asset/*"], "asset/*": ["./src/asset/*"],
"image/*": ["./src/asset/image/*"], "image/*": ["./src/asset/image/*"],

View File

@ -17,6 +17,10 @@ import TableButton from 'components/TableButton';
import { getSelfColumns } from 'resources/security-group-rule'; import { getSelfColumns } from 'resources/security-group-rule';
export default class RuleButton extends Component { export default class RuleButton extends Component {
getUrl(path, adminStr) {
return this.isAdminPage ? `${path}${adminStr || '-admin'}` : path;
}
render() { render() {
const { item: { security_group_rules: datas = [] } = {} } = this.props; const { item: { security_group_rules: datas = [] } = {} } = this.props;
const configs = { const configs = {

View File

@ -124,7 +124,6 @@ export default class SecurityGroup extends React.Component {
render() { render() {
const { security_groups } = this.store; const { security_groups } = this.store;
return ( return (
<div className={classnames(styles.wrapper, this.className)}> <div className={classnames(styles.wrapper, this.className)}>
{this.isAdminPage ? null : ( {this.isAdminPage ? null : (
@ -136,8 +135,8 @@ export default class SecurityGroup extends React.Component {
/> />
</div> </div>
)} )}
{security_groups.data && security_groups.data.length !== 0 ? ( <Spin spinning={security_groups.isLoading}>
<Spin spinning={security_groups.isLoading}> {security_groups.data && security_groups.data.length !== 0 ? (
<Collapse <Collapse
className={styles.collapse} className={styles.collapse}
accordion accordion
@ -150,13 +149,13 @@ export default class SecurityGroup extends React.Component {
this.renderPanel(item, index) this.renderPanel(item, index)
)} )}
</Collapse> </Collapse>
</Spin> ) : (
) : ( <Empty
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE}
image={Empty.PRESENTED_IMAGE_SIMPLE} style={{ backgroundColor: 'white', padding: '32px 0' }}
style={{ backgroundColor: 'white', padding: '32px 0' }} />
/> )}
)} </Spin>
</div> </div>
); );
} }