fix: Fix volume type quota of project in administrator
1. Fix volume type quota in project detail page 2. Fix volume type quota in manage quota action 3. Update module export Change-Id: I17795422508e5a61e6f12903808586e1f940030b
This commit is contained in:
parent
d9b940f5ae
commit
1aaff3bab3
@ -19,14 +19,10 @@ import globalProjectStore from 'stores/keystone/project';
|
|||||||
import { Card, Col, Row, List } from 'antd';
|
import { Card, Col, Row, List } from 'antd';
|
||||||
import Progress from 'components/ProjectProgress';
|
import Progress from 'components/ProjectProgress';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import globalVolumeTypeStore from 'stores/cinder/volume-type';
|
import { VolumeTypeStore } from 'stores/cinder/volume-type';
|
||||||
import styles from './index.less';
|
import styles from './index.less';
|
||||||
|
|
||||||
// const { Panel } = Collapse;
|
export class Quota extends React.Component {
|
||||||
|
|
||||||
@inject('rootStore')
|
|
||||||
@observer
|
|
||||||
export default class Quota extends React.Component {
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {};
|
this.state = {};
|
||||||
@ -42,7 +38,7 @@ export default class Quota extends React.Component {
|
|||||||
await this.store.fetchProjectQuota({
|
await this.store.fetchProjectQuota({
|
||||||
project_id,
|
project_id,
|
||||||
});
|
});
|
||||||
await globalVolumeTypeStore.fetchList();
|
await this.volumeTypeStore.fetchProjectVolumeTypes(project_id);
|
||||||
};
|
};
|
||||||
|
|
||||||
getItemInfo = (i) => {
|
getItemInfo = (i) => {
|
||||||
@ -53,6 +49,7 @@ export default class Quota extends React.Component {
|
|||||||
|
|
||||||
init() {
|
init() {
|
||||||
this.store = globalProjectStore;
|
this.store = globalProjectStore;
|
||||||
|
this.volumeTypeStore = new VolumeTypeStore();
|
||||||
}
|
}
|
||||||
|
|
||||||
renderVolumeTypes = (listData) => (
|
renderVolumeTypes = (listData) => (
|
||||||
@ -80,7 +77,7 @@ export default class Quota extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
const { quota } = this.store;
|
const { quota } = this.store;
|
||||||
const volumeTypes = [];
|
const volumeTypes = [];
|
||||||
globalVolumeTypeStore.list.data.forEach((item, index) => {
|
this.volumeTypeStore.projectVolumeTypes.forEach((item, index) => {
|
||||||
volumeTypes.push({
|
volumeTypes.push({
|
||||||
index,
|
index,
|
||||||
value: [
|
value: [
|
||||||
@ -193,3 +190,5 @@ export default class Quota extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default inject('rootStore')(observer(Quota));
|
||||||
|
@ -16,7 +16,7 @@ import { inject, observer } from 'mobx-react';
|
|||||||
import globalProjectStore from 'stores/keystone/project';
|
import globalProjectStore from 'stores/keystone/project';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ModalAction } from 'containers/Action';
|
import { ModalAction } from 'containers/Action';
|
||||||
import globalVolumeTypeStore from 'stores/cinder/volume-type';
|
import { VolumeTypeStore } from 'stores/cinder/volume-type';
|
||||||
|
|
||||||
export class QuotaManager extends ModalAction {
|
export class QuotaManager extends ModalAction {
|
||||||
static id = 'quota-management';
|
static id = 'quota-management';
|
||||||
@ -25,6 +25,7 @@ export class QuotaManager extends ModalAction {
|
|||||||
|
|
||||||
init() {
|
init() {
|
||||||
this.store = globalProjectStore;
|
this.store = globalProjectStore;
|
||||||
|
this.volumeTypeStore = new VolumeTypeStore();
|
||||||
// this.getQuota();
|
// this.getQuota();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,7 +42,7 @@ export class QuotaManager extends ModalAction {
|
|||||||
await this.store.fetchProjectQuota({
|
await this.store.fetchProjectQuota({
|
||||||
project_id,
|
project_id,
|
||||||
});
|
});
|
||||||
await globalVolumeTypeStore.fetchList();
|
await this.volumeTypeStore.fetchProjectVolumeTypes(project_id);
|
||||||
};
|
};
|
||||||
|
|
||||||
get tips() {
|
get tips() {
|
||||||
@ -63,9 +64,7 @@ export class QuotaManager extends ModalAction {
|
|||||||
|
|
||||||
get volumeTypesData() {
|
get volumeTypesData() {
|
||||||
const volumeTypes = [];
|
const volumeTypes = [];
|
||||||
const {
|
const { projectVolumeTypes: data = [] } = this.volumeTypeStore;
|
||||||
list: { data },
|
|
||||||
} = globalVolumeTypeStore;
|
|
||||||
if (data[0] && this.formRef.current) {
|
if (data[0] && this.formRef.current) {
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
volumeTypes.push.apply(volumeTypes, [
|
volumeTypes.push.apply(volumeTypes, [
|
||||||
@ -365,7 +364,7 @@ export class QuotaManager extends ModalAction {
|
|||||||
const { id: project_id } = this.item;
|
const { id: project_id } = this.item;
|
||||||
const { more, cinder, networks, cinder_types, nova, security, ...others } =
|
const { more, cinder, networks, cinder_types, nova, security, ...others } =
|
||||||
values;
|
values;
|
||||||
const results = globalProjectStore.updateProjectQuota({
|
const results = this.store.updateProjectQuota({
|
||||||
project_id,
|
project_id,
|
||||||
data: others,
|
data: others,
|
||||||
});
|
});
|
||||||
|
@ -19,9 +19,7 @@ import { NetworkStore } from 'stores/neutron/network';
|
|||||||
import { yesNoOptions } from 'utils/constants';
|
import { yesNoOptions } from 'utils/constants';
|
||||||
import actionConfigs from './actions';
|
import actionConfigs from './actions';
|
||||||
|
|
||||||
@inject('rootStore')
|
export class Networks extends Base {
|
||||||
@observer
|
|
||||||
export default class Networks extends Base {
|
|
||||||
init() {
|
init() {
|
||||||
this.store = new NetworkStore();
|
this.store = new NetworkStore();
|
||||||
this.downloadStore = new NetworkStore();
|
this.downloadStore = new NetworkStore();
|
||||||
@ -97,3 +95,5 @@ export default class Networks extends Base {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default inject('rootStore')(observer(Networks));
|
||||||
|
@ -22,9 +22,7 @@ import Subnets from './Subnets';
|
|||||||
import Detail from './Detail';
|
import Detail from './Detail';
|
||||||
import actionConfigs from '../actions';
|
import actionConfigs from '../actions';
|
||||||
|
|
||||||
@inject('rootStore')
|
export class NetworkDetail extends Base {
|
||||||
@observer
|
|
||||||
export default class NetworkDetail extends Base {
|
|
||||||
get name() {
|
get name() {
|
||||||
return t('network');
|
return t('network');
|
||||||
}
|
}
|
||||||
@ -157,3 +155,5 @@ export default class NetworkDetail extends Base {
|
|||||||
this.store = new NetworkStore();
|
this.store = new NetworkStore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default inject('rootStore')(observer(NetworkDetail));
|
||||||
|
@ -19,9 +19,7 @@ import { NetworkStore } from 'stores/neutron/network';
|
|||||||
import { yesNoOptions } from 'utils/constants';
|
import { yesNoOptions } from 'utils/constants';
|
||||||
import actionConfigs from './actions';
|
import actionConfigs from './actions';
|
||||||
|
|
||||||
@inject('rootStore')
|
export class ExtNetwork extends Base {
|
||||||
@observer
|
|
||||||
export default class ExtNetwork extends Base {
|
|
||||||
init() {
|
init() {
|
||||||
this.store = new NetworkStore();
|
this.store = new NetworkStore();
|
||||||
this.downloadStore = new NetworkStore();
|
this.downloadStore = new NetworkStore();
|
||||||
@ -88,3 +86,5 @@ export default class ExtNetwork extends Base {
|
|||||||
return filters;
|
return filters;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default inject('rootStore')(observer(ExtNetwork));
|
||||||
|
@ -19,9 +19,7 @@ import { NetworkStore } from 'stores/neutron/network';
|
|||||||
import { yesNoOptions } from 'utils/constants';
|
import { yesNoOptions } from 'utils/constants';
|
||||||
import actionConfigs from './actions';
|
import actionConfigs from './actions';
|
||||||
|
|
||||||
@inject('rootStore')
|
export class ProjectNetwork extends Base {
|
||||||
@observer
|
|
||||||
export default class ProjectNetwork extends Base {
|
|
||||||
init() {
|
init() {
|
||||||
this.store = new NetworkStore();
|
this.store = new NetworkStore();
|
||||||
this.downloadStore = new NetworkStore();
|
this.downloadStore = new NetworkStore();
|
||||||
@ -85,3 +83,5 @@ export default class ProjectNetwork extends Base {
|
|||||||
return filters;
|
return filters;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default inject('rootStore')(observer(ProjectNetwork));
|
||||||
|
@ -19,9 +19,7 @@ import { NetworkStore } from 'stores/neutron/network';
|
|||||||
import { yesNoOptions } from 'utils/constants';
|
import { yesNoOptions } from 'utils/constants';
|
||||||
import actionConfigs from './actions';
|
import actionConfigs from './actions';
|
||||||
|
|
||||||
@inject('rootStore')
|
export class SharedNetwork extends Base {
|
||||||
@observer
|
|
||||||
export default class SharedNetwork extends Base {
|
|
||||||
init() {
|
init() {
|
||||||
this.store = new NetworkStore();
|
this.store = new NetworkStore();
|
||||||
this.downloadStore = new NetworkStore();
|
this.downloadStore = new NetworkStore();
|
||||||
@ -88,3 +86,5 @@ export default class SharedNetwork extends Base {
|
|||||||
return filters;
|
return filters;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default inject('rootStore')(observer(SharedNetwork));
|
||||||
|
@ -40,9 +40,7 @@ const { isIpCidr, isIPv6Cidr, isIpv6 } = ipValidate;
|
|||||||
|
|
||||||
const { nameValidateWithoutChinese } = nameTypeValidate;
|
const { nameValidateWithoutChinese } = nameTypeValidate;
|
||||||
|
|
||||||
@inject('rootStore')
|
export class CreateNetwork extends ModalAction {
|
||||||
@observer
|
|
||||||
export default class CreateNetwork extends ModalAction {
|
|
||||||
static id = 'create-network';
|
static id = 'create-network';
|
||||||
|
|
||||||
static title = t('Create Network');
|
static title = t('Create Network');
|
||||||
@ -566,3 +564,5 @@ export default class CreateNetwork extends ModalAction {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default inject('rootStore')(observer(CreateNetwork));
|
||||||
|
@ -24,9 +24,7 @@ const portTypeItems = portTypes.split(',').map((item) => ({
|
|||||||
value: item,
|
value: item,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@inject('rootStore')
|
export class Edit extends ModalAction {
|
||||||
@observer
|
|
||||||
export default class Edit extends ModalAction {
|
|
||||||
static id = 'edit-virtual-adapter';
|
static id = 'edit-virtual-adapter';
|
||||||
|
|
||||||
static title = t('Edit');
|
static title = t('Edit');
|
||||||
@ -112,3 +110,5 @@ export default class Edit extends ModalAction {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default inject('rootStore')(observer(Edit));
|
||||||
|
Loading…
Reference in New Issue
Block a user