fix: fix cluster
1. Fix the params when create cluster 2. Fix kepair and template to select-table 3. Add status i18n 4. Ignore some params when edit cluster template Change-Id: I32cd968336c4e6119d08f32429cc15738431f170
This commit is contained in:
parent
b22a959e49
commit
7d890f64a6
@ -162,8 +162,13 @@ export default class index extends Component {
|
||||
|
||||
// eslint-disable-next-line no-shadow
|
||||
renderItem = (item, index) => {
|
||||
const { itemComponent, readonlyKeys = [], isInput = false } = this.props;
|
||||
const { placeholder, width } = this.props;
|
||||
const {
|
||||
itemComponent,
|
||||
readonlyKeys = [],
|
||||
isInput = false,
|
||||
placeholder,
|
||||
width,
|
||||
} = this.props;
|
||||
if (!itemComponent) {
|
||||
if (isInput) {
|
||||
return (
|
||||
|
@ -29,6 +29,7 @@
|
||||
"A template is a YAML file that contains configuration information, please enter the correct format.": "A template is a YAML file that contains configuration information, please enter the correct format.",
|
||||
"A template is a YAML file that contains configuration information.": "A template is a YAML file that contains configuration information.",
|
||||
"ADMINISTRATOR": "ADMINISTRATOR",
|
||||
"ADOPT COMPLETE": "ADOPT COMPLETE",
|
||||
"AH": "AH",
|
||||
"AKI - Amazon kernel image format": "AKI - Amazon kernel image format",
|
||||
"AMI - Amazon server image format": "AMI - Amazon server image format",
|
||||
@ -47,8 +48,6 @@
|
||||
"Access To": "Access To",
|
||||
"Access Type": "Access Type",
|
||||
"Access Type Setting": "Access Type Setting",
|
||||
"Accessible on private network only": "Accessible on private network only",
|
||||
"Accessible on the public internet": "Accessible on the public internet",
|
||||
"Action": "Action",
|
||||
"Action Log": "Action Log",
|
||||
"Active": "Active",
|
||||
@ -264,6 +263,7 @@
|
||||
"Burst limit": "Burst limit",
|
||||
"Burundi": "Burundi",
|
||||
"CA Certificate": "CA Certificate",
|
||||
"CHECK COMPLETE": "CHECK COMPLETE",
|
||||
"CIDR": "CIDR",
|
||||
"CIDR Format Error(e.g. 192.168.0.0/24, 2001:DB8::/48)": "CIDR Format Error(e.g. 192.168.0.0/24, 2001:DB8::/48)",
|
||||
"CIFS": "CIFS",
|
||||
@ -280,6 +280,9 @@
|
||||
"CPU value is { cpu }, NUMA CPU value is { totalCpu }, need to be equal. ": "CPU value is { cpu }, NUMA CPU value is { totalCpu }, need to be equal. ",
|
||||
"CPU(Core)": "CPU(Core)",
|
||||
"CPU/memory can only be increased or expanded online, and cannot be decreased or reduced online.": "CPU/memory can only be increased or expanded online, and cannot be decreased or reduced online.",
|
||||
"CREATE COMPLETE": "CREATE COMPLETE",
|
||||
"CREATE FAILED": "CREATE FAILED",
|
||||
"CREATE IN PROGRESS": "CREATE IN PROGRESS",
|
||||
"Cache Service": "Cache Service",
|
||||
"Cameroon": "Cameroon",
|
||||
"Can add { number } {name}": "Can add { number } {name}",
|
||||
@ -328,7 +331,6 @@
|
||||
"Choose a Private Network at first": "Choose a Private Network at first",
|
||||
"Choose a host to live migrate instance to. If not selected, the scheduler will auto select target host.": "Choose a host to live migrate instance to. If not selected, the scheduler will auto select target host.",
|
||||
"Choose a host to migrate instance to. If not selected, the scheduler will auto select target host.": "Choose a host to migrate instance to. If not selected, the scheduler will auto select target host.",
|
||||
"Choose an ingress controller": "Choose an ingress controller",
|
||||
"Choosing a QoS policy can limit bandwidth and DSCP": "Choosing a QoS policy can limit bandwidth and DSCP",
|
||||
"Christmas Island": "Christmas Island",
|
||||
"Cidr": "Cidr",
|
||||
@ -350,15 +352,11 @@
|
||||
"Close external gateway": "Close external gateway",
|
||||
"Cloud": "Cloud",
|
||||
"Cloud Platform": "Cloud Platform",
|
||||
"Cluster API": "Cluster API",
|
||||
"Cluster Advanced": "Cluster Advanced",
|
||||
"Cluster Create Timeout": "Cluster Create Timeout",
|
||||
"Cluster Detail": "Cluster Detail",
|
||||
"Cluster Distro": "Cluster Distro",
|
||||
"Cluster Management": "Cluster Management",
|
||||
"Cluster Name": "Cluster Name",
|
||||
"Cluster Network": "Cluster Network",
|
||||
"Cluster Size": "Cluster Size",
|
||||
"Cluster Template": "Cluster Template",
|
||||
"Cluster Template Detail": "Cluster Template Detail",
|
||||
"Cluster Template Name": "Cluster Template Name",
|
||||
@ -566,6 +564,9 @@
|
||||
"DC/OS": "DC/OS",
|
||||
"DCCP": "DCCP",
|
||||
"DEGRADED: One or more of the entity’s components are in ERROR": "DEGRADED: One or more of the entity’s components are in ERROR",
|
||||
"DELETE COMPLETE": "DELETE COMPLETE",
|
||||
"DELETE FAILED": "DELETE FAILED",
|
||||
"DELETE_IN PROGRESS": "DELETE_IN PROGRESS",
|
||||
"DHCP": "DHCP",
|
||||
"DHCP Agents": "DHCP Agents",
|
||||
"DISK IOPS": "DISK IOPS",
|
||||
@ -815,6 +816,7 @@
|
||||
"Enable Compute Host": "Enable Compute Host",
|
||||
"Enable Compute Service": "Enable Compute Service",
|
||||
"Enable Domain": "Enable Domain",
|
||||
"Enable Floating IP": "Enable Floating IP",
|
||||
"Enable HealthMonitor": "Enable HealthMonitor",
|
||||
"Enable Load Balancer": "Enable Load Balancer",
|
||||
"Enable Neutron Agent": "Enable Neutron Agent",
|
||||
@ -997,6 +999,7 @@
|
||||
"Guinea Bissau": "Guinea Bissau",
|
||||
"Guyana": "Guyana",
|
||||
"HDFS": "HDFS",
|
||||
"HEALTHY": "HEALTHY",
|
||||
"HTTP Proxy": "HTTP Proxy",
|
||||
"HTTP Version not supported (code: 505) ": "HTTP Version not supported (code: 505) ",
|
||||
"HTTPS Proxy": "HTTPS Proxy",
|
||||
@ -1137,7 +1140,6 @@
|
||||
"Info": "Info",
|
||||
"Info *": "Info *",
|
||||
"Ingress": "Ingress",
|
||||
"Ingress Controller": "Ingress Controller",
|
||||
"Init Complete": "Init Complete",
|
||||
"Init Failed": "Init Failed",
|
||||
"Init In Progress": "Init In Progress",
|
||||
@ -1819,6 +1821,12 @@
|
||||
"RAM": "RAM",
|
||||
"RAM(MiB)": "RAM(MiB)",
|
||||
"RAW - Raw disk image format": "RAW - Raw disk image format",
|
||||
"RESTORE COMPLETE": "RESTORE COMPLETE",
|
||||
"RESUME COMPLETE": "RESUME COMPLETE",
|
||||
"RESUME FAILED": "RESUME FAILED",
|
||||
"ROLLBACK COMPLETE": "ROLLBACK COMPLETE",
|
||||
"ROLLBACK FAILED": "ROLLBACK FAILED",
|
||||
"ROLLBACK IN PROGRESS": "ROLLBACK IN PROGRESS",
|
||||
"ROUND_ROBIN": "Round Robin",
|
||||
"RSVP": "RSVP",
|
||||
"Raid Interface": "Raid Interface",
|
||||
@ -1937,6 +1945,7 @@
|
||||
"Russia": "Russia",
|
||||
"Rwanda": "Rwanda",
|
||||
"SCTP": "SCTP",
|
||||
"SNAPSHOT COMPLETE": "SNAPSHOT COMPLETE",
|
||||
"SNAT Enabled": "SNAT Enabled",
|
||||
"SNI Certificate": "SNI Certificate",
|
||||
"SNI Enabled": "SNI Enabled",
|
||||
@ -2046,7 +2055,6 @@
|
||||
"Size (GiB)": "Size (GiB)",
|
||||
"Size of image to launch": "Size of image to launch",
|
||||
"Size(GiB)": "Size(GiB)",
|
||||
"Size: *": "Size: *",
|
||||
"Slovakia (Slovak Republic)": "Slovakia (Slovak Republic)",
|
||||
"Slovenia": "Slovenia",
|
||||
"Slow Query": "Slow Query",
|
||||
@ -2265,6 +2273,7 @@
|
||||
"The shelved offloaded instance only supports immediate deletion": "The shelved offloaded instance only supports immediate deletion",
|
||||
"The start source is a template used to create an instance. You can choose an image or a bootable volume.": "The start source is a template used to create an instance. You can choose an image or a bootable volume.",
|
||||
"The starting number must be less than the ending number": "The starting number must be less than the ending number",
|
||||
"The timeout for cluster creation in minutes.": "The timeout for cluster creation in minutes.",
|
||||
"The timeout period of waiting for the return of the health check request, the check timeout will be judged as a check failure": "The timeout period of waiting for the return of the health check request, the check timeout will be judged as a check failure",
|
||||
"The total amount of data is { total }, and the interface can support downloading { totalMax } pieces of data. If you need to download all the data, please contact the administrator.": "The total amount of data is { total }, and the interface can support downloading { totalMax } pieces of data. If you need to download all the data, please contact the administrator.",
|
||||
"The trait name of the flavor needs to correspond to the trait of the scheduling node; by injecting the necessary traits into the ironic instance, the computing service will only schedule the instance to the bare metal node with all necessary traits (for example: the trait of the scheduling node has HW_CPU_X86_VMX trait, and the flavor adds HW_CPU_X86_VMX, it can be scheduled to this node for necessary traits).": "The trait name of the flavor needs to correspond to the trait of the scheduling node; by injecting the necessary traits into the ironic instance, the computing service will only schedule the instance to the bare metal node with all necessary traits (for example: the trait of the scheduling node has HW_CPU_X86_VMX trait, and the flavor adds HW_CPU_X86_VMX, it can be scheduled to this node for necessary traits).",
|
||||
@ -2326,6 +2335,11 @@
|
||||
"Type of datastore": "Type of datastore",
|
||||
"Type to Scheduler Hints and press enter": "Type to Scheduler Hints and press enter",
|
||||
"UDPLite": "UDPLite",
|
||||
"UNHEALTHY": "UNHEALTHY",
|
||||
"UNKNOWN": "UNKNOWN",
|
||||
"UPDATE COMPLETE": "UPDATE COMPLETE",
|
||||
"UPDATE FAILED": "UPDATE FAILED",
|
||||
"UPDATE IN PROGRESS": "UPDATE IN PROGRESS",
|
||||
"USB Info": "USB Info",
|
||||
"USB Parameters": "USB Parameters",
|
||||
"USER": "USER",
|
||||
@ -2496,6 +2510,7 @@
|
||||
"When you do online backup of the volume that has been bound, you need to pay attention to the following points:": "When you do online backup of the volume that has been bound, you need to pay attention to the following points:",
|
||||
"When you restore a backup, you need to meet one of the following conditions:": "When you restore a backup, you need to meet one of the following conditions:",
|
||||
"When your Yaml file is a fixed template, variable variables can be stored in an environment variable file to implement template deployment. The parameters in the environment variable file need to match the parameters defined in the template file.": "When your Yaml file is a fixed template, variable variables can be stored in an environment variable file to implement template deployment. The parameters in the environment variable file need to match the parameters defined in the template file.",
|
||||
"Whether enable or not using the floating IP of cloud provider. If it’s not set, the value of this in template will be used.": "Whether enable or not using the floating IP of cloud provider. If it’s not set, the value of this in template will be used.",
|
||||
"Whether the Login Name can be used is up to the feasible configuration of cloud-init or cloudbase-init service in the image.": "Whether the Login Name can be used is up to the feasible configuration of cloud-init or cloudbase-init service in the image.",
|
||||
"Whether the boot device should be set only for the next reboot, or persistently.": "Whether the boot device should be set only for the next reboot, or persistently.",
|
||||
"Which Network Interface provider to use when plumbing the network connections for this Node": "Which Network Interface provider to use when plumbing the network connections for this Node",
|
||||
@ -2683,8 +2698,6 @@
|
||||
"networks": "networks",
|
||||
"neutron agent": "neutron agent",
|
||||
"neutron agents": "neutron agents",
|
||||
"nginx": "nginx",
|
||||
"octavia": "octavia",
|
||||
"online resize": "online resize",
|
||||
"open external gateway": "open external gateway",
|
||||
"out": "out",
|
||||
@ -2760,7 +2773,6 @@
|
||||
"the vpn gateway is in use": "the vpn gateway is in use",
|
||||
"time / 24h": "time / 24h",
|
||||
"to delete": "to delete",
|
||||
"traefik": "traefik",
|
||||
"transmit": "transmit",
|
||||
"unlock instance": "unlock instance",
|
||||
"unpause instance": "unpause instance",
|
||||
|
@ -29,6 +29,7 @@
|
||||
"A template is a YAML file that contains configuration information, please enter the correct format.": "模板是包含配置信息的YAML文件, 请输入正确的格式。",
|
||||
"A template is a YAML file that contains configuration information.": "模板是包含配置信息的YAML文件。",
|
||||
"ADMINISTRATOR": "管理员",
|
||||
"ADOPT COMPLETE": "采用完成",
|
||||
"AH": "",
|
||||
"AKI - Amazon kernel image format": "AKI - Amazon 内核图像格式",
|
||||
"AMI - Amazon server image format": "AMI - Amazon 服务器图像格式",
|
||||
@ -47,8 +48,6 @@
|
||||
"Access To": "访问",
|
||||
"Access Type": "访问类型",
|
||||
"Access Type Setting": "访问类型设置",
|
||||
"Accessible on private network only": "只能在专用网络上访问",
|
||||
"Accessible on the public internet": "可在公共互联网上访问",
|
||||
"Action": "操作",
|
||||
"Action Log": "操作日志",
|
||||
"Active": "运行中",
|
||||
@ -264,6 +263,7 @@
|
||||
"Burst limit": "突发限制",
|
||||
"Burundi": "布隆迪",
|
||||
"CA Certificate": "CA证书",
|
||||
"CHECK COMPLETE": "检查完成",
|
||||
"CIDR": "网络地址",
|
||||
"CIDR Format Error(e.g. 192.168.0.0/24, 2001:DB8::/48)": "CIDR格式错误(如:192.168.0.0/24, 2001:DB8::/48)",
|
||||
"CIFS": "CIFS",
|
||||
@ -280,6 +280,9 @@
|
||||
"CPU value is { cpu }, NUMA CPU value is { totalCpu }, need to be equal. ": "CPU核数是 { cpu },NUMA节点的CPU核数是{ totalCpu },需要一致。",
|
||||
"CPU(Core)": "CPU(核数)",
|
||||
"CPU/memory can only be increased or expanded online, and cannot be decreased or reduced online.": "CPU/内存均只能在线增或扩展,不能在线减少或缩小。",
|
||||
"CREATE COMPLETE": "创建完成",
|
||||
"CREATE FAILED": "创建失败",
|
||||
"CREATE IN PROGRESS": "创建中",
|
||||
"Cache Service": "缓存服务",
|
||||
"Cameroon": "喀麦隆",
|
||||
"Can add { number } {name}": "还可添加 { number } {name}",
|
||||
@ -328,7 +331,6 @@
|
||||
"Choose a Private Network at first": "首先选择一个专用网络",
|
||||
"Choose a host to live migrate instance to. If not selected, the scheduler will auto select target host.": "选择计算节点来热迁移云主机,如果没有选择,调度器会自动选择目标计算节点。",
|
||||
"Choose a host to migrate instance to. If not selected, the scheduler will auto select target host.": "选择计算节点来迁移云主机,如果没有选择,调度器会自动选择目标计算节点。",
|
||||
"Choose an ingress controller": "选择入口控制器",
|
||||
"Choosing a QoS policy can limit bandwidth and DSCP": "选择QoS策略可以限制带宽和DSCP",
|
||||
"Christmas Island": "圣延岛",
|
||||
"Cidr": "网段",
|
||||
@ -350,15 +352,11 @@
|
||||
"Close external gateway": "关闭公网网关",
|
||||
"Cloud": "云",
|
||||
"Cloud Platform": "云平台",
|
||||
"Cluster API": "集群API",
|
||||
"Cluster Advanced": "集群高级",
|
||||
"Cluster Create Timeout": "集群创建超时",
|
||||
"Cluster Detail": "集群详情",
|
||||
"Cluster Distro": "集群发行版",
|
||||
"Cluster Management": "集群管理",
|
||||
"Cluster Name": "集群名称",
|
||||
"Cluster Network": "集群网络",
|
||||
"Cluster Size": "集群大小",
|
||||
"Cluster Template": "集群模板",
|
||||
"Cluster Template Detail": "集群模板详情",
|
||||
"Cluster Template Name": "集群模板名称",
|
||||
@ -566,6 +564,9 @@
|
||||
"DC/OS": "DC/OS",
|
||||
"DCCP": "DCCP",
|
||||
"DEGRADED: One or more of the entity’s components are in ERROR": "降级:一个或多个实体的组件都处于错误状态",
|
||||
"DELETE COMPLETE": "删除完成",
|
||||
"DELETE FAILED": "删除失败",
|
||||
"DELETE_IN PROGRESS": "删除中",
|
||||
"DHCP": "DHCP",
|
||||
"DHCP Agents": "DHCP服务",
|
||||
"DISK IOPS": "硬盘IOPS",
|
||||
@ -815,6 +816,7 @@
|
||||
"Enable Compute Host": "启用计算节点",
|
||||
"Enable Compute Service": "启用计算服务",
|
||||
"Enable Domain": "启用域",
|
||||
"Enable Floating IP": "使用浮动IP",
|
||||
"Enable HealthMonitor": "启用健康检查",
|
||||
"Enable Load Balancer": "启用负载均衡",
|
||||
"Enable Neutron Agent": "启用网络服务",
|
||||
@ -997,6 +999,7 @@
|
||||
"Guinea Bissau": "几内亚比绍",
|
||||
"Guyana": "圭亚那",
|
||||
"HDFS": "HDFS",
|
||||
"HEALTHY": "健康",
|
||||
"HTTP Proxy": "HTTP代理",
|
||||
"HTTP Version not supported (code: 505) ": "",
|
||||
"HTTPS Proxy": "HTTPS代理",
|
||||
@ -1137,7 +1140,6 @@
|
||||
"Info": "信息",
|
||||
"Info *": "信息 *",
|
||||
"Ingress": "入口",
|
||||
"Ingress Controller": "入口控制器",
|
||||
"Init Complete": "初始化完成",
|
||||
"Init Failed": "初始化失败",
|
||||
"Init In Progress": "正在初始化",
|
||||
@ -1819,6 +1821,12 @@
|
||||
"RAM": "内存",
|
||||
"RAM(MiB)": "内存(MiB)",
|
||||
"RAW - Raw disk image format": "RAW - 原始磁盘映像格式",
|
||||
"RESTORE COMPLETE": "恢复完成",
|
||||
"RESUME COMPLETE": "恢复完成",
|
||||
"RESUME FAILED": "恢复失败",
|
||||
"ROLLBACK COMPLETE": "回滚完成",
|
||||
"ROLLBACK FAILED": "回滚失败",
|
||||
"ROLLBACK IN PROGRESS": "回滚中",
|
||||
"ROUND_ROBIN": "轮询算法",
|
||||
"RSVP": "",
|
||||
"Raid Interface": "Raid接口",
|
||||
@ -1937,6 +1945,7 @@
|
||||
"Russia": "俄罗斯",
|
||||
"Rwanda": "卢旺达",
|
||||
"SCTP": "",
|
||||
"SNAPSHOT COMPLETE": "快照完成",
|
||||
"SNAT Enabled": "启用SNAT",
|
||||
"SNI Certificate": "SNI证书",
|
||||
"SNI Enabled": "SNI开启",
|
||||
@ -2046,7 +2055,6 @@
|
||||
"Size (GiB)": "容量 (GiB)",
|
||||
"Size of image to launch": "启动的镜像大小",
|
||||
"Size(GiB)": "大小(GiB)",
|
||||
"Size: *": "容量 *",
|
||||
"Slovakia (Slovak Republic)": "斯洛伐克",
|
||||
"Slovenia": "斯洛文尼亚",
|
||||
"Slow Query": "",
|
||||
@ -2265,6 +2273,7 @@
|
||||
"The shelved offloaded instance only supports immediate deletion": "已归档的云主机仅支持立即删除",
|
||||
"The start source is a template used to create an instance. You can choose an image or a bootable volume.": "启动源是用来创建云主机的模板, 您可以选择镜像或者可启动的卷。",
|
||||
"The starting number must be less than the ending number": "起始数字必须小于结束数字",
|
||||
"The timeout for cluster creation in minutes.": "集群创建超时时间,以分钟为单位。",
|
||||
"The timeout period of waiting for the return of the health check request, the check timeout will be judged as a check failure": "等待健康检查请求返回的超时时间,检查超时将会被判定为一次检查失败",
|
||||
"The total amount of data is { total }, and the interface can support downloading { totalMax } pieces of data. If you need to download all the data, please contact the administrator.": "数据总量为{ total },界面可支持下载{ totalMax }条数据,如需下载全部数据,请联系管理员。",
|
||||
"The trait name of the flavor needs to correspond to the trait of the scheduling node; by injecting the necessary traits into the ironic instance, the computing service will only schedule the instance to the bare metal node with all necessary traits (for example: the trait of the scheduling node has HW_CPU_X86_VMX trait, and the flavor adds HW_CPU_X86_VMX, it can be scheduled to this node for necessary traits).": "云主机类型的特性名称需要与调度节点的特性对应;通过给裸机实例注入必需特性,计算服务将只调度实例到具有所有必需特性的裸金属节点(比如:调度节点的有 HW_CPU_X86_VMX的特性,云主机类型添加HW_CPU_X86_VMX为必需特性,可以调度到此节点)。",
|
||||
@ -2326,6 +2335,11 @@
|
||||
"Type of datastore": "数据存储类型",
|
||||
"Type to Scheduler Hints and press enter": "输入调度程序提示并按回车键",
|
||||
"UDPLite": "",
|
||||
"UNHEALTHY": "不健康",
|
||||
"UNKNOWN": "未知",
|
||||
"UPDATE COMPLETE": "更新完成",
|
||||
"UPDATE FAILED": "更新失败",
|
||||
"UPDATE IN PROGRESS": "更新中",
|
||||
"USB Info": "USB 信息",
|
||||
"USB Parameters": "USB参数",
|
||||
"USER": "用户",
|
||||
@ -2496,6 +2510,7 @@
|
||||
"When you do online backup of the volume that has been bound, you need to pay attention to the following points:": "当您对已经绑定的硬盘做在线备份时,需要注意以下几点:",
|
||||
"When you restore a backup, you need to meet one of the following conditions:": "当您恢复备份时,需要满足以下条件之一:",
|
||||
"When your Yaml file is a fixed template, variable variables can be stored in an environment variable file to implement template deployment. The parameters in the environment variable file need to match the parameters defined in the template file.": "当您的Yaml文件为一个固定模版时,可变变量可以存放在环境变量文件中来实现模版部署,环境变量文件中的参数需要与模版文件中定义的参数保持匹配。",
|
||||
"Whether enable or not using the floating IP of cloud provider. If it’s not set, the value of this in template will be used.": "是否启用或不使用云服务商的浮动IP。如果未设置,则使用模板中的值。",
|
||||
"Whether the Login Name can be used is up to the feasible configuration of cloud-init or cloudbase-init service in the image.": "用户名是否可登录取决于镜像中的cloud-init或cloudbase-init服务的预制配置",
|
||||
"Whether the boot device should be set only for the next reboot, or persistently.": "是否永久使用该引导设置。",
|
||||
"Which Network Interface provider to use when plumbing the network connections for this Node": "当为这个节点连接网络时,使用哪个网络接口提供者",
|
||||
@ -2683,8 +2698,6 @@
|
||||
"networks": "网络",
|
||||
"neutron agent": "网络服务",
|
||||
"neutron agents": "网络服务",
|
||||
"nginx": "nginx",
|
||||
"octavia": "octavia",
|
||||
"online resize": "在线修改配置",
|
||||
"open external gateway": "开启公网网关",
|
||||
"out": "出",
|
||||
@ -2760,7 +2773,6 @@
|
||||
"the vpn gateway is in use": "VPN网关正在使用中",
|
||||
"time / 24h": "次/24小时",
|
||||
"to delete": "即将删除",
|
||||
"traefik": "traefik",
|
||||
"transmit": "发送",
|
||||
"unlock instance": "解锁云主机",
|
||||
"unpause instance": "恢复云主机",
|
||||
|
@ -13,6 +13,7 @@
|
||||
import React from 'react';
|
||||
import Base from 'containers/BaseDetail';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { isEmpty } from 'lodash';
|
||||
|
||||
export class BaseDetail extends Base {
|
||||
get leftCards() {
|
||||
@ -198,7 +199,7 @@ export class BaseDetail extends Base {
|
||||
label: t('labels'),
|
||||
dataIndex: 'labels',
|
||||
render: (value) =>
|
||||
value
|
||||
!isEmpty(value)
|
||||
? Object.entries(value).map(([key, val]) => {
|
||||
return (
|
||||
<div key={key}>
|
||||
|
@ -13,6 +13,7 @@
|
||||
import Base from 'components/Form';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import KeyValueInput from 'components/FormItem/KeyValueInput';
|
||||
import { admission_control_list } from 'resources/magnum/template';
|
||||
|
||||
export class StepLabel extends Base {
|
||||
get title() {
|
||||
@ -32,7 +33,16 @@ export class StepLabel extends Base {
|
||||
}
|
||||
|
||||
get defaultValue() {
|
||||
const values = {};
|
||||
const values = {
|
||||
additionalLabels: [
|
||||
{
|
||||
value: {
|
||||
key: 'admission_control_list',
|
||||
value: admission_control_list,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
if (this.isEdit) {
|
||||
const {
|
||||
extra: { labels },
|
||||
|
@ -159,6 +159,7 @@ export class StepNetwork extends Base {
|
||||
}
|
||||
|
||||
get formItems() {
|
||||
const { extra: { network_driver, external_network_id } = {} } = this.props;
|
||||
return [
|
||||
{
|
||||
name: 'network_driver',
|
||||
@ -166,6 +167,7 @@ export class StepNetwork extends Base {
|
||||
placeholder: t('Choose a Network Driver'),
|
||||
type: 'select',
|
||||
options: this.getNetworkDriver,
|
||||
disabled: network_driver && this.isEdit,
|
||||
},
|
||||
{
|
||||
name: 'http_proxy',
|
||||
@ -191,6 +193,7 @@ export class StepNetwork extends Base {
|
||||
placeholder: t('Choose a External Network'),
|
||||
type: 'select',
|
||||
options: this.getFloatingIpList,
|
||||
disabled: external_network_id && this.isEdit,
|
||||
},
|
||||
{
|
||||
name: 'fixed_network',
|
||||
|
@ -14,7 +14,6 @@ import { inject, observer } from 'mobx-react';
|
||||
import { StepAction } from 'src/containers/Action';
|
||||
import globalClusterTemplateStore from 'src/stores/magnum/clusterTemplates';
|
||||
import { toJS } from 'mobx';
|
||||
import { admission_control_list } from 'resources/magnum/template';
|
||||
import StepInfo from './StepInfo';
|
||||
import StepNodeSpec from './StepNodeSpec';
|
||||
import StepNetwork from './StepNetwork';
|
||||
@ -105,10 +104,7 @@ export class StepCreate extends StepAction {
|
||||
}
|
||||
|
||||
const body = {
|
||||
labels: {
|
||||
...requestLabels,
|
||||
admission_control_list,
|
||||
},
|
||||
labels: requestLabels,
|
||||
...rest,
|
||||
};
|
||||
if (flavor) {
|
||||
|
@ -13,6 +13,7 @@
|
||||
import Base from 'containers/List';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import globalClusterTemplateStore from 'src/stores/magnum/clusterTemplates';
|
||||
import { getBaseTemplateColumns } from 'resources/magnum/template';
|
||||
import actionConfigs from './actions';
|
||||
|
||||
export class ClusterTemplates extends Base {
|
||||
@ -33,35 +34,7 @@ export class ClusterTemplates extends Base {
|
||||
return actionConfigs;
|
||||
}
|
||||
|
||||
getColumns = () => [
|
||||
{
|
||||
title: t('ID'),
|
||||
dataIndex: 'uuid',
|
||||
render: (data) => {
|
||||
return this.getLinkRender('containerInfraClusterTemplateDetail', data, {
|
||||
id: data,
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
title: t('COE'),
|
||||
isHideable: true,
|
||||
dataIndex: 'coe',
|
||||
},
|
||||
{
|
||||
title: t('Network Driver'),
|
||||
isHideable: true,
|
||||
dataIndex: 'network_driver',
|
||||
},
|
||||
{
|
||||
title: t('Keypair'),
|
||||
isHideable: true,
|
||||
dataIndex: 'keypair_id',
|
||||
render: (value) => {
|
||||
return this.getLinkRender('keypairDetail', value, { id: value });
|
||||
},
|
||||
},
|
||||
];
|
||||
getColumns = () => getBaseTemplateColumns(this);
|
||||
}
|
||||
|
||||
export default inject('rootStore')(observer(ClusterTemplates));
|
||||
|
@ -13,11 +13,11 @@
|
||||
// limitations under the License.
|
||||
|
||||
import Base from 'containers/BaseDetail';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import React from 'react';
|
||||
|
||||
export class BaseDetail extends Base {
|
||||
|
||||
get leftCards() {
|
||||
return [this.baseInfoCard, this.miscellaneousCard];
|
||||
}
|
||||
@ -27,47 +27,84 @@ export class BaseDetail extends Base {
|
||||
}
|
||||
|
||||
get baseInfoCard() {
|
||||
const { template = {} } = this.detailData;
|
||||
const templateUrl = template
|
||||
? this.getLinkRender(
|
||||
'containerInfraClusterTemplateDetail',
|
||||
template.name,
|
||||
{
|
||||
id: template.uuid,
|
||||
}
|
||||
)
|
||||
: '-';
|
||||
const options = [
|
||||
{
|
||||
label: t('Name'),
|
||||
dataIndex: "template.name",
|
||||
render: (value) => {
|
||||
return this.getLinkRender('containerInfraClusterTemplateDetail', value, { id: this.detailData.template.uuid })
|
||||
},
|
||||
dataIndex: 'template.name',
|
||||
content: templateUrl,
|
||||
},
|
||||
{
|
||||
label: t("ID"),
|
||||
dataIndex: "template.uuid"
|
||||
label: t('ID'),
|
||||
dataIndex: 'template.uuid',
|
||||
},
|
||||
{
|
||||
label: t("COE"),
|
||||
dataIndex: "template.coe",
|
||||
label: t('COE'),
|
||||
dataIndex: 'template.coe',
|
||||
},
|
||||
{
|
||||
label: t("Image ID"),
|
||||
dataIndex: "template.image_id",
|
||||
}
|
||||
label: t('Image ID'),
|
||||
dataIndex: 'template.image_id',
|
||||
},
|
||||
];
|
||||
|
||||
return {
|
||||
title: t('Cluster Template'),
|
||||
options,
|
||||
labelCol: 6,
|
||||
contentCol: 18,
|
||||
};
|
||||
}
|
||||
|
||||
get miscellaneousCard() {
|
||||
const { master_flavor_id, flavor_id, keypair } = this.detailData;
|
||||
const masterFlavorUrl = master_flavor_id
|
||||
? this.getLinkRender('flavorDetail', master_flavor_id, {
|
||||
id: master_flavor_id,
|
||||
})
|
||||
: '-';
|
||||
|
||||
const flavorUrl = flavor_id
|
||||
? this.getLinkRender('flavorDetail', flavor_id, {
|
||||
id: flavor_id,
|
||||
})
|
||||
: '-';
|
||||
|
||||
const keypairUrl = keypair
|
||||
? this.getLinkRender('keypairDetail', keypair, {
|
||||
id: keypair,
|
||||
})
|
||||
: '-';
|
||||
|
||||
const options = [
|
||||
{
|
||||
label: t('Discovery URL'),
|
||||
dataIndex: 'discovery_url',
|
||||
render: (value) =>
|
||||
value ? (
|
||||
<a href={value} target="blank">
|
||||
{value}
|
||||
</a>
|
||||
) : (
|
||||
'-'
|
||||
),
|
||||
},
|
||||
{
|
||||
label: t('Cluster Create Timeout'),
|
||||
label: t('Timeout(Minute)'),
|
||||
dataIndex: 'create_timeout',
|
||||
},
|
||||
{
|
||||
label: t('Keypair'),
|
||||
dataIndex: 'keypair',
|
||||
content: keypairUrl,
|
||||
},
|
||||
{
|
||||
label: t('Docker Volume Size'),
|
||||
@ -75,11 +112,11 @@ export class BaseDetail extends Base {
|
||||
},
|
||||
{
|
||||
label: t('Master Flavor ID'),
|
||||
dataIndex: 'master_flavor_id',
|
||||
content: masterFlavorUrl,
|
||||
},
|
||||
{
|
||||
label: t('Node Flavor ID'),
|
||||
dataIndex: 'flavor_id',
|
||||
content: flavorUrl,
|
||||
},
|
||||
{
|
||||
label: t('COE Version'),
|
||||
@ -114,10 +151,14 @@ export class BaseDetail extends Base {
|
||||
{
|
||||
label: t('Master Addresses'),
|
||||
dataIndex: 'master_addresses',
|
||||
render: (value) =>
|
||||
value && value.length ? value.map((it) => <div>{it}</div>) : '-',
|
||||
},
|
||||
{
|
||||
label: t('Node Addresses'),
|
||||
dataIndex: 'node_addresses',
|
||||
render: (value) =>
|
||||
value && value.length ? value.map((it) => <div>{it}</div>) : '-',
|
||||
},
|
||||
];
|
||||
|
||||
@ -134,17 +175,19 @@ export class BaseDetail extends Base {
|
||||
label: t('Labels'),
|
||||
dataIndex: 'labels',
|
||||
render: (value) =>
|
||||
Object.entries(value).map(([key, val]) => {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<ul>
|
||||
<li>
|
||||
!isEmpty(value) ? (
|
||||
<ul>
|
||||
{Object.entries(value).map(([key, val]) => {
|
||||
return (
|
||||
<li key={key}>
|
||||
{key} : {val}
|
||||
</li>
|
||||
</ul>
|
||||
</React.Fragment>
|
||||
);
|
||||
}),
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
) : (
|
||||
'-'
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
@ -164,9 +207,20 @@ export class BaseDetail extends Base {
|
||||
{
|
||||
label: t('Stack Faults'),
|
||||
dataIndex: 'faults',
|
||||
render: (value) => value ? Object.entries(value).map(([key, val]) => {
|
||||
return <React.Fragment><ul><li>{key} : {val}</li></ul></React.Fragment>
|
||||
}) : " - "
|
||||
render: (value) =>
|
||||
!isEmpty(value) ? (
|
||||
<ul>
|
||||
{Object.entries(value).map(([key, val]) => {
|
||||
return (
|
||||
<li key={key}>
|
||||
{key} : {val}
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
) : (
|
||||
'-'
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
@ -178,4 +232,4 @@ export class BaseDetail extends Base {
|
||||
}
|
||||
}
|
||||
|
||||
export default inject("rootStore")(observer(BaseDetail))
|
||||
export default inject('rootStore')(observer(BaseDetail));
|
||||
|
@ -14,8 +14,11 @@
|
||||
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import Base from 'containers/TabDetail';
|
||||
import BaseDetail from './BaseDetail';
|
||||
import { clusterStatus, healthStatus } from 'resources/magnum/cluster';
|
||||
import globalClustersStore from 'src/stores/magnum/clusters';
|
||||
import { isEmpty } from 'lodash';
|
||||
import BaseDetail from './BaseDetail';
|
||||
import actionConfigs from '../actions';
|
||||
|
||||
export class ClustersDetail extends Base {
|
||||
init() {
|
||||
@ -34,6 +37,10 @@ export class ClustersDetail extends Base {
|
||||
return 'container-infra:cluster:detail';
|
||||
}
|
||||
|
||||
get actionConfigs() {
|
||||
return actionConfigs;
|
||||
}
|
||||
|
||||
get detailInfos() {
|
||||
return [
|
||||
{
|
||||
@ -53,6 +60,7 @@ export class ClustersDetail extends Base {
|
||||
{
|
||||
title: t('Status'),
|
||||
dataIndex: 'status',
|
||||
render: (value) => clusterStatus[value] || value,
|
||||
},
|
||||
{
|
||||
title: t('Status Reason'),
|
||||
@ -61,11 +69,12 @@ export class ClustersDetail extends Base {
|
||||
{
|
||||
title: t('Health Status'),
|
||||
dataIndex: 'health_status',
|
||||
render: (value) => healthStatus[value] || value || '-',
|
||||
},
|
||||
{
|
||||
title: t('Health Status Reason'),
|
||||
dataIndex: 'health_status_reason',
|
||||
render: (value) => (value.length > 0 ? value : '-'),
|
||||
render: (value) => (isEmpty(value) ? '-' : JSON.stringify(value)),
|
||||
},
|
||||
];
|
||||
}
|
||||
@ -81,4 +90,4 @@ export class ClustersDetail extends Base {
|
||||
}
|
||||
}
|
||||
|
||||
export default inject("rootStore")(observer(ClustersDetail))
|
||||
export default inject('rootStore')(observer(ClustersDetail));
|
||||
|
@ -40,5 +40,5 @@ export default class DeleteClusters extends ConfirmAction {
|
||||
|
||||
allowedCheckFunc = () => true;
|
||||
|
||||
onSubmit = (data) => globalClustersStore.delete({ id: data.uuid });
|
||||
onSubmit = (data) => globalClustersStore.delete({ id: data.id });
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import { inject, observer } from 'mobx-react';
|
||||
import { ModalAction } from 'src/containers/Action';
|
||||
import globalClustersStore from 'stores/magnum/clusters';
|
||||
|
||||
export class ResizeClusters extends ModalAction {
|
||||
export class Resize extends ModalAction {
|
||||
init() {
|
||||
this.store = globalClustersStore;
|
||||
}
|
||||
@ -33,16 +33,21 @@ export class ResizeClusters extends ModalAction {
|
||||
return t('Resize Cluster');
|
||||
}
|
||||
|
||||
get buttonText() {
|
||||
return t('Resize');
|
||||
static buttonText = t('Resize');
|
||||
|
||||
get defaultValue() {
|
||||
const { node_count } = this.item;
|
||||
return {
|
||||
node_count: node_count || 1,
|
||||
};
|
||||
}
|
||||
|
||||
get formItems() {
|
||||
return [
|
||||
{
|
||||
name: 'node_count',
|
||||
label: t('Instance'),
|
||||
type: 'input-number',
|
||||
label: t('Node Count'),
|
||||
type: 'input-int',
|
||||
min: 1,
|
||||
required: true,
|
||||
},
|
||||
@ -50,11 +55,8 @@ export class ResizeClusters extends ModalAction {
|
||||
}
|
||||
|
||||
onSubmit = (data) => {
|
||||
this.store.update(
|
||||
{ id: this.props.item.uuid },
|
||||
{ node_count: data.node_count }
|
||||
);
|
||||
this.store.resize({ id: this.item.id }, data);
|
||||
};
|
||||
}
|
||||
|
||||
export default inject("rootStore")(observer(ResizeClusters))
|
||||
export default inject('rootStore')(observer(Resize));
|
||||
|
@ -1,112 +0,0 @@
|
||||
// Copyright 2021 99cloud
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import Base from 'components/Form';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
|
||||
import globalClusterTemplateStore from 'stores/magnum/clusterTemplates';
|
||||
import globalAvailabilityZoneStore from 'stores/nova/zone';
|
||||
import globalKeypairStore from 'stores/nova/keypair';
|
||||
|
||||
export class StepDetails extends Base {
|
||||
init() {
|
||||
this.getClustertemplates();
|
||||
this.getAvailableZones();
|
||||
this.getKeypairs();
|
||||
}
|
||||
|
||||
get title() {
|
||||
return t('Cluster Detail');
|
||||
}
|
||||
|
||||
get name() {
|
||||
return t('Cluster Detail');
|
||||
}
|
||||
|
||||
async getClustertemplates() {
|
||||
globalClusterTemplateStore.fetchList();
|
||||
}
|
||||
|
||||
get getClusterTemplateList() {
|
||||
return (globalClusterTemplateStore.list.data || []).map((it) => ({
|
||||
value: it.uuid,
|
||||
label: it.name,
|
||||
}));
|
||||
}
|
||||
|
||||
async getAvailableZones() {
|
||||
globalAvailabilityZoneStore.fetchListWithoutDetail();
|
||||
}
|
||||
|
||||
get getAvailableZonesList() {
|
||||
return (globalAvailabilityZoneStore.list.data || [])
|
||||
.filter((it) => it.zoneState.available)
|
||||
.map((it) => ({
|
||||
value: it.zoneName,
|
||||
label: it.zoneName,
|
||||
}));
|
||||
}
|
||||
|
||||
async getKeypairs() {
|
||||
globalKeypairStore.fetchList();
|
||||
}
|
||||
|
||||
get getKeypairList() {
|
||||
return (globalKeypairStore.list.data || []).map((it) => ({
|
||||
value: it.name,
|
||||
label: it.name,
|
||||
}));
|
||||
}
|
||||
|
||||
get formItems() {
|
||||
return [
|
||||
{
|
||||
name: "clusterName",
|
||||
label: t("Cluster Name"),
|
||||
type: "input",
|
||||
required: true
|
||||
},
|
||||
{
|
||||
name: "clusterTemplateId",
|
||||
label: t("Cluster Template"),
|
||||
type: "select",
|
||||
placeholder: t('Please select'),
|
||||
options: this.getClusterTemplateList,
|
||||
allowClear: true,
|
||||
showSearch: true,
|
||||
required: true
|
||||
},
|
||||
{
|
||||
name: "availabilityZone",
|
||||
label: t("Availability Zone"),
|
||||
type: "select",
|
||||
options: this.getAvailableZonesList,
|
||||
allowClear: true,
|
||||
showSearch: true,
|
||||
required: true
|
||||
},
|
||||
{
|
||||
name: "keypair",
|
||||
label: t("Keypair"),
|
||||
type: "select",
|
||||
options: this.getKeypairList,
|
||||
allowClear: true,
|
||||
showSearch: true,
|
||||
required: true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
export default inject("rootStore")(observer(StepDetails))
|
@ -0,0 +1,106 @@
|
||||
// Copyright 2021 99cloud
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import Base from 'components/Form';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import globalClusterTemplateStore from 'stores/magnum/clusterTemplates';
|
||||
import globalKeypairStore from 'stores/nova/keypair';
|
||||
import { getBaseTemplateColumns } from 'resources/magnum/template';
|
||||
|
||||
export class StepInfo extends Base {
|
||||
init() {
|
||||
this.getClustertemplates();
|
||||
this.getKeypairs();
|
||||
}
|
||||
|
||||
get title() {
|
||||
return t('Info');
|
||||
}
|
||||
|
||||
get name() {
|
||||
return t('Info');
|
||||
}
|
||||
|
||||
async getClustertemplates() {
|
||||
await globalClusterTemplateStore.fetchList();
|
||||
}
|
||||
|
||||
get clusterTemplates() {
|
||||
return globalClusterTemplateStore.list.data || [];
|
||||
}
|
||||
|
||||
async getKeypairs() {
|
||||
await globalKeypairStore.fetchList();
|
||||
}
|
||||
|
||||
get keypairs() {
|
||||
return globalKeypairStore.list.data || [];
|
||||
}
|
||||
|
||||
get formItems() {
|
||||
return [
|
||||
{
|
||||
name: 'name',
|
||||
label: t('Cluster Name'),
|
||||
type: 'input',
|
||||
placeholder: t('Cluster Name'),
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'clusterTemplate',
|
||||
label: t('Cluster Template'),
|
||||
type: 'select-table',
|
||||
data: this.clusterTemplates,
|
||||
isLoading: globalClusterTemplateStore.list.isLoading,
|
||||
required: true,
|
||||
filterParams: [
|
||||
{
|
||||
label: t('Name'),
|
||||
name: 'name',
|
||||
},
|
||||
],
|
||||
columns: getBaseTemplateColumns(this),
|
||||
},
|
||||
{
|
||||
name: 'keypair',
|
||||
label: t('Keypair'),
|
||||
type: 'select-table',
|
||||
required: true,
|
||||
data: this.keypairs,
|
||||
isLoading: globalKeypairStore.list.isLoading,
|
||||
tip: t(
|
||||
'The SSH key is a way to remotely log in to the instance. The cloud platform only helps to keep the public key. Please keep your private key properly.'
|
||||
),
|
||||
filterParams: [
|
||||
{
|
||||
label: t('Name'),
|
||||
name: 'name',
|
||||
},
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
title: t('Name'),
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: t('Fingerprint'),
|
||||
dataIndex: 'fingerprint',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
export default inject('rootStore')(observer(StepInfo));
|
@ -12,18 +12,32 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import Base from "components/Form"
|
||||
import { inject, observer } from "mobx-react";
|
||||
import Base from 'components/Form';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import KeyValueInput from 'components/FormItem/KeyValueInput';
|
||||
import { admission_control_list } from 'resources/magnum/template';
|
||||
|
||||
export class StepAdvanced extends Base {
|
||||
|
||||
export class StepLabel extends Base {
|
||||
get title() {
|
||||
return t("Cluster Advanced")
|
||||
return t('Labels');
|
||||
}
|
||||
|
||||
get name() {
|
||||
return t("Cluster Advanced")
|
||||
return t('Labels');
|
||||
}
|
||||
|
||||
get defaultValue() {
|
||||
const values = {
|
||||
additionalLabels: [
|
||||
{
|
||||
value: {
|
||||
key: 'admission_control_list',
|
||||
value: admission_control_list,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
return values;
|
||||
}
|
||||
|
||||
get formItems() {
|
||||
@ -34,9 +48,9 @@ export class StepAdvanced extends Base {
|
||||
type: 'add-select',
|
||||
itemComponent: KeyValueInput,
|
||||
addText: t('Add Label'),
|
||||
}
|
||||
]
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
export default inject("rootStore")(observer(StepAdvanced))
|
||||
export default inject('rootStore')(observer(StepLabel));
|
@ -12,39 +12,54 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import Base from "components/Form";
|
||||
import Base from 'components/Form';
|
||||
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { inject, observer } from 'mobx-react';
|
||||
|
||||
export class StepManagement extends Base {
|
||||
|
||||
get title() {
|
||||
return t("Cluster Management")
|
||||
return t('Cluster Management');
|
||||
}
|
||||
|
||||
get name() {
|
||||
return t("Cluster Management")
|
||||
return t('Cluster Management');
|
||||
}
|
||||
|
||||
get defaultValue() {
|
||||
return {
|
||||
create_timeout: 60,
|
||||
};
|
||||
}
|
||||
|
||||
get formItems() {
|
||||
return [
|
||||
{
|
||||
name: "auto_healing_enabled",
|
||||
label: t("Auto Healing"),
|
||||
type: "check",
|
||||
content: t("Automatically repair unhealhty nodes")
|
||||
name: 'auto_healing_enabled',
|
||||
label: t('Auto Healing'),
|
||||
type: 'check',
|
||||
content: t('Automatically repair unhealhty nodes'),
|
||||
},
|
||||
{
|
||||
type: "divider"
|
||||
type: 'divider',
|
||||
},
|
||||
{
|
||||
name: "auto_scaling_enabled",
|
||||
label: t("Auto Scaling"),
|
||||
type: "check",
|
||||
content: t("Auto scaling feature will be enabled")
|
||||
}
|
||||
]
|
||||
name: 'auto_scaling_enabled',
|
||||
label: t('Auto Scaling'),
|
||||
type: 'check',
|
||||
content: t('Auto scaling feature will be enabled'),
|
||||
},
|
||||
{
|
||||
type: 'divider',
|
||||
},
|
||||
{
|
||||
name: 'create_timeout',
|
||||
label: t('Timeout(Minute)'),
|
||||
type: 'input-int',
|
||||
min: 1,
|
||||
tip: t('The timeout for cluster creation in minutes.'),
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
export default inject("rootStore")(observer(StepManagement))
|
||||
export default inject('rootStore')(observer(StepManagement));
|
||||
|
@ -28,76 +28,46 @@ export class StepNetworks extends Base {
|
||||
|
||||
get defaultValue() {
|
||||
return {
|
||||
enableNetwork: true,
|
||||
newNetwork: true,
|
||||
};
|
||||
}
|
||||
|
||||
get nameForStateUpdate() {
|
||||
return ['enableNetwork'];
|
||||
return ['newNetwork'];
|
||||
}
|
||||
|
||||
get formItems() {
|
||||
const { enableNetwork } = this.state;
|
||||
const { newNetwork } = this.state;
|
||||
|
||||
return [
|
||||
{
|
||||
name: 'enableLoadBalancer',
|
||||
name: 'master_lb_enabled',
|
||||
label: t('Enable Load Balancer'),
|
||||
type: 'check',
|
||||
content: t('Enabled Load Balancer for Master Nodes'),
|
||||
},
|
||||
{
|
||||
name: 'enableNetwork',
|
||||
name: 'newNetwork',
|
||||
label: t('Enabled Network'),
|
||||
type: 'check',
|
||||
content: t('Create New Network'),
|
||||
},
|
||||
{
|
||||
name: 'network',
|
||||
name: 'fixed_network',
|
||||
label: t('Use an Existing Network'),
|
||||
type: 'network-select-table',
|
||||
hidden: enableNetwork,
|
||||
hidden: newNetwork,
|
||||
},
|
||||
{
|
||||
type: 'divider',
|
||||
},
|
||||
{
|
||||
name: 'floating_ip_enabled',
|
||||
label: t('Cluster API'),
|
||||
type: 'select',
|
||||
options: [
|
||||
{
|
||||
label: t('Accessible on private network only'),
|
||||
value: 'networkOnly',
|
||||
},
|
||||
{
|
||||
label: t('Accessible on the public internet'),
|
||||
value: 'publicInternet',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'divider',
|
||||
},
|
||||
{
|
||||
name: 'ingress_controller',
|
||||
label: t('Ingress Controller'),
|
||||
type: 'select',
|
||||
options: [
|
||||
{
|
||||
label: t('octavia'),
|
||||
value: 'octavia',
|
||||
},
|
||||
{
|
||||
label: t('nginx'),
|
||||
value: 'nginx',
|
||||
},
|
||||
{
|
||||
label: t('traefik'),
|
||||
value: 'traefik',
|
||||
},
|
||||
],
|
||||
placeholder: t('Choose an ingress controller'),
|
||||
label: t('Enable Floating IP'),
|
||||
type: 'check',
|
||||
tip: t(
|
||||
'Whether enable or not using the floating IP of cloud provider. If it’s not set, the value of this in template will be used.'
|
||||
),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
@ -17,13 +17,13 @@ import { inject, observer } from 'mobx-react';
|
||||
import Base from 'components/Form';
|
||||
import FlavorSelectTable from 'src/pages/compute/containers/Instance/components/FlavorSelectTable';
|
||||
|
||||
export class StepSize extends Base {
|
||||
export class StepNodeSpec extends Base {
|
||||
get title() {
|
||||
return t('Cluster Size');
|
||||
return t('Node Spec');
|
||||
}
|
||||
|
||||
get name() {
|
||||
return t('Cluster Size');
|
||||
return t('Node Spec');
|
||||
}
|
||||
|
||||
allowed = () => Promise.resolve();
|
||||
@ -38,17 +38,24 @@ export class StepSize extends Base {
|
||||
});
|
||||
};
|
||||
|
||||
get defaultValue() {
|
||||
return {
|
||||
master_count: 1,
|
||||
node_count: 1,
|
||||
};
|
||||
}
|
||||
|
||||
get formItems() {
|
||||
return [
|
||||
{
|
||||
name: 'numberOfMasterNodes',
|
||||
name: 'master_count',
|
||||
label: t('Number of Master Nodes'),
|
||||
type: 'input-int',
|
||||
min: 1,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'flavorOfMasterNodes',
|
||||
name: 'masterFlavor',
|
||||
label: t('Flavor of Master Nodes'),
|
||||
type: 'select-table',
|
||||
component: this.getFlavorComponent(),
|
||||
@ -58,14 +65,14 @@ export class StepSize extends Base {
|
||||
type: 'divider',
|
||||
},
|
||||
{
|
||||
name: 'numberOfWorkerNodes',
|
||||
name: 'node_count',
|
||||
label: t('Number of Worker Nodes'),
|
||||
type: 'input-int',
|
||||
min: 1,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'flavorOfWorkerNodes',
|
||||
name: 'flavor',
|
||||
label: t('Flavor of Worker Nodes'),
|
||||
type: 'select-table',
|
||||
component: this.getFlavorComponent(),
|
||||
@ -75,4 +82,4 @@ export class StepSize extends Base {
|
||||
}
|
||||
}
|
||||
|
||||
export default inject('rootStore')(observer(StepSize));
|
||||
export default inject('rootStore')(observer(StepNodeSpec));
|
@ -13,11 +13,11 @@
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { StepAction } from 'src/containers/Action';
|
||||
import globalClustersStore from 'src/stores/magnum/clusters';
|
||||
import StepDetails from './StepDetails';
|
||||
import StepSize from './StepSize';
|
||||
import StepInfo from './StepInfo';
|
||||
import StepNodeSpec from './StepNodeSpec';
|
||||
import StepNetworks from './StepNetworks';
|
||||
import StepManagement from './StepManagement';
|
||||
import StepAdvanced from './StepAdvanced';
|
||||
import StepLabel from './StepLabel';
|
||||
|
||||
export class StepCreate extends StepAction {
|
||||
init() {
|
||||
@ -51,12 +51,12 @@ export class StepCreate extends StepAction {
|
||||
get steps() {
|
||||
return [
|
||||
{
|
||||
title: t('Details *'),
|
||||
component: StepDetails,
|
||||
title: t('Info *'),
|
||||
component: StepInfo,
|
||||
},
|
||||
{
|
||||
title: t('Size: *'),
|
||||
component: StepSize,
|
||||
title: t('Node Spec *'),
|
||||
component: StepNodeSpec,
|
||||
},
|
||||
{
|
||||
title: t('Networks'),
|
||||
@ -67,15 +67,25 @@ export class StepCreate extends StepAction {
|
||||
component: StepManagement,
|
||||
},
|
||||
{
|
||||
title: t('Advanced'),
|
||||
component: StepAdvanced,
|
||||
title: t('Labels'),
|
||||
component: StepLabel,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
onSubmit = (values) => {
|
||||
const { additionalLabels, auto_healing_enabled, auto_scaling_enabled } =
|
||||
values;
|
||||
const {
|
||||
additionalLabels,
|
||||
clusterTemplate,
|
||||
keypair,
|
||||
auto_healing_enabled,
|
||||
auto_scaling_enabled,
|
||||
newNetwork,
|
||||
fixed_network,
|
||||
flavor,
|
||||
masterFlavor,
|
||||
...rest
|
||||
} = values;
|
||||
const requestLabels = {};
|
||||
|
||||
if (additionalLabels) {
|
||||
@ -87,27 +97,21 @@ export class StepCreate extends StepAction {
|
||||
}
|
||||
|
||||
const data = {
|
||||
name: values.clusterName,
|
||||
name: values.name,
|
||||
labels: {
|
||||
...requestLabels,
|
||||
auto_healing_enabled,
|
||||
auto_scaling_enabled,
|
||||
admission_control_list:
|
||||
'NodeRestriction,NamespaceLifecycle,LimitRanger,ServiceAccount,ResourceQuota,TaintNodesByCondition,Priority,DefaultTolerationSeconds,DefaultStorageClass,StorageObjectInUseProtection,PersistentVolumeClaimResize,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,RuntimeClass',
|
||||
auto_healing_enabled: `${auto_healing_enabled}`,
|
||||
auto_scaling_enabled: `${auto_scaling_enabled}`,
|
||||
},
|
||||
cluster_template_id: values.clusterTemplateId,
|
||||
create_timeout: 60,
|
||||
master_count: values.numberOfMasterNodes,
|
||||
node_count: values.numberOfWorkerNodes,
|
||||
keypair: values.keypair,
|
||||
master_flavor_id: values.flavorOfMasterNodes.selectedRowKeys[0],
|
||||
flavor_id: values.flavorOfWorkerNodes.selectedRowKeys[0],
|
||||
master_lb_enabled: values.enableLoadBalancer,
|
||||
floating_ip_enabled: values.floating_ip_enabled !== 'networkOnly',
|
||||
master_flavor_id: masterFlavor.selectedRowKeys[0],
|
||||
flavor_id: flavor.selectedRowKeys[0],
|
||||
cluster_template_id: clusterTemplate.selectedRowKeys[0],
|
||||
keypair: keypair.selectedRowKeys[0],
|
||||
...rest,
|
||||
};
|
||||
|
||||
if (!values.enableNetwork && values.network) {
|
||||
const { selectedRowKeys = [] } = values.network;
|
||||
if (!newNetwork && fixed_network) {
|
||||
const { selectedRowKeys = [] } = fixed_network;
|
||||
data.fixed_network = selectedRowKeys[0];
|
||||
}
|
||||
|
||||
|
@ -9,17 +9,17 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
import DeleteClusters from './Delete';
|
||||
import ResizeClusters from './Resize';
|
||||
import StepCreate from './StepCreate';
|
||||
import Delete from './Delete';
|
||||
import Resize from './Resize';
|
||||
import Create from './StepCreate';
|
||||
|
||||
const actionConfigs = {
|
||||
rowActions: {
|
||||
firstAction: DeleteClusters,
|
||||
moreActions: [{ action: ResizeClusters }],
|
||||
firstAction: Delete,
|
||||
moreActions: [{ action: Resize }],
|
||||
},
|
||||
batchActions: [DeleteClusters],
|
||||
primaryActions: [StepCreate],
|
||||
batchActions: [Delete],
|
||||
primaryActions: [Create],
|
||||
};
|
||||
|
||||
export default actionConfigs;
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
import Base from 'containers/List';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { clusterStatus, healthStatus } from 'resources/magnum/cluster';
|
||||
import globalClustersStore from 'src/stores/magnum/clusters';
|
||||
import actionConfigs from './actions';
|
||||
|
||||
@ -35,10 +36,6 @@ export class Clusters extends Base {
|
||||
return actionConfigs;
|
||||
}
|
||||
|
||||
get rowKey() {
|
||||
return 'uuid';
|
||||
}
|
||||
|
||||
getColumns = () => [
|
||||
{
|
||||
title: t('ID/Name'),
|
||||
@ -49,18 +46,25 @@ export class Clusters extends Base {
|
||||
title: t('Status'),
|
||||
isHideable: true,
|
||||
dataIndex: 'status',
|
||||
render: (value) => clusterStatus[value] || value,
|
||||
},
|
||||
{
|
||||
title: t('Health Status'),
|
||||
isHideable: true,
|
||||
dataIndex: 'health_status',
|
||||
render: (value) => healthStatus[value] || value || '-',
|
||||
},
|
||||
{
|
||||
title: t('Keypair'),
|
||||
isHideable: true,
|
||||
dataIndex: 'keypair',
|
||||
render: (value) => {
|
||||
return value
|
||||
? this.getLinkRender('keypairDetail', value, { id: value })
|
||||
: '-';
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
export default inject("rootStore")(observer(Clusters))
|
||||
export default inject('rootStore')(observer(Clusters));
|
||||
|
@ -20,7 +20,7 @@ import ClusterTemplates from '../containers/ClusterTemplates';
|
||||
import ClusterTemplateDetail from '../containers/ClusterTemplates/Detail';
|
||||
import ClustersCreate from '../containers/Clusters/actions/StepCreate';
|
||||
import ClustersTemplateCreate from '../containers/ClusterTemplates/actions/StepCreate';
|
||||
import StepUpdateClusterTemplate from '../containers/ClusterTemplates/actions/Edit';
|
||||
import ClusterTemplateUpdate from '../containers/ClusterTemplates/actions/Edit';
|
||||
|
||||
const PATH = '/container-infra';
|
||||
export default [
|
||||
@ -34,6 +34,11 @@ export default [
|
||||
component: ClustersDetail,
|
||||
exact: true,
|
||||
},
|
||||
{
|
||||
path: `${PATH}/clusters/create`,
|
||||
component: ClustersCreate,
|
||||
exact: true,
|
||||
},
|
||||
{
|
||||
path: `${PATH}/cluster-template`,
|
||||
component: ClusterTemplates,
|
||||
@ -44,11 +49,6 @@ export default [
|
||||
component: ClusterTemplateDetail,
|
||||
exact: true,
|
||||
},
|
||||
{
|
||||
path: `${PATH}/clusters/create`,
|
||||
component: ClustersCreate,
|
||||
exact: true,
|
||||
},
|
||||
{
|
||||
path: `${PATH}/cluster-template/create`,
|
||||
component: ClustersTemplateCreate,
|
||||
@ -56,7 +56,7 @@ export default [
|
||||
},
|
||||
{
|
||||
path: `${PATH}/cluster-template/update/:id`,
|
||||
component: StepUpdateClusterTemplate,
|
||||
component: ClusterTemplateUpdate,
|
||||
exact: true,
|
||||
},
|
||||
{ path: '*', component: E404 },
|
||||
|
40
src/resources/magnum/cluster.js
Normal file
40
src/resources/magnum/cluster.js
Normal file
@ -0,0 +1,40 @@
|
||||
// Copyright 2022 99cloud
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
export const clusterStatus = {
|
||||
CREATE_IN_PROGRESS: t('CREATE IN PROGRESS'),
|
||||
CREATE_COMPLETE: t('CREATE COMPLETE'),
|
||||
CREATE_FAILED: t('CREATE FAILED'),
|
||||
UPDATE_IN_PROGRESS: t('UPDATE IN PROGRESS'),
|
||||
UPDATE_COMPLETE: t('UPDATE COMPLETE'),
|
||||
UPDATE_FAILED: t('UPDATE FAILED'),
|
||||
DELETE_IN_PROGRESS: t('DELETE_IN PROGRESS'),
|
||||
DELETE_COMPLETE: t('DELETE COMPLETE'),
|
||||
DELETE_FAILED: t('DELETE FAILED'),
|
||||
RESUME_COMPLETE: t('RESUME COMPLETE'),
|
||||
RESUME_FAILED: t('RESUME FAILED'),
|
||||
RESTORE_COMPLETE: t('RESTORE COMPLETE'),
|
||||
ROLLBACK_IN_PROGRESS: t('ROLLBACK IN PROGRESS'),
|
||||
ROLLBACK_COMPLETE: t('ROLLBACK COMPLETE'),
|
||||
ROLLBACK_FAILED: t('ROLLBACK FAILED'),
|
||||
SNAPSHOT_COMPLETE: t('SNAPSHOT COMPLETE'),
|
||||
CHECK_COMPLETE: t('CHECK COMPLETE'),
|
||||
ADOPT_COMPLETE: t('ADOPT COMPLETE'),
|
||||
};
|
||||
|
||||
export const healthStatus = {
|
||||
HEALTHY: t('HEALTHY'),
|
||||
UNHEALTHY: t('UNHEALTHY'),
|
||||
UNKNOWN: t('UNKNOWN'),
|
||||
};
|
@ -14,3 +14,31 @@
|
||||
|
||||
export const admission_control_list =
|
||||
'NodeRestriction,NamespaceLifecycle,LimitRanger,ServiceAccount,ResourceQuota,TaintNodesByCondition,Priority,DefaultTolerationSeconds,DefaultStorageClass,StorageObjectInUseProtection,PersistentVolumeClaimResize,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,RuntimeClass';
|
||||
|
||||
export const getBaseTemplateColumns = (self) => [
|
||||
{
|
||||
title: t('ID/Name'),
|
||||
dataIndex: 'name',
|
||||
routeName: self.getRouteName('containerInfraClusterTemplateDetail'),
|
||||
},
|
||||
{
|
||||
title: t('COE'),
|
||||
isHideable: true,
|
||||
dataIndex: 'coe',
|
||||
},
|
||||
{
|
||||
title: t('Network Driver'),
|
||||
isHideable: true,
|
||||
dataIndex: 'network_driver',
|
||||
},
|
||||
{
|
||||
title: t('Keypair'),
|
||||
isHideable: true,
|
||||
dataIndex: 'keypair_id',
|
||||
render: (value) => {
|
||||
return value
|
||||
? self.getLinkRender('keypairDetail', value, { id: value })
|
||||
: '-';
|
||||
},
|
||||
},
|
||||
];
|
||||
|
@ -33,11 +33,19 @@ export class ClusterTemplatesStore extends Base {
|
||||
|
||||
@action
|
||||
async update({ id }, body) {
|
||||
const newBody = Object.keys(body).map((key) => ({
|
||||
path: `/${key}`,
|
||||
value: key === 'labels' ? JSON.stringify(body[key] || {}) : body[key],
|
||||
op: [null, undefined, ''].includes(body[key]) ? 'remove' : 'replace',
|
||||
}));
|
||||
const newBody = Object.keys(body)
|
||||
.filter(
|
||||
(key) =>
|
||||
!(
|
||||
['network_driver', 'external_network_id'].includes(key) &&
|
||||
!body[key]
|
||||
)
|
||||
)
|
||||
.map((key) => ({
|
||||
path: `/${key}`,
|
||||
value: key === 'labels' ? JSON.stringify(body[key] || {}) : body[key],
|
||||
op: [null, undefined, ''].includes(body[key]) ? 'remove' : 'replace',
|
||||
}));
|
||||
return this.submitting(this.client.patch(id, newBody));
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@ import client from 'client';
|
||||
import { action } from 'mobx';
|
||||
|
||||
export class ClustersStore extends Base {
|
||||
|
||||
get client() {
|
||||
return client.magnum.clusters;
|
||||
}
|
||||
@ -41,8 +40,8 @@ export class ClustersStore extends Base {
|
||||
}
|
||||
|
||||
@action
|
||||
async update({ id }, newbody) {
|
||||
return this.client.resize.create(id, newbody);
|
||||
async resize({ id }, newbody) {
|
||||
return this.client.resize(id, newbody);
|
||||
}
|
||||
|
||||
async detailDidFetch(item) {
|
||||
@ -52,9 +51,11 @@ export class ClustersStore extends Base {
|
||||
return item;
|
||||
}
|
||||
|
||||
async listDidFetch(items) {
|
||||
if (!items.length) return items
|
||||
return items.map(it => ({ ...it, id: it.uuid }));
|
||||
get mapper() {
|
||||
return (data) => ({
|
||||
...data,
|
||||
id: data.uuid,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user