mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-09 06:34:18 +00:00
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.
32 lines
1.1 KiB
TypeScript
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} />
|
|
</>
|
|
);
|
|
}
|