mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 12:44:22 +00:00
refactor(frontend): fold OutboundFormModal server address/port block into core fields
OutboundFormModal.tsx 1538 -> 1516. Moved the shared connect-target (address/port) block into OutboundCoreProtocolFields at the same render position; dropped the now-unused SERVER_PROTOCOLS import. Snapshots unchanged -> no behavior change. typecheck/lint/build green.
This commit is contained in:
parent
15ecd0aa78
commit
62870103df
2 changed files with 23 additions and 24 deletions
|
|
@ -53,7 +53,6 @@ import {
|
|||
MODE_OPTIONS,
|
||||
NETWORK_OPTIONS,
|
||||
PROTOCOL_OPTIONS,
|
||||
SERVER_PROTOCOLS,
|
||||
UTLS_OPTIONS,
|
||||
} from './outbound-form-constants';
|
||||
import {
|
||||
|
|
@ -390,28 +389,6 @@ export default function OutboundFormModal({
|
|||
<Input placeholder={t('pages.xray.outboundForm.localIpPlaceholder')} />
|
||||
</Form.Item>
|
||||
|
||||
{/* Shared connect target (address + port) for protocols
|
||||
whose form schema carries them flat at settings root.
|
||||
Hidden for freedom/blackhole/dns/loopback/wireguard. */}
|
||||
{SERVER_PROTOCOLS.has(protocol) && (
|
||||
<>
|
||||
<Form.Item
|
||||
label={t('pages.inbounds.address')}
|
||||
name={['settings', 'address']}
|
||||
rules={[{ required: true, message: t('pages.xray.outboundForm.addressRequired') }]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t('pages.inbounds.port')}
|
||||
name={['settings', 'port']}
|
||||
rules={[{ required: true, message: t('pages.xray.outboundForm.portRequired') }]}
|
||||
>
|
||||
<InputNumber min={1} max={65535} style={{ width: '100%' }} />
|
||||
</Form.Item>
|
||||
</>
|
||||
)}
|
||||
|
||||
<OutboundCoreProtocolFields protocol={protocol} />
|
||||
|
||||
<OutboundOnlyProtocolFields protocol={protocol} />
|
||||
|
|
|
|||
|
|
@ -10,12 +10,34 @@ import {
|
|||
import { SSMethodSchema } from '@/schemas/protocols/shared/shadowsocks';
|
||||
import { antdRule } from '@/utils/zodForm';
|
||||
|
||||
import { SECURITY_OPTIONS, SS_METHOD_OPTIONS } from './outbound-form-constants';
|
||||
import { SECURITY_OPTIONS, SERVER_PROTOCOLS, SS_METHOD_OPTIONS } from './outbound-form-constants';
|
||||
|
||||
export function OutboundCoreProtocolFields({ protocol }: { protocol: string }) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<>
|
||||
{/* Shared connect target (address + port) for protocols
|
||||
whose form schema carries them flat at settings root.
|
||||
Hidden for freedom/blackhole/dns/loopback/wireguard. */}
|
||||
{SERVER_PROTOCOLS.has(protocol) && (
|
||||
<>
|
||||
<Form.Item
|
||||
label={t('pages.inbounds.address')}
|
||||
name={['settings', 'address']}
|
||||
rules={[{ required: true, message: t('pages.xray.outboundForm.addressRequired') }]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t('pages.inbounds.port')}
|
||||
name={['settings', 'port']}
|
||||
rules={[{ required: true, message: t('pages.xray.outboundForm.portRequired') }]}
|
||||
>
|
||||
<InputNumber min={1} max={65535} style={{ width: '100%' }} />
|
||||
</Form.Item>
|
||||
</>
|
||||
)}
|
||||
|
||||
{(protocol === 'vmess' || protocol === 'vless') && (
|
||||
<Form.Item
|
||||
label="ID"
|
||||
|
|
|
|||
Loading…
Reference in a new issue