From 4fd8a884ccba8508b6b7b11038a6a4276d8116c8 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sat, 30 May 2026 20:05:57 +0200 Subject: [PATCH] refactor(frontend): move HysteriaMasqueradeForm to lib/xray/forms/transport The hysteria masquerade form edits streamSettings.hysteriaSettings.masquerade (a transport/stream concept) and is rendered identically by both modals, so it belongs next to FinalMaskForm in lib/xray/forms/transport/ rather than protocols/shared/. Moved the file, updated the transport barrel + both consumers (inbound hysteria protocol form, outbound modal), and removed the now-empty protocols/shared/ folder. Pure relocation; snapshots unchanged, typecheck/lint/build green. --- frontend/src/lib/xray/forms/protocols/shared/index.ts | 1 - .../{protocols/shared => transport}/HysteriaMasqueradeForm.tsx | 0 frontend/src/lib/xray/forms/transport/index.ts | 1 + frontend/src/pages/inbounds/form/protocols/hysteria.tsx | 2 +- frontend/src/pages/xray/outbounds/OutboundFormModal.tsx | 3 +-- 5 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 frontend/src/lib/xray/forms/protocols/shared/index.ts rename frontend/src/lib/xray/forms/{protocols/shared => transport}/HysteriaMasqueradeForm.tsx (100%) diff --git a/frontend/src/lib/xray/forms/protocols/shared/index.ts b/frontend/src/lib/xray/forms/protocols/shared/index.ts deleted file mode 100644 index 3b831677..00000000 --- a/frontend/src/lib/xray/forms/protocols/shared/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as HysteriaMasqueradeForm } from './HysteriaMasqueradeForm'; diff --git a/frontend/src/lib/xray/forms/protocols/shared/HysteriaMasqueradeForm.tsx b/frontend/src/lib/xray/forms/transport/HysteriaMasqueradeForm.tsx similarity index 100% rename from frontend/src/lib/xray/forms/protocols/shared/HysteriaMasqueradeForm.tsx rename to frontend/src/lib/xray/forms/transport/HysteriaMasqueradeForm.tsx diff --git a/frontend/src/lib/xray/forms/transport/index.ts b/frontend/src/lib/xray/forms/transport/index.ts index d2ab3e39..c9b18741 100644 --- a/frontend/src/lib/xray/forms/transport/index.ts +++ b/frontend/src/lib/xray/forms/transport/index.ts @@ -1 +1,2 @@ export { default as FinalMaskForm } from './FinalMaskForm'; +export { default as HysteriaMasqueradeForm } from './HysteriaMasqueradeForm'; diff --git a/frontend/src/pages/inbounds/form/protocols/hysteria.tsx b/frontend/src/pages/inbounds/form/protocols/hysteria.tsx index a0b78c24..905f635c 100644 --- a/frontend/src/pages/inbounds/form/protocols/hysteria.tsx +++ b/frontend/src/pages/inbounds/form/protocols/hysteria.tsx @@ -1,7 +1,7 @@ import { useTranslation } from 'react-i18next'; import { Form, InputNumber, type FormInstance } from 'antd'; -import { HysteriaMasqueradeForm } from '@/lib/xray/forms/protocols/shared'; +import { HysteriaMasqueradeForm } from '@/lib/xray/forms/transport'; import type { InboundFormValues } from '@/schemas/forms/inbound-form'; export default function HysteriaFields({ form }: { form: FormInstance }) { diff --git a/frontend/src/pages/xray/outbounds/OutboundFormModal.tsx b/frontend/src/pages/xray/outbounds/OutboundFormModal.tsx index e67c07f2..0e340ddb 100644 --- a/frontend/src/pages/xray/outbounds/OutboundFormModal.tsx +++ b/frontend/src/pages/xray/outbounds/OutboundFormModal.tsx @@ -13,8 +13,7 @@ import { Tabs, message, } from 'antd'; -import { FinalMaskForm } from '@/lib/xray/forms/transport'; -import { HysteriaMasqueradeForm } from '@/lib/xray/forms/protocols/shared'; +import { FinalMaskForm, HysteriaMasqueradeForm } from '@/lib/xray/forms/transport'; import { JsonEditor } from '@/components/form'; import { Wireguard } from '@/utils'; import {