diff --git a/src/pages/AddCluster/ACksterList/index.js b/src/pages/AddCluster/ACksterList/index.js index 98e1b68c3..de26782f9 100644 --- a/src/pages/AddCluster/ACksterList/index.js +++ b/src/pages/AddCluster/ACksterList/index.js @@ -1,7 +1,7 @@ /* eslint-disable array-callback-return */ /* eslint-disable no-param-reassign */ /* eslint-disable consistent-return */ -import { Button, Card, Form, Input, Row, Steps } from 'antd'; +import { Button, Card, Form, Input, Row, Steps, Radio } from 'antd'; import { connect } from 'dva'; import { routerRedux } from 'dva/router'; import Qs from 'qs'; @@ -20,6 +20,7 @@ const { Step } = Steps; const dataObj = { enableHA: false, gatewayIngressIPs: '', + runtime: 'docker', imageHub: { enable: false, domain: '', @@ -141,6 +142,7 @@ export default class ClusterLink extends PureComponent { if (err) return; if (values) { dataObj.gatewayIngressIPs = values.gatewayIngressIPs || ''; + dataObj.runtime = values.runtime || ''; dataObj.imageHub.domain = values.domain || ''; dataObj.imageHub.namespace = values.namespace || ''; dataObj.imageHub.username = values.username || ''; @@ -316,6 +318,30 @@ export default class ClusterLink extends PureComponent { })()} + {/* 容器运行时 */} + +
+ + 容器运行时: + +
+ + {getFieldDecorator('runtime', { + initialValue: 'docker', + rules: [ + { required: true }, + ] + })( + + Docker + Containerd + + )} + +
diff --git a/src/pages/AddCluster/Advanced/index.js b/src/pages/AddCluster/Advanced/index.js index 01981a0a0..1e14e69cc 100644 --- a/src/pages/AddCluster/Advanced/index.js +++ b/src/pages/AddCluster/Advanced/index.js @@ -109,6 +109,7 @@ export default class ClusterLink extends PureComponent { const routeData = data || {}; const dataObj = { enableHA: false, + runtime: '', gatewayIngressIPs: '', imageHub: { enable: false, @@ -282,6 +283,8 @@ export default class ClusterLink extends PureComponent { break; } // 表单参数 + dataObj.runtime = + values.runtime || routeData.runtime || ''; dataObj.gatewayIngressIPs = values.gatewayIngressIPs || routeData.gatewayIngressIPs || ''; dataObj.nodesForGateway.nodes = diff --git a/src/pages/AddCluster/Aliack/index.js b/src/pages/AddCluster/Aliack/index.js index 563174a9b..35959df58 100644 --- a/src/pages/AddCluster/Aliack/index.js +++ b/src/pages/AddCluster/Aliack/index.js @@ -1,7 +1,7 @@ /* eslint-disable array-callback-return */ /* eslint-disable no-param-reassign */ /* eslint-disable consistent-return */ -import { Button, Card, Form, Input, Row, Steps } from 'antd'; +import { Button, Card, Form, Input, Row, Steps, Radio } from 'antd'; import { connect } from 'dva'; import { routerRedux } from 'dva/router'; import Qs from 'qs'; @@ -20,6 +20,7 @@ const FormItem = Form.Item; const { Step } = Steps; const dataObj = { enableHA: true, + runtime: 'docker', gatewayIngressIPs: '', imageHub: { enable: false, @@ -149,7 +150,7 @@ export default class ClusterLink extends PureComponent { }else{ dataObj.imageHub.enable = false; } - + dataObj.runtime = values.runtime || ''; dataObj.imageHub.domain = values.domain || ''; dataObj.imageHub.namespace = values.namespace || ''; dataObj.imageHub.username = values.username || ''; @@ -372,6 +373,30 @@ handleValidatorsGateway = (_, val, callback) => { })()} + {/* 容器运行时 */} + +
+ + 容器运行时: + +
+ + {getFieldDecorator('runtime', { + initialValue: 'docker', + rules: [ + { required: true }, + ] + })( + + Docker + Containerd + + )} + +
diff --git a/src/pages/AddCluster/HuaweiList/index.js b/src/pages/AddCluster/HuaweiList/index.js index bba0ffe64..df80ff823 100644 --- a/src/pages/AddCluster/HuaweiList/index.js +++ b/src/pages/AddCluster/HuaweiList/index.js @@ -1,6 +1,6 @@ /* eslint-disable no-param-reassign */ /* eslint-disable consistent-return */ -import { Button, Card, Form, Input, Row, Steps } from 'antd'; +import { Button, Card, Form, Input, Row, Steps, Radio } from 'antd'; import { connect } from 'dva'; import { routerRedux } from 'dva/router'; import Qs from 'qs'; @@ -18,6 +18,7 @@ const FormItem = Form.Item; const { Step } = Steps; const dataObj = { enableHA: true, + runtime: 'docker', gatewayIngressIPs: '', imageHub: { enable: false, @@ -153,6 +154,7 @@ export default class ClusterLink extends PureComponent { if (err) return; if (values) { + dataObj.runtime = values.runtime || ''; dataObj.gatewayIngressIPs = values.gatewayIngressIPs || ''; dataObj.nodesForGateway.nodes = values.nodesForGateway || []; // 镜像仓库 @@ -389,6 +391,29 @@ export default class ClusterLink extends PureComponent { })()} + +
+ + 容器运行时: + +
+ + {getFieldDecorator('runtime', { + initialValue: 'docker', + rules: [ + { required: true }, + ] + })( + + Docker + Containerd + + )} + +
diff --git a/src/pages/AddCluster/TencentList/index.js b/src/pages/AddCluster/TencentList/index.js index 77e0cd613..b3f4a8583 100644 --- a/src/pages/AddCluster/TencentList/index.js +++ b/src/pages/AddCluster/TencentList/index.js @@ -1,6 +1,6 @@ /* eslint-disable no-param-reassign */ /* eslint-disable consistent-return */ -import { Button, Card, Form, Input, Row, Steps } from 'antd'; +import { Button, Card, Form, Input, Row, Steps, Radio } from 'antd'; import { connect } from 'dva'; import { routerRedux } from 'dva/router'; import Qs from 'qs'; @@ -18,6 +18,7 @@ const FormItem = Form.Item; const { Step } = Steps; const dataObj = { enableHA: true, + runtime: 'docker', gatewayIngressIPs: '', imageHub: { enable: false, @@ -140,6 +141,7 @@ export default class ClusterLink extends PureComponent { if (err) return; if (values) { + dataObj.runtime = values.runtime || ''; dataObj.gatewayIngressIPs = values.gatewayIngressIPs || ''; dataObj.nodesForGateway.nodes = values.nodesForGateway || []; // 镜像仓库 @@ -362,6 +364,29 @@ export default class ClusterLink extends PureComponent { })()} + +
+ + 容器运行时: + +
+ + {getFieldDecorator('runtime', { + initialValue: 'docker', + rules: [ + { required: true }, + ] + })( + + Docker + Containerd + + )} + +
diff --git a/src/services/region.js b/src/services/region.js index 87f878cf7..663fd45ae 100644 --- a/src/services/region.js +++ b/src/services/region.js @@ -137,6 +137,7 @@ export async function fetchHelmCommand(param) { nodesForChaos: param.data.nodesForChaos, nodesForGateway: param.data.nodesForGateway, DockingType:param.data.type, + runtime: param.data.runtime, appui: false, cloudserver: param.cloudserver ? param.cloudserver : '' }