Merge "fix: fix edit image"
This commit is contained in:
commit
6f85b82b41
@ -1132,6 +1132,7 @@
|
||||
"If nova-compute on the host is disabled, it will be forbidden to be selected as the target host.": "If nova-compute on the host is disabled, it will be forbidden to be selected as the target host.",
|
||||
"If set then all tenants will be able to see this share.": "If set then all tenants will be able to see this share.",
|
||||
"If the capacity of the disk is large,the type modify operation may takes several hours. Please be cautious.": "If the capacity of the disk is large,the type modify operation may takes several hours. Please be cautious.",
|
||||
"If the value is set to 0, it means unlimited": "If the value is set to 0, it means unlimited",
|
||||
"If the volume associated with the snapshot has changed the volume type, please modify this option manually; if the volume associated with the snapshot keeps the volume type unchanged, please ignore this option. (no need to change).": "If the volume associated with the snapshot has changed the volume type, please modify this option manually; if the volume associated with the snapshot keeps the volume type unchanged, please ignore this option. (no need to change).",
|
||||
"If you are not authorized to access any project, or if the project you are involved in has been deleted or disabled, contact the platform administrator to reassign the project": "If you are not authorized to access any project, or if the project you are involved in has been deleted or disabled, contact the platform administrator to reassign the project",
|
||||
"If you are not sure which authentication method to use, please contact your administrator.": "If you are not sure which authentication method to use, please contact your administrator.",
|
||||
|
@ -1132,6 +1132,7 @@
|
||||
"If nova-compute on the host is disabled, it will be forbidden to be selected as the target host.": "如果计算节点上的nova-compute被禁用,将禁止其作为目标节点。",
|
||||
"If set then all tenants will be able to see this share.": "如果设置,则所有租户都将能够看到此共享。",
|
||||
"If the capacity of the disk is large,the type modify operation may takes several hours. Please be cautious.": "如果云硬盘容量较大,修改云硬盘类型可能需要花费几个小时,请您谨慎操作。",
|
||||
"If the value is set to 0, it means unlimited": "如果值为0,则表示无限制",
|
||||
"If the volume associated with the snapshot has changed the volume type, please modify this option manually; if the volume associated with the snapshot keeps the volume type unchanged, please ignore this option. (no need to change).": "若快照关联的云硬盘修改过云硬盘类型,请手动修改此选项;若快照关联的云硬盘保持云硬盘类型不变,请忽略此选项(不需要做变更)。",
|
||||
"If you are not authorized to access any project, or if the project you are involved in has been deleted or disabled, contact the platform administrator to reassign the project": "您未被授权访问任何项目,或您参与中的项目已被删除或禁用,可联系平台管理员重新分配项目",
|
||||
"If you are not sure which authentication method to use, please contact your administrator.": "如果您不确定使用哪种认证方式,请联系管理员。",
|
||||
|
@ -321,6 +321,7 @@ export class CreateForm extends FormAction {
|
||||
type: 'select',
|
||||
options: getOptionsWithNoSet(cpuPolicyList),
|
||||
hidden: !more,
|
||||
required: more,
|
||||
},
|
||||
{
|
||||
name: 'hw_cpu_thread_policy',
|
||||
@ -328,6 +329,7 @@ export class CreateForm extends FormAction {
|
||||
type: 'select',
|
||||
options: getOptionsWithNoSet(cpuThreadPolicyList),
|
||||
hidden: !more,
|
||||
required: more,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ import { inject, observer } from 'mobx-react';
|
||||
import { ModalAction } from 'containers/Action';
|
||||
import globalImageStore from 'stores/glance/image';
|
||||
import { imageOS, isOwner } from 'resources/glance/image';
|
||||
import { has, get } from 'lodash';
|
||||
import { has, get, isNumber } from 'lodash';
|
||||
import { isActive } from 'resources/nova/instance';
|
||||
import { NoSetValue, getOptionsWithNoSet } from 'utils/index';
|
||||
import { cpuPolicyList, cpuThreadPolicyList } from 'resources/nova/flavor';
|
||||
@ -93,6 +93,7 @@ export class Edit extends ModalAction {
|
||||
|
||||
get formItems() {
|
||||
const { more } = this.state;
|
||||
const zeroTip = t('If the value is set to 0, it means unlimited');
|
||||
return [
|
||||
{
|
||||
name: 'name',
|
||||
@ -130,6 +131,8 @@ export class Edit extends ModalAction {
|
||||
min: 0,
|
||||
max: 500,
|
||||
display: this.enableCinder,
|
||||
required: this.enableCinder,
|
||||
extra: this.enableCinder ? zeroTip : null,
|
||||
},
|
||||
{
|
||||
name: 'min_ram',
|
||||
@ -137,6 +140,8 @@ export class Edit extends ModalAction {
|
||||
type: 'input-int',
|
||||
min: 0,
|
||||
max: 500,
|
||||
required: true,
|
||||
extra: zeroTip,
|
||||
},
|
||||
{
|
||||
name: 'visibility',
|
||||
@ -179,6 +184,7 @@ export class Edit extends ModalAction {
|
||||
type: 'select',
|
||||
options: getOptionsWithNoSet(cpuPolicyList),
|
||||
hidden: !more,
|
||||
required: more,
|
||||
},
|
||||
{
|
||||
name: 'hw_cpu_thread_policy',
|
||||
@ -186,6 +192,7 @@ export class Edit extends ModalAction {
|
||||
type: 'select',
|
||||
options: getOptionsWithNoSet(cpuThreadPolicyList),
|
||||
hidden: !more,
|
||||
required: more,
|
||||
},
|
||||
];
|
||||
}
|
||||
@ -198,6 +205,7 @@ export class Edit extends ModalAction {
|
||||
hw_cpu_policy,
|
||||
hw_cpu_thread_policy,
|
||||
min_ram,
|
||||
min_disk,
|
||||
...rest
|
||||
} = values;
|
||||
const newValues = {
|
||||
@ -205,7 +213,7 @@ export class Edit extends ModalAction {
|
||||
visibility: visibility ? 'public' : 'private',
|
||||
...rest,
|
||||
};
|
||||
if (min_ram) {
|
||||
if (isNumber(min_ram)) {
|
||||
newValues.min_ram = min_ram * 1024;
|
||||
}
|
||||
if (hw_cpu_policy !== NoSetValue) {
|
||||
|
Loading…
Reference in New Issue
Block a user