From 2b02f1b7453abc6d043890ade823e30ed7f55c78 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sat, 30 May 2026 16:44:22 +0200 Subject: [PATCH] refactor(frontend): extract OutboundFormModal freedom field block OutboundFormModal.tsx 2063 -> 1753. Moved the freedom protocol field block (domainStrategy, fragment, noises, finalRules) into outbound-freedom-fields.tsx. Verbatim relocation; freedom per-protocol snapshot unchanged -> no behavior change. typecheck/lint/build green. --- .../xray/outbounds/OutboundFormModal.tsx | 258 +---------------- .../outbounds/outbound-freedom-fields.tsx | 265 ++++++++++++++++++ 2 files changed, 267 insertions(+), 256 deletions(-) create mode 100644 frontend/src/pages/xray/outbounds/outbound-freedom-fields.tsx diff --git a/frontend/src/pages/xray/outbounds/OutboundFormModal.tsx b/frontend/src/pages/xray/outbounds/OutboundFormModal.tsx index 3be86a46..c1e54a54 100644 --- a/frontend/src/pages/xray/outbounds/OutboundFormModal.tsx +++ b/frontend/src/pages/xray/outbounds/OutboundFormModal.tsx @@ -37,7 +37,6 @@ import { } from '@/schemas/forms/outbound-form'; import { DOMAIN_STRATEGY_OPTION, - OutboundDomainStrategies, SNIFFING_OPTION, TCP_CONGESTION_OPTION, WireguardDomainStrategy, @@ -75,6 +74,7 @@ import { newStreamSlice, } from './outbound-form-helpers'; import { OutboundOnlyProtocolFields } from './outbound-only-fields'; +import { FreedomOutboundFields } from './outbound-freedom-fields'; import './OutboundFormModal.css'; // Pattern A rewrite of OutboundFormModal. Built as a sibling `.new.tsx` @@ -506,261 +506,7 @@ export default function OutboundFormModal({ - {protocol === 'freedom' && ( - <> - - - - - - - - - - - - - - - - - )} - - ); - }} - - - - {(fields, { add, remove }) => ( - <> - - 0} - onChange={(checked) => { - if (checked) { - add({ - type: 'rand', - packet: '10-20', - delay: '10-16', - applyTo: 'ip', - }); - } else { - // remove() with no arg is not supported; - // walk fields in reverse and drop each. - for (let i = fields.length - 1; i >= 0; i--) { - remove(fields[i].name); - } - } - }} - /> - {fields.length > 0 && ( -