From cf9920593ed472c3a889215271ef5d2b37d07a98 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sat, 30 May 2026 16:37:25 +0200 Subject: [PATCH] refactor(frontend): extract OutboundFormModal loopback/blackhole/dns field blocks Moved the outbound-only protocol field blocks (loopback, blackhole, dns) out of the modal render body into outbound-only-fields.tsx. First render-body extraction behind the per-protocol snapshot net: loopback/blackhole/dns snapshots unchanged -> verified no behavior change. typecheck/lint/build green. --- .../xray/outbounds/OutboundFormModal.tsx | 82 +---------------- .../xray/outbounds/outbound-only-fields.tsx | 92 +++++++++++++++++++ 2 files changed, 94 insertions(+), 80 deletions(-) create mode 100644 frontend/src/pages/xray/outbounds/outbound-only-fields.tsx diff --git a/frontend/src/pages/xray/outbounds/OutboundFormModal.tsx b/frontend/src/pages/xray/outbounds/OutboundFormModal.tsx index ef6af2b5..3be86a46 100644 --- a/frontend/src/pages/xray/outbounds/OutboundFormModal.tsx +++ b/frontend/src/pages/xray/outbounds/OutboundFormModal.tsx @@ -36,7 +36,6 @@ import { type OutboundFormValues, } from '@/schemas/forms/outbound-form'; import { - DNSRuleActions, DOMAIN_STRATEGY_OPTION, OutboundDomainStrategies, SNIFFING_OPTION, @@ -75,6 +74,7 @@ import { isMuxAllowed, newStreamSlice, } from './outbound-form-helpers'; +import { OutboundOnlyProtocolFields } from './outbound-only-fields'; import './OutboundFormModal.css'; // Pattern A rewrite of OutboundFormModal. Built as a sibling `.new.tsx` @@ -504,85 +504,7 @@ export default function OutboundFormModal({ )} - {protocol === 'loopback' && ( - - - - )} - - {protocol === 'blackhole' && ( - - - - - - - - - - - - - - {(fields, { add, remove }) => ( - <> - -