import { BulbOutlined } from '@ant-design/icons'; import { useIntl } from '@umijs/max'; import { Alert } from 'antd'; import React from 'react'; import styled from 'styled-components'; import { ProviderType, ProviderValueMap } from '../config'; import AddWorkerCommand from './add-worker-command'; import CheckEnvCommand from './check-env-command'; import RegisterClusterInner from './register-cluster-inner'; import SupportedGPUs from './support-gpus'; const Title = styled.div` font-size: 16px; font-weight: 600; margin-bottom: 16px; `; const Line = styled.div` position: relative; margin: 24px 0; width: 100%; border-top: 1px solid var(--ant-color-border); &::before { content: ''; position: absolute; top: -9px; left: 24px; width: 16px; height: 16px; transform: rotate(45deg); background-color: var(--ant-color-bg-elevated); border-top: 1px solid var(--ant-color-border); border-left: 1px solid var(--ant-color-border); } `; const Container = styled.div` width: 800px; margin: 0 auto; .command-info { margin-top: 24px; margin-bottom: 8px; color: var(--ant-color-text-secondary); } `; const Content = styled.div` margin-top: 24px; margin-bottom: 16px; `; type AddModalProps = { provider: ProviderType; registrationInfo: { token: string; image: string; server_url: string; cluster_id: number; }; }; const AddWorkerStep: React.FC = ({ provider, registrationInfo }) => { const intl = useIntl(); const [currentGPU, setCurrentGPU] = React.useState('cuda'); React.useState('cuda'); const [workerCommand, setWorkerCommand] = React.useState>( { label: 'NVIDIA', link: 'https://docs.gpustack.ai/latest/installation/installation-requirements/#nvidia-cuda' } ); const handleSelectProvider = (value: string, item: any) => { setCurrentGPU(value); setWorkerCommand(item); }; return ( {intl.formatMessage({ id: 'clusters.create.supportedGpu' })} } message={ } >
1. {intl.formatMessage({ id: 'cluster.create.checkEnv.tips' })}
2. {intl.formatMessage({ id: 'clusters.create.addCommand.tips' })}
{provider === ProviderValueMap.Kubernetes ? ( ) : ( )}
); }; export default AddWorkerStep;