diff --git a/frontend/src/pages/inbounds/InboundFormModal.new.tsx b/frontend/src/pages/inbounds/InboundFormModal.new.tsx index 1c182e97..ea2072c8 100644 --- a/frontend/src/pages/inbounds/InboundFormModal.new.tsx +++ b/frontend/src/pages/inbounds/InboundFormModal.new.tsx @@ -16,7 +16,7 @@ import { Typography, message, } from 'antd'; -import { SyncOutlined } from '@ant-design/icons'; +import { MinusOutlined, PlusOutlined, SyncOutlined } from '@ant-design/icons'; import { HttpUtil, NumberFormatter, RandomUtil, SizeFormatter } from '@/utils'; import { @@ -34,6 +34,7 @@ import { import { antdRule } from '@/utils/zodForm'; import { Protocols, SNIFFING_OPTION } from '@/schemas/primitives'; import DateTimePicker from '@/components/DateTimePicker'; +import InputAddon from '@/components/InputAddon'; import type { DBInbound } from '@/models/dbinbound'; import type { NodeRecord } from '@/api/queries/useNodesQuery'; @@ -103,6 +104,7 @@ export default function InboundFormModalNew({ protocol, settings: typeof ssMethod === 'string' ? { method: ssMethod } : {}, }); + const mixedUdpOn = Form.useWatch(['settings', 'udp'], form) ?? false; const matchesVlessAuth = ( block: { id?: string; label?: string } | undefined | null, @@ -334,6 +336,71 @@ export default function InboundFormModalNew({ const protocolTab = ( <> + {(protocol === Protocols.HTTP || protocol === Protocols.MIXED) && ( + <> + + {(fields, { add, remove }) => ( + <> + + + + {fields.length > 0 && ( + + {fields.map((field, idx) => ( + + {String(idx + 1)} + + + + + + + + + ))} + + )} + + )} + + {protocol === Protocols.HTTP && ( + + + + )} + {protocol === Protocols.MIXED && ( + <> + + + + + + + {mixedUdpOn && ( + + + + )} + + )} + + )} + {protocol === Protocols.SHADOWSOCKS && ( <> @@ -500,7 +567,12 @@ export default function InboundFormModalNew({ >