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
This commit is contained in:
xusongfu 2022-02-23 22:37:01 +08:00
parent 10c3abdc4b
commit 088c38e65c
3 changed files with 5 additions and 3 deletions

View File

@ -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,

View File

@ -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 (
<Row>
<Col span={18}>

View File

@ -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();