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 }) => ( <> {intl.formatMessage({ id: 'clusters.imageCredentials.title' })} add({ registry: '', username: '', password: '' }) } > {' '} {intl.formatMessage({ id: 'clusters.imageCredentials.add' })} {fields.map(({ key, name }) => ( remove(name)} > ))} > )} ); }; const NodeSelectorForm: React.FC = () => { const intl = useIntl(); return ( {intl.formatMessage({ id: 'clusters.nodeSelector.title' })} ); }; // 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;