import { PageActionType } from '@/config/types'; import { MinusOutlined, PlusOutlined, QuestionCircleOutlined } from '@ant-design/icons'; import { Input as CInput, LabelSelector, SwitchCard, useAppUtils } from '@gpustack/core-ui'; import { useIntl } from '@umijs/max'; import { Button, Form, Tooltip } from 'antd'; import React, { useState } from 'react'; import styled from 'styled-components'; import { GpuInstanceOptions } from '../config/types'; import K8SVolumeMount from './k8s-volume-mount'; const Title = styled.div` display: flex; align-items: center; justify-content: space-between; background-color: transparent; font-weight: 500; font-size: 14px; padding-top: 0px; padding-bottom: 8px; `; const SectionWrap = styled.div` margin-bottom: 16px; `; const ImageCredentialsForm: React.FC = () => { const intl = useIntl(); const { getRuleMessage } = useAppUtils(); return ( {(fields, { add, remove }) => ( <> <div className="flex-center gap-8"> <span> {intl.formatMessage({ id: 'clusters.imageCredentials.title' })} </span> <Button type="link" onClick={() => add({ registry: '', username: '', password: '' }) } > <PlusOutlined />{' '} {intl.formatMessage({ id: 'clusters.imageCredentials.add' })} </Button> </div>
{fields.map(({ key, name }) => (
))}
)}
); }; const NodeSelectorForm: React.FC = () => { const intl = useIntl(); return ( <span className="flex-center gap-4"> <span> {intl.formatMessage({ id: 'clusters.nodeSelector.title' })} </span> <Tooltip title={intl.formatMessage({ id: 'clusters.nodeSelector.tip' })} > <QuestionCircleOutlined style={{ color: 'var(--ant-color-text-secondary)' }} /> </Tooltip> </span> ); }; // Render namespace. Kept as the first field of the section so the most // fundamental K8s deployment knob is set before the rest. const NamespaceForm: React.FC = () => { const intl = useIntl(); return ( value || null} > ); }; // Operator-image override. A plain string knob that used to ride along inside // worker_config; it now lives directly on k8s_options. const OperatorImageForm: React.FC = () => { const intl = useIntl(); return ( value || null} > ); }; const GpuInstanceOptionsForm: React.FC<{ initialValue?: GpuInstanceOptions; }> = ({ initialValue }) => { const intl = useIntl(); const [enabled, setEnabled] = useState(!!initialValue); const handleToggle = (checked: boolean) => { setEnabled(checked); }; return ( value || null} noStyle > ); }; const K8sPodSpec: React.FC<{ action: PageActionType; initialGpuInstanceOptions?: GpuInstanceOptions; }> = ({ action, initialGpuInstanceOptions }) => { return ( <> ); }; export default K8sPodSpec;