3x-ui/frontend/src/pages/xray/outbounds/transport/hysteria.tsx
MHSanaei 2aec803181
refactor(frontend): extract outbound sockopt/mux/hysteria transport blocks
Move the last three oversized inline stream blocks out of
OutboundFormModal into presentational components under
xray/outbounds/transport/: SockoptForm (~260 lines, the worst offender),
MuxForm, and HysteriaForm. Each takes the form instance; MuxForm also
takes protocol/network and keeps its isMuxAllowed gate. OutboundFormModal
drops from 962 to 621 lines and no inline section now exceeds the
250-line guideline. Existing outbound-form-modal snapshots already cover
sockopt/mux and stay byte-identical, confirming no behavior change.
2026-05-30 20:37:57 +02:00

32 lines
1.1 KiB
TypeScript

import { useTranslation } from 'react-i18next';
import { Form, Input, InputNumber, type FormInstance } from 'antd';
import { HysteriaMasqueradeForm } from '@/lib/xray/forms/transport';
import type { OutboundFormValues } from '@/schemas/forms/outbound-form';
export default function HysteriaForm({ form }: { form: FormInstance<OutboundFormValues> }) {
const { t } = useTranslation();
return (
<>
<Form.Item
label={t('pages.inbounds.form.version')}
name={['streamSettings', 'hysteriaSettings', 'version']}
>
<InputNumber min={2} max={2} disabled style={{ width: '100%' }} />
</Form.Item>
<Form.Item
label={t('pages.xray.outboundForm.authPassword')}
name={['streamSettings', 'hysteriaSettings', 'auth']}
>
<Input />
</Form.Item>
<Form.Item
label={t('pages.inbounds.form.udpIdleTimeout')}
name={['streamSettings', 'hysteriaSettings', 'udpIdleTimeout']}
>
<InputNumber min={1} style={{ width: '100%' }} />
</Form.Item>
<HysteriaMasqueradeForm form={form} />
</>
);
}