From d59c002a4600c3d5c0b7901b2e1b3af11963596f Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Tue, 26 May 2026 02:15:21 +0200 Subject: [PATCH] feat(frontend): protocol tab Tunnel section (Pattern A) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the Tunnel sub-form: rewriteAddress + rewritePort, allowedNetwork picker (tcp/udp/tcp,udp), Form.List-driven portMap with name/value pairs, and the followRedirect Switch. portMap is the second Form.List in the rewrite — same shape as the HTTP/Mixed accounts list but with name/value rather than user/pass. The wire shape stays `settings.portMap: { name, value }[]` exactly. Tab visibility widens to Tunnel. --- .../pages/inbounds/InboundFormModal.new.tsx | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/frontend/src/pages/inbounds/InboundFormModal.new.tsx b/frontend/src/pages/inbounds/InboundFormModal.new.tsx index ea2072c8..1ff34ae5 100644 --- a/frontend/src/pages/inbounds/InboundFormModal.new.tsx +++ b/frontend/src/pages/inbounds/InboundFormModal.new.tsx @@ -336,6 +336,60 @@ export default function InboundFormModalNew({ const protocolTab = ( <> + {protocol === Protocols.TUNNEL && ( + <> + + + + + + + + + + + {(fields, { add, remove }) => ( + <> + + + + {fields.length > 0 && ( + + {fields.map((field, idx) => ( + + {String(idx + 1)} + + + + + + + + + ))} + + )} + + )} + + + + + + )} + {(protocol === Protocols.HTTP || protocol === Protocols.MIXED) && ( <> @@ -572,6 +626,7 @@ export default function InboundFormModalNew({ Protocols.SHADOWSOCKS, Protocols.HTTP, Protocols.MIXED, + Protocols.TUNNEL, ] as string[]).includes(protocol) ? [{ key: 'protocol', label: t('pages.inbounds.protocol'), children: protocolTab }] : []),