fix: Fix the root disk in flavor

Allow set root disk size in flavor creating when no-cinder

Change-Id: Ia68f1c804c2aa359893ffba8344fa5990d368210
This commit is contained in:
xusongfu 2022-06-20 14:04:13 +08:00
parent 549e75d011
commit 2e0d504594
5 changed files with 17 additions and 2 deletions

View File

@ -1929,6 +1929,7 @@
"Rollback In Progress": "Rollback In Progress",
"Romania": "Romania",
"Root Disk": "Root Disk",
"Root Disk(GiB)": "Root Disk(GiB)",
"Root directory": "Root directory",
"Router": "Router",
"Router Advertisements Mode": "Router Advertisements Mode",

View File

@ -1929,6 +1929,7 @@
"Rollback In Progress": "回滚中",
"Romania": "罗马尼亚",
"Root Disk": "系统盘",
"Root Disk(GiB)": "根磁盘 (GiB)",
"Root directory": "根目录",
"Router": "路由器",
"Router Advertisements Mode": "路由广播模式",

View File

@ -154,7 +154,7 @@ export class BaseDetail extends Base {
get diskCard() {
const options = [
{
label: t('Disk'),
label: t('Root Disk(GiB)'),
dataIndex: 'disk',
},
];

View File

@ -152,6 +152,7 @@ export class ParamSetting extends Base {
settings: toJS(this.settingStore.list.data || []),
ephemeral: 0,
ephemeralTmp: 0,
disk: 0,
architecture: this.tab,
attachUsb: false,
resourceProps: this.getDefaultResourcePropValues(),
@ -180,6 +181,10 @@ export class ParamSetting extends Base {
];
}
get enableCinder() {
return this.props.rootStore.checkEndpoint('cinder');
}
allowed = () => Promise.resolve();
numaValidate = ({ getFieldValue }) => ({
@ -382,6 +387,13 @@ export class ParamSetting extends Base {
hidden: isBareMetal || hasEphemeral,
disabled: !hasEphemeral,
},
{
name: 'disk',
label: t('Root Disk(GiB)'),
type: 'input-int',
min: 0,
hidden: this.enableCinder,
},
{
name: 'iops',
label: t('Storage IOPS'),

View File

@ -122,12 +122,13 @@ export class StepCreate extends StepAction {
accessControl = {},
resourceProps,
traitProps,
disk,
} = values;
const body = {
name,
vcpus,
ram: memoryGb * 1024,
disk: 0,
disk: disk || 0,
};
const isPublic = accessType === 'public';
body['os-flavor-access:is_public'] = isPublic;