Merge "fix: fix create zun container"
This commit is contained in:
commit
e564616aa9
@ -111,7 +111,7 @@ export const apiVersionMaps = {
|
|||||||
},
|
},
|
||||||
zun: {
|
zun: {
|
||||||
key: 'OpenStack-API-Version',
|
key: 'OpenStack-API-Version',
|
||||||
value: 'container 1.7',
|
value: 'container 1.11',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -27,28 +27,28 @@ export default class ZunVolume extends React.Component {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
type: [],
|
type: '',
|
||||||
source: [],
|
source: '',
|
||||||
destination: '',
|
destination: '',
|
||||||
cinderVolumeSize: 0,
|
size: 0,
|
||||||
isCinderVolume: false,
|
isNewVolume: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static getDerivedStateFromProps(nextProps, prevState) {
|
static getDerivedStateFromProps(nextProps, prevState) {
|
||||||
const { type, source, cinderVolumeSize, destination } =
|
const { type, source, size, destination } = nextProps.value || {};
|
||||||
nextProps.value || {};
|
|
||||||
if (
|
if (
|
||||||
type !== prevState.type ||
|
type !== prevState.type ||
|
||||||
source !== prevState.source ||
|
source !== prevState.source ||
|
||||||
cinderVolumeSize !== prevState.cinderVolumeSize ||
|
size !== prevState.size ||
|
||||||
destination !== prevState.destination
|
destination !== prevState.destination
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
type,
|
type,
|
||||||
source,
|
source,
|
||||||
cinderVolumeSize,
|
size,
|
||||||
destination,
|
destination,
|
||||||
|
isNewVolume: type === 'volume',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -62,20 +62,17 @@ export default class ZunVolume extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onTypeChange = (value) => {
|
onTypeChange = (value) => {
|
||||||
if (value === 'cinder-new') {
|
this.setState(
|
||||||
this.setState({
|
{
|
||||||
isCinderVolume: true,
|
isNewVolume: value === 'volume',
|
||||||
});
|
},
|
||||||
}
|
() => {
|
||||||
if (value === 'cinder-available') {
|
this.onChange({
|
||||||
this.setState({
|
...this.state,
|
||||||
isCinderVolume: false,
|
type: value,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.onChange({
|
);
|
||||||
...this.state,
|
|
||||||
type: value,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onSourceChange = (value) => {
|
onSourceChange = (value) => {
|
||||||
@ -85,10 +82,10 @@ export default class ZunVolume extends React.Component {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onCinderVolumeSizeChange = (e) => {
|
onVolumeSizeChange = (e) => {
|
||||||
this.onChange({
|
this.onChange({
|
||||||
...this.state,
|
...this.state,
|
||||||
cinderVolumeSize: e,
|
size: e,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -100,9 +97,7 @@ export default class ZunVolume extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { type, source, destination, cinderVolumeSize, isCinderVolume } =
|
const { type, source, destination, size, isNewVolume } = this.state;
|
||||||
this.state;
|
|
||||||
const { name } = this.props;
|
|
||||||
const selectType = (
|
const selectType = (
|
||||||
<Select
|
<Select
|
||||||
value={type}
|
value={type}
|
||||||
@ -124,8 +119,8 @@ export default class ZunVolume extends React.Component {
|
|||||||
);
|
);
|
||||||
const inputSize = (
|
const inputSize = (
|
||||||
<InputInt
|
<InputInt
|
||||||
value={cinderVolumeSize}
|
value={size}
|
||||||
onChange={this.onCinderVolumeSizeChange}
|
onChange={this.onVolumeSizeChange}
|
||||||
style={{ maxWidth: '40%' }}
|
style={{ maxWidth: '40%' }}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
@ -134,22 +129,23 @@ export default class ZunVolume extends React.Component {
|
|||||||
value={destination}
|
value={destination}
|
||||||
onChange={this.onDestinationChange}
|
onChange={this.onDestinationChange}
|
||||||
style={{ maxWidth: '60%' }}
|
style={{ maxWidth: '60%' }}
|
||||||
|
placeholder={t('Specify mount point.')}
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form.Item className={styles['zun-volume']} name={name}>
|
<Form.Item className={styles['zun-volume']}>
|
||||||
<Row gutter={24}>
|
<Row gutter={24}>
|
||||||
<Col span={8}>
|
<Col span={8}>
|
||||||
<span className={styles.label}>{t('Type')}</span>
|
<span className={styles.label}>{t('Type')}</span>
|
||||||
{selectType}
|
{selectType}
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={8} hidden={isCinderVolume}>
|
<Col span={8} hidden={isNewVolume}>
|
||||||
<span className={styles.label}>{t('Source')}</span>
|
<span className={styles.label}>{t('Source')}</span>
|
||||||
{selectSource}
|
{selectSource}
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={8} hidden={!isCinderVolume}>
|
<Col span={8} hidden={!isNewVolume}>
|
||||||
<span className={styles.label}>{t('Size(GiB)')}</span>
|
<span className={styles.label}>{t('Size(GiB)')}</span>
|
||||||
{inputSize}
|
{inputSize}
|
||||||
</Col>
|
</Col>
|
||||||
|
@ -71,6 +71,7 @@
|
|||||||
"Add Virtual LAN": "Add Virtual LAN",
|
"Add Virtual LAN": "Add Virtual LAN",
|
||||||
"Add hosts to the aggregate or remove hosts from it. Hosts can be in multiple aggregates.": "Add hosts to the aggregate or remove hosts from it. Hosts can be in multiple aggregates.",
|
"Add hosts to the aggregate or remove hosts from it. Hosts can be in multiple aggregates.": "Add hosts to the aggregate or remove hosts from it. Hosts can be in multiple aggregates.",
|
||||||
"Add network": "Add network",
|
"Add network": "Add network",
|
||||||
|
"Add scheduler hints": "Add scheduler hints",
|
||||||
"Additional Labels": "Additional Labels",
|
"Additional Labels": "Additional Labels",
|
||||||
"Additional routes announced to the instance, one entry per line(e.g. 192.168.200.0/24,10.56.1.254)": "Additional routes announced to the instance, one entry per line(e.g. 192.168.200.0/24,10.56.1.254)",
|
"Additional routes announced to the instance, one entry per line(e.g. 192.168.200.0/24,10.56.1.254)": "Additional routes announced to the instance, one entry per line(e.g. 192.168.200.0/24,10.56.1.254)",
|
||||||
"Additional routes announced to the instance, one entry per line(e.g. {ip})": "Additional routes announced to the instance, one entry per line(e.g. {ip})",
|
"Additional routes announced to the instance, one entry per line(e.g. {ip})": "Additional routes announced to the instance, one entry per line(e.g. {ip})",
|
||||||
@ -860,6 +861,7 @@
|
|||||||
"Evictions": "Evictions",
|
"Evictions": "Evictions",
|
||||||
"Execute Command": "Execute Command",
|
"Execute Command": "Execute Command",
|
||||||
"Execution Result": "Execution Result",
|
"Execution Result": "Execution Result",
|
||||||
|
"Existing Volume": "Existing Volume",
|
||||||
"Exit Policy": "Exit Policy",
|
"Exit Policy": "Exit Policy",
|
||||||
"Expand": "Expand",
|
"Expand": "Expand",
|
||||||
"Expand Advanced Options": "Expand Advanced Options",
|
"Expand Advanced Options": "Expand Advanced Options",
|
||||||
@ -1493,6 +1495,7 @@
|
|||||||
"New Caledonia": "New Caledonia",
|
"New Caledonia": "New Caledonia",
|
||||||
"New Status": "New Status",
|
"New Status": "New Status",
|
||||||
"New Tag": "New Tag",
|
"New Tag": "New Tag",
|
||||||
|
"New Volume": "New Volume",
|
||||||
"New Zealand": "New Zealand",
|
"New Zealand": "New Zealand",
|
||||||
"Next": "Next",
|
"Next": "Next",
|
||||||
"Next Hop": "Next Hop",
|
"Next Hop": "Next Hop",
|
||||||
@ -1909,7 +1912,7 @@
|
|||||||
"Resume In Progress": "Resume In Progress",
|
"Resume In Progress": "Resume In Progress",
|
||||||
"Resume Instance": "Resume Instance",
|
"Resume Instance": "Resume Instance",
|
||||||
"Resuming": "Resuming",
|
"Resuming": "Resuming",
|
||||||
"Retry times for 'Restart on failure' policy": "Retry times for 'Restart on failure' policy",
|
"Retry times for restart on failure policy": "Retry times for restart on failure policy",
|
||||||
"Retyping": "Retyping",
|
"Retyping": "Retyping",
|
||||||
"Reunion": "Reunion",
|
"Reunion": "Reunion",
|
||||||
"Revert Resize or Migrate": "Revert Resize or Migrate",
|
"Revert Resize or Migrate": "Revert Resize or Migrate",
|
||||||
@ -2091,6 +2094,7 @@
|
|||||||
"Spawning": "Spawning",
|
"Spawning": "Spawning",
|
||||||
"Spec": "Spec",
|
"Spec": "Spec",
|
||||||
"Specification": "Specification",
|
"Specification": "Specification",
|
||||||
|
"Specify mount point.": "Specify mount point.",
|
||||||
"Specify whether future replicated instances will be created on the same hypervisor (affinity) or on different hypervisors (anti-affinity). This value is ignored if the instance to be launched is a replica.": "Specify whether future replicated instances will be created on the same hypervisor (affinity) or on different hypervisors (anti-affinity). This value is ignored if the instance to be launched is a replica.",
|
"Specify whether future replicated instances will be created on the same hypervisor (affinity) or on different hypervisors (anti-affinity). This value is ignored if the instance to be launched is a replica.": "Specify whether future replicated instances will be created on the same hypervisor (affinity) or on different hypervisors (anti-affinity). This value is ignored if the instance to be launched is a replica.",
|
||||||
"Specs": "Specs",
|
"Specs": "Specs",
|
||||||
"Sri Lanka": "Sri Lanka",
|
"Sri Lanka": "Sri Lanka",
|
||||||
@ -2210,6 +2214,7 @@
|
|||||||
"The certificate contains information such as the public key and signature of the certificate. The extension of the certificate is \"pem\" or \"crt\", you can directly enter certificate content or upload certificate file.": "The certificate contains information such as the public key and signature of the certificate. The extension of the certificate is \"pem\" or \"crt\", you can directly enter certificate content or upload certificate file.",
|
"The certificate contains information such as the public key and signature of the certificate. The extension of the certificate is \"pem\" or \"crt\", you can directly enter certificate content or upload certificate file.": "The certificate contains information such as the public key and signature of the certificate. The extension of the certificate is \"pem\" or \"crt\", you can directly enter certificate content or upload certificate file.",
|
||||||
"The command to execute": "The command to execute",
|
"The command to execute": "The command to execute",
|
||||||
"The container memory size in MiB": "The container memory size in MiB",
|
"The container memory size in MiB": "The container memory size in MiB",
|
||||||
|
"The container runtime tool to create container with": "The container runtime tool to create container with",
|
||||||
"The creation instruction has been issued, please refresh to see the actual situation in the list.": "The creation instruction has been issued, please refresh to see the actual situation in the list.",
|
"The creation instruction has been issued, please refresh to see the actual situation in the list.": "The creation instruction has been issued, please refresh to see the actual situation in the list.",
|
||||||
"The creation instruction was issued successfully, instance: {name}. \n You can wait for a few seconds to follow the changes of the list data or manually refresh the data to get the final display result.": "The creation instruction was issued successfully, instance: {name}. \n You can wait for a few seconds to follow the changes of the list data or manually refresh the data to get the final display result.",
|
"The creation instruction was issued successfully, instance: {name}. \n You can wait for a few seconds to follow the changes of the list data or manually refresh the data to get the final display result.": "The creation instruction was issued successfully, instance: {name}. \n You can wait for a few seconds to follow the changes of the list data or manually refresh the data to get the final display result.",
|
||||||
"The current operation requires the instance to be shut down:": "The current operation requires the instance to be shut down:",
|
"The current operation requires the instance to be shut down:": "The current operation requires the instance to be shut down:",
|
||||||
@ -2264,7 +2269,6 @@
|
|||||||
"The private key of the certificate, the extension of the private key is \"key\", you can directly enter the content of the private key file or upload a private key that conforms to the format document.": "The private key of the certificate, the extension of the private key is \"key\", you can directly enter the content of the private key file or upload a private key that conforms to the format document.",
|
"The private key of the certificate, the extension of the private key is \"key\", you can directly enter the content of the private key file or upload a private key that conforms to the format document.": "The private key of the certificate, the extension of the private key is \"key\", you can directly enter the content of the private key file or upload a private key that conforms to the format document.",
|
||||||
"The resource class of the scheduled node needs to correspond to the resource class name of the flavor used by the ironic instance (for example, the resource class name of the scheduling node is baremetal.with-GPU, and the custom resource class name of the flavor is CUSTOM_BAREMETAL_WITH_GPU=1).": "The resource class of the scheduled node needs to correspond to the resource class name of the flavor used by the ironic instance (for example, the resource class name of the scheduling node is baremetal.with-GPU, and the custom resource class name of the flavor is CUSTOM_BAREMETAL_WITH_GPU=1).",
|
"The resource class of the scheduled node needs to correspond to the resource class name of the flavor used by the ironic instance (for example, the resource class name of the scheduling node is baremetal.with-GPU, and the custom resource class name of the flavor is CUSTOM_BAREMETAL_WITH_GPU=1).": "The resource class of the scheduled node needs to correspond to the resource class name of the flavor used by the ironic instance (for example, the resource class name of the scheduling node is baremetal.with-GPU, and the custom resource class name of the flavor is CUSTOM_BAREMETAL_WITH_GPU=1).",
|
||||||
"The root and os_admin are default users and cannot be created!": "The root and os_admin are default users and cannot be created!",
|
"The root and os_admin are default users and cannot be created!": "The root and os_admin are default users and cannot be created!",
|
||||||
"The runtime to create container with": "The runtime to create container with",
|
|
||||||
"The security group is similar to the firewall function and is used to set up network access control. ": "The security group is similar to the firewall function and is used to set up network access control. ",
|
"The security group is similar to the firewall function and is used to set up network access control. ": "The security group is similar to the firewall function and is used to set up network access control. ",
|
||||||
"The security group is similar to the firewall function for setting up network access control, or you can go to the console and create a new security group. (Note: The security group you selected will work on all virtual LANS on the instances.)": "The security group is similar to the firewall function for setting up network access control, or you can go to the console and create a new security group. (Note: The security group you selected will work on all virtual LANS on the instances.)",
|
"The security group is similar to the firewall function for setting up network access control, or you can go to the console and create a new security group. (Note: The security group you selected will work on all virtual LANS on the instances.)": "The security group is similar to the firewall function for setting up network access control, or you can go to the console and create a new security group. (Note: The security group you selected will work on all virtual LANS on the instances.)",
|
||||||
"The selected VPC/ subnet does not have IPv6 enabled.": "The selected VPC/ subnet does not have IPv6 enabled.",
|
"The selected VPC/ subnet does not have IPv6 enabled.": "The selected VPC/ subnet does not have IPv6 enabled.",
|
||||||
@ -2335,7 +2339,6 @@
|
|||||||
"Two-way authentication": "Two-way authentication",
|
"Two-way authentication": "Two-way authentication",
|
||||||
"Type": "Type",
|
"Type": "Type",
|
||||||
"Type of datastore": "Type of datastore",
|
"Type of datastore": "Type of datastore",
|
||||||
"Type to Scheduler Hints and press enter": "Type to Scheduler Hints and press enter",
|
|
||||||
"UDPLite": "UDPLite",
|
"UDPLite": "UDPLite",
|
||||||
"UNHEALTHY": "UNHEALTHY",
|
"UNHEALTHY": "UNHEALTHY",
|
||||||
"UNKNOWN": "UNKNOWN",
|
"UNKNOWN": "UNKNOWN",
|
||||||
|
@ -71,6 +71,7 @@
|
|||||||
"Add Virtual LAN": "添加虚拟网卡",
|
"Add Virtual LAN": "添加虚拟网卡",
|
||||||
"Add hosts to the aggregate or remove hosts from it. Hosts can be in multiple aggregates.": "增加主机到这个集合。主机可以加入多个集合。",
|
"Add hosts to the aggregate or remove hosts from it. Hosts can be in multiple aggregates.": "增加主机到这个集合。主机可以加入多个集合。",
|
||||||
"Add network": "添加网络",
|
"Add network": "添加网络",
|
||||||
|
"Add scheduler hints": "添加调度程序提示",
|
||||||
"Additional Labels": "附加标签",
|
"Additional Labels": "附加标签",
|
||||||
"Additional routes announced to the instance, one entry per line(e.g. 192.168.200.0/24,10.56.1.254)": "云主机额外路由,每行一条(例如: 192.168.200.0/24,10.56.1.254)",
|
"Additional routes announced to the instance, one entry per line(e.g. 192.168.200.0/24,10.56.1.254)": "云主机额外路由,每行一条(例如: 192.168.200.0/24,10.56.1.254)",
|
||||||
"Additional routes announced to the instance, one entry per line(e.g. {ip})": "云主机额外路由,每行一条(例如: {ip})",
|
"Additional routes announced to the instance, one entry per line(e.g. {ip})": "云主机额外路由,每行一条(例如: {ip})",
|
||||||
@ -860,6 +861,7 @@
|
|||||||
"Evictions": "",
|
"Evictions": "",
|
||||||
"Execute Command": "执行命令",
|
"Execute Command": "执行命令",
|
||||||
"Execution Result": "执行结果",
|
"Execution Result": "执行结果",
|
||||||
|
"Existing Volume": "已有硬盘",
|
||||||
"Exit Policy": "退出策略",
|
"Exit Policy": "退出策略",
|
||||||
"Expand": "展开",
|
"Expand": "展开",
|
||||||
"Expand Advanced Options": "展开高级选项",
|
"Expand Advanced Options": "展开高级选项",
|
||||||
@ -1493,6 +1495,7 @@
|
|||||||
"New Caledonia": "新喀里多尼亚",
|
"New Caledonia": "新喀里多尼亚",
|
||||||
"New Status": "新状态",
|
"New Status": "新状态",
|
||||||
"New Tag": "新标签",
|
"New Tag": "新标签",
|
||||||
|
"New Volume": "新的硬盘",
|
||||||
"New Zealand": "新西兰",
|
"New Zealand": "新西兰",
|
||||||
"Next": "下一步",
|
"Next": "下一步",
|
||||||
"Next Hop": "下一跳",
|
"Next Hop": "下一跳",
|
||||||
@ -1909,7 +1912,7 @@
|
|||||||
"Resume In Progress": "正在恢复中",
|
"Resume In Progress": "正在恢复中",
|
||||||
"Resume Instance": "恢复云主机",
|
"Resume Instance": "恢复云主机",
|
||||||
"Resuming": "恢复中",
|
"Resuming": "恢复中",
|
||||||
"Retry times for 'Restart on failure' policy": "“失败时重新启动”策略的重试次数",
|
"Retry times for restart on failure policy": "重新启动失败策略的重试次数",
|
||||||
"Retyping": "修改类型中",
|
"Retyping": "修改类型中",
|
||||||
"Reunion": "留尼汪岛",
|
"Reunion": "留尼汪岛",
|
||||||
"Revert Resize or Migrate": "回滚修改配置/迁移",
|
"Revert Resize or Migrate": "回滚修改配置/迁移",
|
||||||
@ -1940,7 +1943,7 @@
|
|||||||
"Running": "运行中",
|
"Running": "运行中",
|
||||||
"Running Threads": "运行中的线程",
|
"Running Threads": "运行中的线程",
|
||||||
"Running Time": "运行时间",
|
"Running Time": "运行时间",
|
||||||
"Runtime": "运行时间",
|
"Runtime": "运行时",
|
||||||
"Russia": "俄罗斯",
|
"Russia": "俄罗斯",
|
||||||
"Rwanda": "卢旺达",
|
"Rwanda": "卢旺达",
|
||||||
"SCTP": "",
|
"SCTP": "",
|
||||||
@ -2091,6 +2094,7 @@
|
|||||||
"Spawning": "孵化中",
|
"Spawning": "孵化中",
|
||||||
"Spec": "规格",
|
"Spec": "规格",
|
||||||
"Specification": "规格",
|
"Specification": "规格",
|
||||||
|
"Specify mount point.": "指定挂载点",
|
||||||
"Specify whether future replicated instances will be created on the same hypervisor (affinity) or on different hypervisors (anti-affinity). This value is ignored if the instance to be launched is a replica.": "指定未来的复制实例是在相同的管理程序(亲和)上创建还是在不同的管理程序(反亲和)上创建。如果要启动的实例是副本,则忽略此值。",
|
"Specify whether future replicated instances will be created on the same hypervisor (affinity) or on different hypervisors (anti-affinity). This value is ignored if the instance to be launched is a replica.": "指定未来的复制实例是在相同的管理程序(亲和)上创建还是在不同的管理程序(反亲和)上创建。如果要启动的实例是副本,则忽略此值。",
|
||||||
"Specs": "规格",
|
"Specs": "规格",
|
||||||
"Sri Lanka": "斯里兰卡",
|
"Sri Lanka": "斯里兰卡",
|
||||||
@ -2210,6 +2214,7 @@
|
|||||||
"The certificate contains information such as the public key and signature of the certificate. The extension of the certificate is \"pem\" or \"crt\", you can directly enter certificate content or upload certificate file.": "证书包含证书的公钥和签名等信息,证书扩展名为”pem”或”crt”,您可直接输入证书内容或上传证书文件。",
|
"The certificate contains information such as the public key and signature of the certificate. The extension of the certificate is \"pem\" or \"crt\", you can directly enter certificate content or upload certificate file.": "证书包含证书的公钥和签名等信息,证书扩展名为”pem”或”crt”,您可直接输入证书内容或上传证书文件。",
|
||||||
"The command to execute": "要执行的命令",
|
"The command to execute": "要执行的命令",
|
||||||
"The container memory size in MiB": "以 MiB 为单位的容器内存大小",
|
"The container memory size in MiB": "以 MiB 为单位的容器内存大小",
|
||||||
|
"The container runtime tool to create container with": "用于创建容器的容器运行时工具",
|
||||||
"The creation instruction has been issued, please refresh to see the actual situation in the list.": "创建指令已下发,请刷新查看云主机列表中的实际情况。",
|
"The creation instruction has been issued, please refresh to see the actual situation in the list.": "创建指令已下发,请刷新查看云主机列表中的实际情况。",
|
||||||
"The creation instruction was issued successfully, instance: {name}. \n You can wait for a few seconds to follow the changes of the list data or manually refresh the data to get the final display result.": "创建指令下发成功,实例名称:{name}。 \n 您可等待几秒关注列表数据的变更或是手动刷新数据,以获取最终展示结果。",
|
"The creation instruction was issued successfully, instance: {name}. \n You can wait for a few seconds to follow the changes of the list data or manually refresh the data to get the final display result.": "创建指令下发成功,实例名称:{name}。 \n 您可等待几秒关注列表数据的变更或是手动刷新数据,以获取最终展示结果。",
|
||||||
"The current operation requires the instance to be shut down:": "当前操作需要云主机在关机状态下进行:",
|
"The current operation requires the instance to be shut down:": "当前操作需要云主机在关机状态下进行:",
|
||||||
@ -2264,7 +2269,6 @@
|
|||||||
"The private key of the certificate, the extension of the private key is \"key\", you can directly enter the content of the private key file or upload a private key that conforms to the format document.": "证书的私钥,私钥扩展名为”key”,您可直接输入私钥文件内容或上传符合格式的私钥文件。",
|
"The private key of the certificate, the extension of the private key is \"key\", you can directly enter the content of the private key file or upload a private key that conforms to the format document.": "证书的私钥,私钥扩展名为”key”,您可直接输入私钥文件内容或上传符合格式的私钥文件。",
|
||||||
"The resource class of the scheduled node needs to correspond to the resource class name of the flavor used by the ironic instance (for example, the resource class name of the scheduling node is baremetal.with-GPU, and the custom resource class name of the flavor is CUSTOM_BAREMETAL_WITH_GPU=1).": "被调度节点的资源类需要与裸机实例使用的云主机类型的资源类名称对应(比如:调度节点的资源类名称为 baremetal.with-GPU,云主机类型的资源类名称为CUSTOM_BAREMETAL_WITH_GPU=1 )。",
|
"The resource class of the scheduled node needs to correspond to the resource class name of the flavor used by the ironic instance (for example, the resource class name of the scheduling node is baremetal.with-GPU, and the custom resource class name of the flavor is CUSTOM_BAREMETAL_WITH_GPU=1).": "被调度节点的资源类需要与裸机实例使用的云主机类型的资源类名称对应(比如:调度节点的资源类名称为 baremetal.with-GPU,云主机类型的资源类名称为CUSTOM_BAREMETAL_WITH_GPU=1 )。",
|
||||||
"The root and os_admin are default users and cannot be created!": "root 和 os_admin 是默认用户,不能创建!",
|
"The root and os_admin are default users and cannot be created!": "root 和 os_admin 是默认用户,不能创建!",
|
||||||
"The runtime to create container with": "用于创建容器的运行时间",
|
|
||||||
"The security group is similar to the firewall function and is used to set up network access control. ": "安全组类似防火墙功能,用于设置网络访问控制。",
|
"The security group is similar to the firewall function and is used to set up network access control. ": "安全组类似防火墙功能,用于设置网络访问控制。",
|
||||||
"The security group is similar to the firewall function for setting up network access control, or you can go to the console and create a new security group. (Note: The security group you selected will work on all virtual LANS on the instances.)": "安全组类似防火墙功能,用于设置网络访问控制,您也可以前往控制台新建安全组。(注:您所选的安全组将作用于云主机的全部虚拟网卡。)",
|
"The security group is similar to the firewall function for setting up network access control, or you can go to the console and create a new security group. (Note: The security group you selected will work on all virtual LANS on the instances.)": "安全组类似防火墙功能,用于设置网络访问控制,您也可以前往控制台新建安全组。(注:您所选的安全组将作用于云主机的全部虚拟网卡。)",
|
||||||
"The selected VPC/ subnet does not have IPv6 enabled.": "所选的VPC/子网未开通IPv6",
|
"The selected VPC/ subnet does not have IPv6 enabled.": "所选的VPC/子网未开通IPv6",
|
||||||
@ -2335,7 +2339,6 @@
|
|||||||
"Two-way authentication": "双向认证",
|
"Two-way authentication": "双向认证",
|
||||||
"Type": "类型",
|
"Type": "类型",
|
||||||
"Type of datastore": "数据存储类型",
|
"Type of datastore": "数据存储类型",
|
||||||
"Type to Scheduler Hints and press enter": "输入调度程序提示并按回车键",
|
|
||||||
"UDPLite": "",
|
"UDPLite": "",
|
||||||
"UNHEALTHY": "不健康",
|
"UNHEALTHY": "不健康",
|
||||||
"UNKNOWN": "未知",
|
"UNKNOWN": "未知",
|
||||||
|
@ -12,8 +12,18 @@
|
|||||||
|
|
||||||
import Base from 'components/Form';
|
import Base from 'components/Form';
|
||||||
import { inject, observer } from 'mobx-react';
|
import { inject, observer } from 'mobx-react';
|
||||||
|
import globalImageStore from 'src/stores/glance/image';
|
||||||
|
import {
|
||||||
|
getImageColumns,
|
||||||
|
getImageSystemTabs,
|
||||||
|
getImageOS,
|
||||||
|
} from 'resources/glance/image';
|
||||||
|
|
||||||
export class StepInfo extends Base {
|
export class StepInfo extends Base {
|
||||||
|
init() {
|
||||||
|
this.getImageList();
|
||||||
|
}
|
||||||
|
|
||||||
get title() {
|
get title() {
|
||||||
return t('Info');
|
return t('Info');
|
||||||
}
|
}
|
||||||
@ -22,24 +32,61 @@ export class StepInfo extends Base {
|
|||||||
return t('Info');
|
return t('Info');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getImageList() {
|
||||||
|
await globalImageStore.fetchList();
|
||||||
|
this.updateDefaultValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
get imageList() {
|
||||||
|
const { imageTab } = this.state;
|
||||||
|
return (globalImageStore.list.data || [])
|
||||||
|
.filter((it) => it.owner === this.currentProjectId)
|
||||||
|
.filter((it) => getImageOS(it) === imageTab);
|
||||||
|
}
|
||||||
|
|
||||||
|
get imageColumns() {
|
||||||
|
return getImageColumns(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
get systemTabs() {
|
||||||
|
const imageTabs = getImageSystemTabs();
|
||||||
|
return imageTabs;
|
||||||
|
}
|
||||||
|
|
||||||
|
onImageTabChange = (value) => {
|
||||||
|
this.setState({
|
||||||
|
imageTab: value,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
get formItems() {
|
get formItems() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
name: 'containerName',
|
name: 'name',
|
||||||
label: t('Container Name'),
|
label: t('Container Name'),
|
||||||
type: 'input',
|
type: 'input',
|
||||||
placeholder: t('Container Name'),
|
placeholder: t('Container Name'),
|
||||||
required: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'image',
|
name: 'images',
|
||||||
label: t('Image'),
|
label: t('Image'),
|
||||||
type: 'input',
|
type: 'select-table',
|
||||||
placeholder: t('Name or ID og the container image'),
|
data: this.imageList,
|
||||||
required: true,
|
required: true,
|
||||||
|
isLoading: globalImageStore.list.isLoading,
|
||||||
|
filterParams: [
|
||||||
|
{
|
||||||
|
label: t('Name'),
|
||||||
|
name: 'name',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
columns: this.imageColumns,
|
||||||
|
tabs: this.systemTabs,
|
||||||
|
defaultTabValue: this.systemTabs[0].value,
|
||||||
|
onTabChange: this.onImageTabChange,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'imageDriver',
|
name: 'image_driver',
|
||||||
label: t('Image Driver'),
|
label: t('Image Driver'),
|
||||||
placeholder: t('Image Driver'),
|
placeholder: t('Image Driver'),
|
||||||
type: 'select',
|
type: 'select',
|
||||||
|
@ -26,7 +26,7 @@ export class StepMiscellaneous extends Base {
|
|||||||
get formItems() {
|
get formItems() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
name: 'workingDirectory',
|
name: 'workdir',
|
||||||
label: t('Working Directory'),
|
label: t('Working Directory'),
|
||||||
type: 'input',
|
type: 'input',
|
||||||
placeholder: t('The working directory for commands to run in'),
|
placeholder: t('The working directory for commands to run in'),
|
||||||
@ -39,7 +39,7 @@ export class StepMiscellaneous extends Base {
|
|||||||
addText: t('Add Environment Variable'),
|
addText: t('Add Environment Variable'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'enableInteractiveMode',
|
name: 'interactive',
|
||||||
label: t('Enable interactive mode'),
|
label: t('Enable interactive mode'),
|
||||||
type: 'check',
|
type: 'check',
|
||||||
},
|
},
|
||||||
@ -59,9 +59,9 @@ export class StepMiscellaneous extends Base {
|
|||||||
{
|
{
|
||||||
name: 'hints',
|
name: 'hints',
|
||||||
label: t('Scheduler Hints'),
|
label: t('Scheduler Hints'),
|
||||||
type: 'select',
|
type: 'add-select',
|
||||||
mode: 'tags',
|
itemComponent: KeyValueInput,
|
||||||
placeholder: t('Type to Scheduler Hints and press enter'),
|
addText: t('Add scheduler hints'),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
import { SecurityGroupStore } from 'stores/neutron/security-group';
|
import { SecurityGroupStore } from 'stores/neutron/security-group';
|
||||||
import { VirtualAdapterStore } from 'stores/neutron/virtual-adapter';
|
import { VirtualAdapterStore } from 'stores/neutron/virtual-adapter';
|
||||||
import Base from 'components/Form';
|
import Base from 'components/Form';
|
||||||
@ -19,6 +20,7 @@ import {
|
|||||||
securityGroupColumns,
|
securityGroupColumns,
|
||||||
securityGroupFilter,
|
securityGroupFilter,
|
||||||
} from 'src/resources/neutron/security-group';
|
} from 'src/resources/neutron/security-group';
|
||||||
|
import { getLinkRender } from 'utils/route-map';
|
||||||
|
|
||||||
export class StepNetworks extends Base {
|
export class StepNetworks extends Base {
|
||||||
init() {
|
init() {
|
||||||
@ -34,27 +36,44 @@ export class StepNetworks extends Base {
|
|||||||
return t('Networks');
|
return t('Networks');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get nameForStateUpdate() {
|
||||||
|
return ['networks'];
|
||||||
|
}
|
||||||
|
|
||||||
|
get defaultValue() {
|
||||||
|
const data = {
|
||||||
|
networks: [],
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
get formItems() {
|
get formItems() {
|
||||||
|
const { networks } = this.state;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
name: 'networkSelect',
|
name: 'networks',
|
||||||
label: t('Networks'),
|
label: t('Networks'),
|
||||||
type: 'network-select-table',
|
type: 'network-select-table',
|
||||||
isMulti: true,
|
isMulti: true,
|
||||||
|
onChange: ({ selectedRowKeys = [] }) => {
|
||||||
|
this.setState({
|
||||||
|
networks: selectedRowKeys,
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'ports',
|
name: 'ports',
|
||||||
type: 'select-table',
|
type: 'select-table',
|
||||||
label: t('Ports'),
|
label: t('Ports'),
|
||||||
isMulti: true,
|
extraParams: { project_id: this.currentProjectId, status: 'DOWN' },
|
||||||
columns: portColumns,
|
|
||||||
filterParams: portFilters,
|
|
||||||
backendPageStore: this.portStore,
|
backendPageStore: this.portStore,
|
||||||
extraParams: {
|
isMulti: true,
|
||||||
project_id: this.currentProjectId,
|
header: t(
|
||||||
device_owner: [''],
|
'Ports provide extra communication channels to your instances. You can select ports instead of networks or a mix of both (The port executes its own security group rules by default).'
|
||||||
admin_state_up: [true],
|
),
|
||||||
},
|
filterParams: portFilters,
|
||||||
|
columns: portColumns,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'securityGroup',
|
name: 'securityGroup',
|
||||||
@ -62,9 +81,22 @@ export class StepNetworks extends Base {
|
|||||||
type: 'select-table',
|
type: 'select-table',
|
||||||
backendPageStore: this.securityGroupStore,
|
backendPageStore: this.securityGroupStore,
|
||||||
extraParams: { project_id: this.currentProjectId },
|
extraParams: { project_id: this.currentProjectId },
|
||||||
columns: securityGroupColumns,
|
|
||||||
filterParams: securityGroupFilter,
|
|
||||||
isMulti: true,
|
isMulti: true,
|
||||||
|
hidden: !networks || !networks.length,
|
||||||
|
header: (
|
||||||
|
<div style={{ marginBottom: 8 }}>
|
||||||
|
{t(
|
||||||
|
'The security group is similar to the firewall function and is used to set up network access control. '
|
||||||
|
)}
|
||||||
|
{t(' You can go to the console to ')}
|
||||||
|
{getLinkRender({
|
||||||
|
key: 'securityGroup',
|
||||||
|
value: `${t('create a new security group')}> `,
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
filterParams: securityGroupFilter,
|
||||||
|
columns: securityGroupColumns,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -12,12 +12,12 @@
|
|||||||
|
|
||||||
import Base from 'components/Form';
|
import Base from 'components/Form';
|
||||||
import { inject, observer } from 'mobx-react';
|
import { inject, observer } from 'mobx-react';
|
||||||
import globalAvailabilityZoneStore from 'src/stores/nova/zone';
|
import globalAvailabilityZoneStore from 'stores/nova/zone';
|
||||||
|
|
||||||
export class StepSpec extends Base {
|
export class StepSpec extends Base {
|
||||||
init() {
|
init() {
|
||||||
this.getAvailabilityZones();
|
this.getAvailabilityZones();
|
||||||
this.state.isMaxRetry = true;
|
this.state.disableRetry = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
get title() {
|
get title() {
|
||||||
@ -32,7 +32,7 @@ export class StepSpec extends Base {
|
|||||||
await globalAvailabilityZoneStore.fetchListWithoutDetail();
|
await globalAvailabilityZoneStore.fetchListWithoutDetail();
|
||||||
}
|
}
|
||||||
|
|
||||||
get getAvailabilityZoneList() {
|
get availabilityZoneList() {
|
||||||
return (globalAvailabilityZoneStore.list.data || [])
|
return (globalAvailabilityZoneStore.list.data || [])
|
||||||
.filter((it) => it.zoneState.available)
|
.filter((it) => it.zoneState.available)
|
||||||
.map((it) => ({
|
.map((it) => ({
|
||||||
@ -41,11 +41,8 @@ export class StepSpec extends Base {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
onExitPolicyChange(value) {
|
|
||||||
this.setState({ isMaxRetry: value !== 'on-failure' });
|
|
||||||
}
|
|
||||||
|
|
||||||
get formItems() {
|
get formItems() {
|
||||||
|
const { disableRetry } = this.state;
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
name: 'hostname',
|
name: 'hostname',
|
||||||
@ -57,36 +54,34 @@ export class StepSpec extends Base {
|
|||||||
name: 'runtime',
|
name: 'runtime',
|
||||||
label: t('Runtime'),
|
label: t('Runtime'),
|
||||||
type: 'input',
|
type: 'input',
|
||||||
placeholder: t('The runtime to create container with'),
|
placeholder: t('The container runtime tool to create container with'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cpu',
|
name: 'cpu',
|
||||||
label: t('CPU'),
|
label: t('CPU'),
|
||||||
type: 'input-int',
|
type: 'input-int',
|
||||||
placeholder: t('The number of virtual cpu for this container'),
|
tip: t('The number of virtual cpu for this container'),
|
||||||
min: 1,
|
min: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'memory',
|
name: 'memory',
|
||||||
label: t('Memory (MiB)'),
|
label: t('Memory (MiB)'),
|
||||||
type: 'input-int',
|
type: 'input-int',
|
||||||
placeholder: t('The container memory size in MiB'),
|
tip: t('The container memory size in MiB'),
|
||||||
min: 4,
|
min: 4,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'disk',
|
name: 'disk',
|
||||||
label: t('Disk'),
|
label: t('Disk'),
|
||||||
type: 'input-int',
|
type: 'input-int',
|
||||||
placeholder: t('The disk size in GiB for per container'),
|
tip: t('The disk size in GiB for per container'),
|
||||||
min: 1,
|
min: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'availableZone',
|
name: 'availability_zone',
|
||||||
label: t('Availability Zone'),
|
label: t('Availability Zone'),
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: this.getAvailabilityZoneList,
|
options: this.availabilityZoneList,
|
||||||
allowClear: true,
|
|
||||||
showSearch: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'exitPolicy',
|
name: 'exitPolicy',
|
||||||
@ -110,20 +105,21 @@ export class StepSpec extends Base {
|
|||||||
value: 'unless-stopped',
|
value: 'unless-stopped',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
onChange: (val) => this.onExitPolicyChange(val),
|
onChange: (value) =>
|
||||||
allowClear: true,
|
this.setState({
|
||||||
showSearch: true,
|
disableRetry: value !== 'on-failure',
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'maxRetry',
|
name: 'maxRetry',
|
||||||
label: t('Max Retry'),
|
label: t('Max Retry'),
|
||||||
type: 'input-number',
|
type: 'input-number',
|
||||||
placeholder: t("Retry times for 'Restart on failure' policy"),
|
tip: t('Retry times for restart on failure policy'),
|
||||||
min: 1,
|
min: 1,
|
||||||
disabled: this.state.isMaxRetry,
|
disabled: disableRetry,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'enableAutoHeal',
|
name: 'auto_heal',
|
||||||
label: t('Enable auto heal'),
|
label: t('Enable auto heal'),
|
||||||
type: 'check',
|
type: 'check',
|
||||||
},
|
},
|
||||||
|
@ -13,25 +13,25 @@
|
|||||||
import Base from 'components/Form';
|
import Base from 'components/Form';
|
||||||
import { inject, observer } from 'mobx-react';
|
import { inject, observer } from 'mobx-react';
|
||||||
import ZunVolume from 'src/components/FormItem/ZunVolume';
|
import ZunVolume from 'src/components/FormItem/ZunVolume';
|
||||||
import globalVolumeStore from 'src/stores/cinder/volume';
|
import { VolumeStore } from 'src/stores/cinder/volume';
|
||||||
|
|
||||||
export class StepVolumes extends Base {
|
export class StepVolumes extends Base {
|
||||||
init() {
|
init() {
|
||||||
this.globalVolumeStore = globalVolumeStore;
|
this.volumeStore = new VolumeStore();
|
||||||
this.getVolumeStore();
|
this.getVolumes();
|
||||||
}
|
}
|
||||||
|
|
||||||
get cinderVolume() {
|
get volumes() {
|
||||||
return (this.globalVolumeStore.list.data || [])
|
return (this.volumeStore.list.data || [])
|
||||||
.filter((it) => it.status === 'available')
|
.filter((it) => it.status === 'available')
|
||||||
.map((it) => ({
|
.map((it) => ({
|
||||||
value: it.id,
|
value: it.id,
|
||||||
label: it.name === '' ? it.id : it.name,
|
label: `${it.name || it.id} (${it.id})`,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
getVolumeStore() {
|
async getVolumes() {
|
||||||
this.globalVolumeStore.fetchList();
|
await this.volumeStore.fetchList();
|
||||||
}
|
}
|
||||||
|
|
||||||
get formItems() {
|
get formItems() {
|
||||||
@ -41,10 +41,10 @@ export class StepVolumes extends Base {
|
|||||||
label: t('Type'),
|
label: t('Type'),
|
||||||
type: 'add-select',
|
type: 'add-select',
|
||||||
optionsType: [
|
optionsType: [
|
||||||
{ label: 'Existing Cinder Volume', value: 'cinder-available' },
|
{ label: t('Existing Volume'), value: 'bind' },
|
||||||
{ label: 'New Cinder Volume', value: 'cinder-new' },
|
{ label: t('New Volume'), value: 'volume' },
|
||||||
],
|
],
|
||||||
optionsSource: this.cinderVolume,
|
optionsSource: this.volumes,
|
||||||
itemComponent: ZunVolume,
|
itemComponent: ZunVolume,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -76,90 +76,110 @@ export class StepCreate extends StepAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onSubmit = (values) => {
|
onSubmit = (values) => {
|
||||||
const { environmentVariables, labels, mounts } = values;
|
const {
|
||||||
|
environmentVariables,
|
||||||
|
labels,
|
||||||
|
mounts,
|
||||||
|
images,
|
||||||
|
exitPolicy,
|
||||||
|
maxRetry,
|
||||||
|
networks,
|
||||||
|
ports,
|
||||||
|
hints,
|
||||||
|
securityGroup,
|
||||||
|
...rest
|
||||||
|
} = values;
|
||||||
|
|
||||||
const requestEnviranment = {};
|
const requestEnvironment = {};
|
||||||
const requestLabels = {};
|
const requestLabels = {};
|
||||||
const requestValumes = [];
|
const requestVolumes = [];
|
||||||
|
const requestHints = {};
|
||||||
environmentVariables !== undefined
|
const nets = [];
|
||||||
? environmentVariables.forEach((item) => {
|
|
||||||
const labelKey = item.value.key.toLowerCase().trim();
|
|
||||||
const labelValue = item.value.value.toLowerCase().trim();
|
|
||||||
requestEnviranment[labelKey] = labelValue;
|
|
||||||
})
|
|
||||||
: undefined;
|
|
||||||
|
|
||||||
labels !== undefined
|
|
||||||
? labels.forEach((item) => {
|
|
||||||
const key = item.value.key.toLowerCase().trim();
|
|
||||||
const value = item.value.value.toLowerCase().trim();
|
|
||||||
requestLabels[key] = value;
|
|
||||||
})
|
|
||||||
: undefined;
|
|
||||||
|
|
||||||
mounts !== undefined
|
|
||||||
? mounts.forEach((item) => {
|
|
||||||
const { destination } = item.value;
|
|
||||||
const { source } = item.value;
|
|
||||||
const { type } = item.value;
|
|
||||||
const { cinderVolumeSize } = item.value;
|
|
||||||
item.value.isCinderVolume !== true
|
|
||||||
? requestValumes.push({
|
|
||||||
destination,
|
|
||||||
source,
|
|
||||||
type,
|
|
||||||
})
|
|
||||||
: requestValumes.push({
|
|
||||||
destination,
|
|
||||||
cinderVolumeSize,
|
|
||||||
type,
|
|
||||||
});
|
|
||||||
})
|
|
||||||
: undefined;
|
|
||||||
|
|
||||||
const networks = [];
|
|
||||||
const securityGroups = [];
|
const securityGroups = [];
|
||||||
|
|
||||||
values.networkSelect &&
|
if (environmentVariables) {
|
||||||
values.networkSelect.selectedRowKeys.forEach((item) => {
|
environmentVariables.forEach((item) => {
|
||||||
networks.push({ network: item });
|
const labelKey = item.value.key.toLowerCase().trim();
|
||||||
|
const labelValue = item.value.value.toLowerCase().trim();
|
||||||
|
requestEnvironment[labelKey] = labelValue;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
values.ports &&
|
if (labels) {
|
||||||
values.ports.selectedRowKeys.forEach((item) => {
|
labels.forEach((item) => {
|
||||||
networks.push({ port: item });
|
const key = item.value.key.toLowerCase().trim();
|
||||||
|
const value = item.value.value.toLowerCase().trim();
|
||||||
|
requestLabels[key] = value;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
values.securityGroup &&
|
if (mounts) {
|
||||||
values.securityGroup.selectedRowKeys.forEach((item) => {
|
mounts.forEach((item) => {
|
||||||
securityGroups.push(item);
|
const { type, source, size, destination, isNewVolume } = item.value;
|
||||||
|
if (isNewVolume) {
|
||||||
|
requestVolumes.push({
|
||||||
|
type,
|
||||||
|
size,
|
||||||
|
destination,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
requestVolumes.push({
|
||||||
|
type,
|
||||||
|
source,
|
||||||
|
destination,
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return this.store.create({
|
if (networks) {
|
||||||
name: values.containerName,
|
(networks.selectedRowKeys || []).forEach((it) => {
|
||||||
image: values.image,
|
nets.push({ network: it });
|
||||||
command: values.command,
|
});
|
||||||
cpu: values.cpu,
|
}
|
||||||
memory: values.memory,
|
|
||||||
workdir: values.workingDirectory,
|
if (ports) {
|
||||||
|
(ports.selectedRowKeys || []).forEach((it) => {
|
||||||
|
nets.push({ port: it });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (securityGroup) {
|
||||||
|
(securityGroup.selectedRows || []).forEach((it) => {
|
||||||
|
securityGroups.push(it.name);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hints) {
|
||||||
|
hints.forEach((item) => {
|
||||||
|
const key = item.value.key.toLowerCase().trim();
|
||||||
|
const value = item.value.value.toLowerCase().trim();
|
||||||
|
requestHints[key] = value;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const body = {
|
||||||
|
environment: requestEnvironment,
|
||||||
labels: requestLabels,
|
labels: requestLabels,
|
||||||
environment: requestEnviranment,
|
mounts: requestVolumes,
|
||||||
restart_policy: {
|
hints: requestHints,
|
||||||
Name: values.exitPolicy === undefined ? 'no' : values.exitPolicy,
|
nets,
|
||||||
MaximumRetryCount: values.maxRetry === undefined ? 0 : values.maxRetry,
|
|
||||||
},
|
|
||||||
interactive: values.enableInteractiveMode,
|
|
||||||
image_driver: values.imageDriver,
|
|
||||||
security_groups: securityGroups,
|
security_groups: securityGroups,
|
||||||
nets: networks,
|
...rest,
|
||||||
runtime: values.runtime,
|
};
|
||||||
hostname: values.hostname,
|
|
||||||
auto_heal: values.enableAutoHeal,
|
if (images) {
|
||||||
availability_zone: values.availableZone,
|
body.image = (images.selectedRows[0] || {}).name;
|
||||||
hints: values.hints,
|
}
|
||||||
mounts: values.mounts,
|
|
||||||
});
|
if (exitPolicy) {
|
||||||
|
body.restart_policy = {
|
||||||
|
Name: exitPolicy,
|
||||||
|
...(maxRetry ? { MaximumRetryCount: maxRetry } : {}),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.store.create(body);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user