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' && (
-
-
-
- )}
-
- {protocol === 'dns' && (
- <>
-
-
-
-
-
-
-
-
-
-
-
-
-
- {(fields, { add, remove }) => (
- <>
-
- }
- onClick={() => add({ action: 'direct', qtype: '', domain: '' })}
- />
-
- {fields.map((field, index) => (
-
-
-
- {t('pages.xray.outboundForm.ruleN', { n: index + 1 })}
- remove(field.name)}
- />
-
-
-
-
-
-
-
-
-
-
-
- ))}
- >
- )}
-
- >
- )}
+
{protocol === 'freedom' && (
<>
diff --git a/frontend/src/pages/xray/outbounds/outbound-only-fields.tsx b/frontend/src/pages/xray/outbounds/outbound-only-fields.tsx
new file mode 100644
index 00000000..e491a796
--- /dev/null
+++ b/frontend/src/pages/xray/outbounds/outbound-only-fields.tsx
@@ -0,0 +1,92 @@
+import { useTranslation } from 'react-i18next';
+import { Button, Form, Input, InputNumber, Select } from 'antd';
+import { DeleteOutlined, PlusOutlined } from '@ant-design/icons';
+
+import { DNSRuleActions } from '@/schemas/primitives';
+
+export function OutboundOnlyProtocolFields({ protocol }: { protocol: string }) {
+ const { t } = useTranslation();
+ return (
+ <>
+ {protocol === 'loopback' && (
+
+
+
+ )}
+
+ {protocol === 'blackhole' && (
+
+
+
+ )}
+
+ {protocol === 'dns' && (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {(fields, { add, remove }) => (
+ <>
+
+ }
+ onClick={() => add({ action: 'direct', qtype: '', domain: '' })}
+ />
+
+ {fields.map((field, index) => (
+
+
+
+ {t('pages.xray.outboundForm.ruleN', { n: index + 1 })}
+ remove(field.name)}
+ />
+
+
+
+
+
+
+
+
+
+
+
+ ))}
+ >
+ )}
+
+ >
+ )}
+ >
+ );
+}