diff --git a/frontend/src/pages/inbounds/form/InboundFormModal.tsx b/frontend/src/pages/inbounds/form/InboundFormModal.tsx
index 79dcaf8d..fe602d29 100644
--- a/frontend/src/pages/inbounds/form/InboundFormModal.tsx
+++ b/frontend/src/pages/inbounds/form/InboundFormModal.tsx
@@ -84,6 +84,7 @@ import { InputAddon } from '@/components/ui';
import './InboundFormModal.css';
import { AdvancedAllEditor, AdvancedSliceEditor } from './advanced-editors';
+import { TunFields, TunnelFields } from './protocols';
const { TextArea } = Input;
import { coerceInboundJsonField, type DBInbound } from '@/models/dbinbound';
@@ -1053,122 +1054,9 @@ export default function InboundFormModal({
>
)}
- {protocol === Protocols.TUN && (
- <>
-
-
-
-
-
-
-
- {(fields, { add, remove }) => (
-
-
- {fields.map((field, j) => (
-
-
-
-
-
-
- ))}
-
- )}
-
-
- {(fields, { add, remove }) => (
-
-
- {fields.map((field, j) => (
-
-
-
-
-
-
- ))}
-
- )}
-
-
-
-
-
- {(fields, { add, remove }) => (
-
- {t('pages.inbounds.info.autoSystemRoutes')}
-
- }
- >
-
- {fields.map((field, j) => (
-
-
-
-
-
-
- ))}
-
- )}
-
-
- {t('pages.inbounds.form.autoOutboundsInterface')}
-
- }
- >
-
-
- >
- )}
+ {protocol === Protocols.TUN && }
- {protocol === Protocols.TUNNEL && (
- <>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- >
- )}
+ {protocol === Protocols.TUNNEL && }
{(protocol === Protocols.HTTP || protocol === Protocols.MIXED) && (
<>
diff --git a/frontend/src/pages/inbounds/form/protocols/index.ts b/frontend/src/pages/inbounds/form/protocols/index.ts
new file mode 100644
index 00000000..a86f59db
--- /dev/null
+++ b/frontend/src/pages/inbounds/form/protocols/index.ts
@@ -0,0 +1,2 @@
+export { default as TunFields } from './tun';
+export { default as TunnelFields } from './tunnel';
diff --git a/frontend/src/pages/inbounds/form/protocols/tun.tsx b/frontend/src/pages/inbounds/form/protocols/tun.tsx
new file mode 100644
index 00000000..f1eb99c4
--- /dev/null
+++ b/frontend/src/pages/inbounds/form/protocols/tun.tsx
@@ -0,0 +1,93 @@
+import { useTranslation } from 'react-i18next';
+import { Button, Form, Input, InputNumber, Space, Tooltip } from 'antd';
+import { MinusOutlined, PlusOutlined } from '@ant-design/icons';
+
+export default function TunFields() {
+ const { t } = useTranslation();
+ return (
+ <>
+
+
+
+
+
+
+
+ {(fields, { add, remove }) => (
+
+
+ {fields.map((field, j) => (
+
+
+
+
+
+
+ ))}
+
+ )}
+
+
+ {(fields, { add, remove }) => (
+
+
+ {fields.map((field, j) => (
+
+
+
+
+
+
+ ))}
+
+ )}
+
+
+
+
+
+ {(fields, { add, remove }) => (
+
+ {t('pages.inbounds.info.autoSystemRoutes')}
+
+ }
+ >
+
+ {fields.map((field, j) => (
+
+
+
+
+
+
+ ))}
+
+ )}
+
+
+ {t('pages.inbounds.form.autoOutboundsInterface')}
+
+ }
+ >
+
+
+ >
+ );
+}
diff --git a/frontend/src/pages/inbounds/form/protocols/tunnel.tsx b/frontend/src/pages/inbounds/form/protocols/tunnel.tsx
new file mode 100644
index 00000000..5cfbec15
--- /dev/null
+++ b/frontend/src/pages/inbounds/form/protocols/tunnel.tsx
@@ -0,0 +1,37 @@
+import { useTranslation } from 'react-i18next';
+import { Form, Input, InputNumber, Select, Switch } from 'antd';
+
+import { HeaderMapEditor } from '@/components/form';
+
+export default function TunnelFields() {
+ const { t } = useTranslation();
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+}