diff --git a/src/apps/console/routes/_main+/$account+/infra+/_layout.tsx b/src/apps/console/routes/_main+/$account+/infra+/_layout.tsx index 81ba4a5ab..aff27aa76 100644 --- a/src/apps/console/routes/_main+/$account+/infra+/_layout.tsx +++ b/src/apps/console/routes/_main+/$account+/infra+/_layout.tsx @@ -13,7 +13,7 @@ const Infra = () => { return ( >; @@ -21,22 +23,23 @@ const Root = (props: IDialog) => { const api = useConsoleApi(); const reloadPage = useReload(); + const [show, setShow] = useState(false); const { values, errors, handleChange, handleSubmit, resetValues, isLoading } = useForm({ initialValues: isUpdate ? { - displayName: props.data.displayName, - name: parseName(props.data), - visibilityMode: false, - isNameError: false, - } + displayName: props.data.displayName, + name: parseName(props.data), + visibilityMode: false, + isNameError: false, + } : { - name: '', - displayName: '', - visibilityMode: false, - isNameError: false, - }, + name: '', + displayName: '', + visibilityMode: false, + isNameError: false, + }, validationSchema: Yup.object({ name: Yup.string().required('id is required'), displayName: Yup.string().required('name is required'), @@ -70,7 +73,7 @@ const Root = (props: IDialog) => { reloadPage(); resetValues(); toast.success( - `compute ${isUpdate ? 'updated' : 'created'} successfully` + `cluster ${isUpdate ? 'updated' : 'created'} successfully` ); setVisible(false); } catch (err) { @@ -80,78 +83,89 @@ const Root = (props: IDialog) => { }); return ( - { - if (!values.isNameError) { - handleSubmit(e); - } else { - e.preventDefault(); - } - }} - > - -
- - {!isUpdate && ( - <> - { - handleChange('visibilityMode')(dummyEvent(val)); - }} - /> - - - Private clusters are those who are hosted behind a NAT. - - - Ex: Cluster running on your local machine + <> + { + if (!values.isNameError) { + handleSubmit(e); + } else { + e.preventDefault(); + } + }} + > + +
+ + {!isUpdate && ( + <> + { + handleChange('visibilityMode')(dummyEvent(val)); + }} + /> + + + Private clusters are those who are hosted behind a NAT. + + + Ex: Cluster running on your local machine + +
+ } + /> +
- } - /> -