refactor: create cluster by steps

This commit is contained in:
jialin
2025-09-16 11:26:17 +08:00
parent 6e5a7035c8
commit 8de272239e
48 changed files with 1392 additions and 227 deletions
@@ -2,6 +2,7 @@ import DropDownActions from '@/components/drop-down-actions';
import ListMap from '@/components/dynamic-form/components/list-map';
import { FieldSchema } from '@/components/dynamic-form/config/types';
import { PlusOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
import { useMemoizedFn } from 'ahooks';
import { Button, Form } from 'antd';
import _ from 'lodash';
@@ -36,7 +37,7 @@ const ButtonWrapper = styled.span`
const CloudOptions: React.FC<{
ref?: any;
}> = forwardRef((props, ref) => {
// form instance
const intl = useIntl();
const form = Form.useFormInstance();
const [selectedOptions, setSelectedOptions] = React.useState<Set<string>>(
new Set()
@@ -102,7 +103,9 @@ const CloudOptions: React.FC<{
<DropDownActions menu={menu}>
<Button variant="filled" color="default">
<PlusOutlined />
<span>Add Cloud Options</span>
<span>
{intl.formatMessage({ id: 'clusters.workerpool.cloudOptions' })}
</span>
</Button>
</DropDownActions>
</Title>
@@ -113,7 +116,7 @@ const CloudOptions: React.FC<{
name={['cloud_options', field.name as string]}
>
<ListMap
btnText={'Add Item'}
btnText={intl.formatMessage({ id: 'common.button.addItem' })}
label={field.title}
dataList={form.getFieldValue(['cloud_options', field.name]) || []}
properties={field.properties || {}}