diff --git a/web/kk-console/src/components/Basic/index.js b/web/kk-console/src/components/Basic/index.js index 4026e4d99..2f069d04b 100644 --- a/web/kk-console/src/components/Basic/index.js +++ b/web/kk-console/src/components/Basic/index.js @@ -1,4 +1,4 @@ -import {Button, Card, Form, Input} from "antd"; +import {Button, Card, Form, Input, Radio, Tooltip} from "antd"; import {useDispatch, useSelector} from "react-redux"; import { nextStep, @@ -26,13 +26,11 @@ const Basic = (props) => { const getMetadata = (configuration) => { return { name: configuration.metadata.name, - registry: configuration.spec.registry.privateRegistry, - namespace: configuration.spec.registry.namespaceOverride } } const [initValue] = useState(getMetadata(configuration)) - + const [inputUserInfo, setInputUserInfo] = useState(false) const saveMetadata = () => { const basic = form.getFieldsValue(true) @@ -41,14 +39,10 @@ const Basic = (props) => { name: basic.name, namespace: "kubekey-system" } - let registryConfig = { - privateRegistry: basic.registry !== '' ? basic.registry : '', - namespaceOverride: basic.namespace !== '' ? basic.namespace : '' - } + dispatch(updateBasic( { metadata: metadataConfig, - registry : registryConfig } )) @@ -65,6 +59,80 @@ const Basic = (props) => { return Promise.reject(new Error('集群' + value + '已存在')); } + const onChangeProduct = () => { + const product = form.getFieldsValue(true).managerSoft + console.log(product) + switch (product) { + case "none": + setInputUserInfo(false) + break + default: + setInputUserInfo(true) + } + } + + const userInfo = (inputUserInfo) => { + if (inputUserInfo) { + return ( + <> + + + + + + + + ({ + validator(_, value) { + if (!value || getFieldValue('password') === value) { + return Promise.resolve(); + } + return Promise.reject(new Error('您两次输入的密码不匹配 !')); + }, + }), + ]} + > + + + + ) + } else { + return ( + + ) + } + + } + return step === 0 ? ( { > - - - - - + + + + + 无 + + + + + KubeSphere + + + + + QKCP + + + + + KSV + + + + {userInfo(inputUserInfo)} + + +