diff --git a/src/components/TableButton/RuleButton.jsx b/src/components/TableButton/RuleButton.jsx
index 5f3e3962..f6eff753 100644
--- a/src/components/TableButton/RuleButton.jsx
+++ b/src/components/TableButton/RuleButton.jsx
@@ -21,6 +21,10 @@ export default class RuleButton extends Component {
return this.isAdminPage ? `${path}${adminStr || '-admin'}` : path;
}
+ getDetailUrl(id) {
+ return `${this.getUrl('/network/security-group')}/detail/${id}`;
+ }
+
render() {
const { item: { security_group_rules: datas = [] } = {} } = this.props;
const configs = {
diff --git a/src/pages/compute/containers/Flavor/Arm/index.jsx b/src/pages/compute/containers/Flavor/Arm/index.jsx
index f4241ba4..4fc05ced 100644
--- a/src/pages/compute/containers/Flavor/Arm/index.jsx
+++ b/src/pages/compute/containers/Flavor/Arm/index.jsx
@@ -68,4 +68,4 @@ export class Flavor extends Base {
}
}
-export default inject('rootStore')(observer(Flavor));
\ No newline at end of file
+export default inject('rootStore')(observer(Flavor));
diff --git a/src/pages/compute/containers/Flavor/Detail/index.jsx b/src/pages/compute/containers/Flavor/Detail/index.jsx
index 84654bcd..ca174d58 100644
--- a/src/pages/compute/containers/Flavor/Detail/index.jsx
+++ b/src/pages/compute/containers/Flavor/Detail/index.jsx
@@ -21,9 +21,7 @@ import { emptyActionConfig } from 'utils/constants';
import actionConfigs from '../actions';
import BaseDetail from './BaseDetail';
-@inject('rootStore')
-@observer
-export default class Detail extends Base {
+export class Detail extends Base {
get name() {
return t('flavor');
}
@@ -96,3 +94,5 @@ export default class Detail extends Base {
this.store = new FlavorStore();
}
}
+
+export default inject('rootStore')(observer(Detail));
diff --git a/src/pages/compute/containers/Instance/Detail/SecurityGroup/index.jsx b/src/pages/compute/containers/Instance/Detail/SecurityGroup/index.jsx
index 5ab5cb92..4ab63dc1 100644
--- a/src/pages/compute/containers/Instance/Detail/SecurityGroup/index.jsx
+++ b/src/pages/compute/containers/Instance/Detail/SecurityGroup/index.jsx
@@ -68,6 +68,10 @@ export class SecurityGroup extends React.Component {
return this.isAdminPage ? `${path}${adminStr || '-admin'}` : path;
}
+ getDetailUrl(id) {
+ return `${this.getUrl('/network/security-group')}/detail/${id}`;
+ }
+
actionCallback = async (first) => {
const {
match: {
diff --git a/src/pages/identity/containers/Project/actions/Create.jsx b/src/pages/identity/containers/Project/actions/Create.jsx
index a5c4daa4..ae66e9ed 100644
--- a/src/pages/identity/containers/Project/actions/Create.jsx
+++ b/src/pages/identity/containers/Project/actions/Create.jsx
@@ -19,7 +19,7 @@ import globalProjectStore from 'stores/keystone/project';
import { regex } from 'utils/validate';
import { statusTypes } from 'utils/constants';
-class CreateForm extends ModalAction {
+export class CreateForm extends ModalAction {
constructor(props) {
super(props);
this.state = {
diff --git a/src/pages/identity/containers/Project/actions/Edit.jsx b/src/pages/identity/containers/Project/actions/Edit.jsx
index 85cf2b06..52609f94 100644
--- a/src/pages/identity/containers/Project/actions/Edit.jsx
+++ b/src/pages/identity/containers/Project/actions/Edit.jsx
@@ -17,7 +17,7 @@ import { ModalAction } from 'containers/Action';
import globalProjectStore from 'stores/keystone/project';
import { statusTypes } from 'utils/constants';
-class EditForm extends ModalAction {
+export class EditForm extends ModalAction {
init() {
this.store = globalProjectStore;
this.store.fetchList();
diff --git a/src/pages/identity/containers/Project/index.jsx b/src/pages/identity/containers/Project/index.jsx
index 0fe086a7..aec7d65e 100644
--- a/src/pages/identity/containers/Project/index.jsx
+++ b/src/pages/identity/containers/Project/index.jsx
@@ -18,13 +18,10 @@ import { Divider, Badge, Tag, Tooltip } from 'antd';
import Base from 'containers/List';
import globalProjectStore from 'stores/keystone/project';
import { yesNoOptions, projectTagsColors } from 'utils/constants';
-
import actionConfigs from './actions';
import styles from './index.less';
-@inject('rootStore')
-@observer
-export default class Projects extends Base {
+export class Projects extends Base {
init() {
this.store = globalProjectStore;
}
@@ -222,3 +219,5 @@ export default class Projects extends Base {
this.list.silent = false;
}
}
+
+export default inject('rootStore')(observer(Projects));
diff --git a/src/pages/identity/containers/User/actions/Create.jsx b/src/pages/identity/containers/User/actions/Create.jsx
index 88796866..bf08be92 100644
--- a/src/pages/identity/containers/User/actions/Create.jsx
+++ b/src/pages/identity/containers/User/actions/Create.jsx
@@ -28,7 +28,7 @@ import {
} from 'utils/validate';
import { statusTypes } from 'utils/constants';
-class CreateForm extends FormAction {
+export class CreateForm extends FormAction {
constructor(props) {
super(props);
diff --git a/src/pages/identity/containers/User/actions/Edit.jsx b/src/pages/identity/containers/User/actions/Edit.jsx
index 3e670d3c..6744e7bf 100644
--- a/src/pages/identity/containers/User/actions/Edit.jsx
+++ b/src/pages/identity/containers/User/actions/Edit.jsx
@@ -18,7 +18,7 @@ import globalUserStore from 'stores/keystone/user';
import globalDomainStore from 'stores/keystone/domain';
import { phoneNumberValidate, emailValidate } from 'utils/validate';
-class EditForm extends ModalAction {
+export class EditForm extends ModalAction {
init() {
this.store = globalUserStore;
this.domainStore = globalDomainStore;
diff --git a/src/pages/network/containers/FloatingIp/Detail/index.jsx b/src/pages/network/containers/FloatingIp/Detail/index.jsx
index 4b9c9fc2..d11af786 100644
--- a/src/pages/network/containers/FloatingIp/Detail/index.jsx
+++ b/src/pages/network/containers/FloatingIp/Detail/index.jsx
@@ -21,9 +21,7 @@ import actionConfigs from '../actions';
import BaseDetail from './BaseDetail';
import PortForwarding from './PortForwarding';
-@inject('rootStore')
-@observer
-export default class FloatingIpDetail extends Base {
+export class FloatingIpDetail extends Base {
get name() {
return t('floating ip');
}
@@ -92,3 +90,5 @@ export default class FloatingIpDetail extends Base {
this.store = new FloatingIpStore();
}
}
+
+export default inject('rootStore')(observer(FloatingIpDetail));
diff --git a/src/pages/network/containers/FloatingIp/actions/Allocate.jsx b/src/pages/network/containers/FloatingIp/actions/Allocate.jsx
index e8603daa0..4d7700d8 100644
--- a/src/pages/network/containers/FloatingIp/actions/Allocate.jsx
+++ b/src/pages/network/containers/FloatingIp/actions/Allocate.jsx
@@ -226,4 +226,4 @@ export class Allocate extends ModalAction {
}
}
-export default inject('rootStore')(observer(Allocate));
\ No newline at end of file
+export default inject('rootStore')(observer(Allocate));
diff --git a/src/pages/network/containers/Router/index.jsx b/src/pages/network/containers/Router/index.jsx
index c682a2b7..a4361951 100644
--- a/src/pages/network/containers/Router/index.jsx
+++ b/src/pages/network/containers/Router/index.jsx
@@ -61,4 +61,4 @@ export class Routes extends Base {
}
}
-export default inject('rootStore')(observer(Routes));
\ No newline at end of file
+export default inject('rootStore')(observer(Routes));
diff --git a/src/pages/network/containers/SecurityGroup/Detail/Rule/index.jsx b/src/pages/network/containers/SecurityGroup/Detail/Rule/index.jsx
index a7527f35..3c140a50 100644
--- a/src/pages/network/containers/SecurityGroup/Detail/Rule/index.jsx
+++ b/src/pages/network/containers/SecurityGroup/Detail/Rule/index.jsx
@@ -31,6 +31,10 @@ export class Rule extends Base {
return t('security group rules');
}
+ getDetailUrl(id) {
+ return `${this.getUrl('/network/security-group')}/detail/${id}`;
+ }
+
getColumns = () => getSelfColumns(this);
get actionConfigs() {
diff --git a/src/pages/network/containers/VirtualAdapter/Detail/SecurityGroups/index.jsx b/src/pages/network/containers/VirtualAdapter/Detail/SecurityGroups/index.jsx
index d70cce7e..373bb2f8 100644
--- a/src/pages/network/containers/VirtualAdapter/Detail/SecurityGroups/index.jsx
+++ b/src/pages/network/containers/VirtualAdapter/Detail/SecurityGroups/index.jsx
@@ -30,9 +30,7 @@ import styles from './index.less';
const { Panel } = Collapse;
-@inject('rootStore')
-@observer
-export default class SecurityGroup extends React.Component {
+export class SecurityGroup extends React.Component {
constructor(props) {
super(props);
this.store = new VirtualAdapterStore();
@@ -46,6 +44,10 @@ export default class SecurityGroup extends React.Component {
return this.isAdminPage ? `${path}${adminStr || '-admin'}` : path;
}
+ getDetailUrl(id) {
+ return `${this.getUrl('/network/security-group')}/detail/${id}`;
+ }
+
get portId() {
const {
detail: { id },
@@ -66,6 +68,7 @@ export default class SecurityGroup extends React.Component {
const {
security_groups: { data },
} = this.store;
+ const detailUrl = this.getDetailUrl(item);
return (
),
- // },
- // {
- // title: t('Floating IP'),
- // dataIndex: 'addresses',
- // render: (addresses) => {
- // if (!addresses || !addresses['pub-net']) {
- // return '-';
- // }
- // return addresses['pub-net'].map(it => {it.addr}
);
- // },
- // },
- // {
- // title: t('Flavor'),
- // dataIndex: 'flavor',
- // render: flavor => `${flavor.disk}G/${Number.parseInt(flavor.ram / 1024, 10)}G`,
- // },
- // {
- // title: t('Created At'),
- // dataIndex: 'created',
- // valueRender: 'sinceTime',
- // },
],
},
];
@@ -151,3 +115,5 @@ export default class Detach extends ModalAction {
);
};
}
+
+export default inject('rootStore')(observer(Detach));
diff --git a/src/pages/storage/containers/Volume/actions/ExtendVolume.jsx b/src/pages/storage/containers/Volume/actions/ExtendVolume.jsx
index 4cc7e138..afbc1ec2 100644
--- a/src/pages/storage/containers/Volume/actions/ExtendVolume.jsx
+++ b/src/pages/storage/containers/Volume/actions/ExtendVolume.jsx
@@ -78,7 +78,7 @@ export class ExtendVolume extends ModalAction {
}
onSubmit = async (values) => {
- const { volume, ...rest } = values;
+ const { new_size } = values;
const { id } = this.item;
const instanceId = get(this.item, 'attachments[0].server_id');
@@ -99,7 +99,7 @@ export class ExtendVolume extends ModalAction {
return;
}
}
- return this.store.extendSize(id, rest);
+ return this.store.extendSize(id, { new_size });
};
}
diff --git a/src/pages/storage/containers/Volume/index.jsx b/src/pages/storage/containers/Volume/index.jsx
index 3401668c..17e4968a 100644
--- a/src/pages/storage/containers/Volume/index.jsx
+++ b/src/pages/storage/containers/Volume/index.jsx
@@ -12,27 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-import React from 'react';
-import { Link } from 'react-router-dom';
import { observer, inject } from 'mobx-react';
import Base from 'containers/List';
import {
- volumeStatus,
- diskTag,
volumeTransitionStatuses,
- bootableType,
volumeFilters,
- multiTip,
+ getVolumnColumnsList,
} from 'resources/volume';
import globalVolumeStore, { VolumeStore } from 'stores/cinder/volume';
import { InstanceVolumeStore } from 'stores/nova/instance-volume';
-import { toLocalTimeFilter } from 'utils/index';
import { emptyActionConfig } from 'utils/constants';
import actionConfigs from './actions';
-@inject('rootStore')
-@observer
-export default class Volume extends Base {
+export class Volume extends Base {
init() {
if (this.inDetailPage) {
this.store = new InstanceVolumeStore();
@@ -91,113 +83,7 @@ export default class Volume extends Base {
}
getColumns = () => {
- const columns = [
- {
- title: t('ID/Name'),
- dataIndex: 'name',
- linkPrefix: `/storage/${this.getUrl('volume')}/detail`,
- stringify: (name, record) => name || record.id,
- sortKey: 'name',
- },
- {
- title: t('Project ID/Name'),
- dataIndex: 'project_name',
- hidden: !this.isAdminPage,
- isHideable: true,
- sorter: false,
- },
- {
- title: t('Host'),
- dataIndex: 'host',
- isHideable: true,
- hidden: !this.isAdminPage,
- sorter: false,
- },
- {
- title: t('Size'),
- dataIndex: 'size',
- isHideable: true,
- render: (value) => `${value}GB`,
- },
- {
- title: t('Status'),
- dataIndex: 'status',
- render: (value) => volumeStatus[value] || '-',
- },
- {
- title: t('Type'),
- dataIndex: 'volume_type',
- isHideable: true,
- width: 100,
- sorter: false,
- },
- {
- title: t('Disk Tag'),
- dataIndex: 'disk_tag',
- isHideable: true,
- render: (value) => diskTag[value] || '-',
- sorter: false,
- },
- {
- title: t('Attached To'),
- dataIndex: 'attachments',
- isHideable: true,
- sorter: false,
- render: (value) => {
- if (value && value.length > 0) {
- return value.map((it) => (
-