From b6d996d1b1ac0bc6202e870a31f75284c4f214e3 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Tue, 26 May 2026 12:06:52 +0200 Subject: [PATCH] feat(frontend): OutboundFormModal.new.tsx socks/http/hysteria/loopback/blackhole/wireguard sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SOCKS / HTTP: user + pass at settings root. - Hysteria: read-only version=2 (the actual transport knobs live on stream.hysteria, added with the stream tab). - Loopback: inboundTag. - Blackhole: response type Select with empty/none/http options. - Wireguard: address (csv) + secretKey (with regenerate icon) + derived pubKey + domain strategy + MTU + workers + no-kernel-tun + reserved (csv) + peers Form.List with nested allowedIPs sub-list. Wireguard regenerate icon uses Wireguard.generateKeypair() and writes both keys to the form via setFieldValue — preserves the legacy UX of the SyncOutlined inline-icon next to the privateKey label. --- .../src/pages/xray/OutboundFormModal.new.tsx | 186 +++++++++++++++++- 1 file changed, 185 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/xray/OutboundFormModal.new.tsx b/frontend/src/pages/xray/OutboundFormModal.new.tsx index e7ab6bd4..9eb42cb8 100644 --- a/frontend/src/pages/xray/OutboundFormModal.new.tsx +++ b/frontend/src/pages/xray/OutboundFormModal.new.tsx @@ -1,8 +1,22 @@ import { useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import { Form, Input, InputNumber, Modal, Select, Space, Switch, Tabs, message } from 'antd'; +import { + Button, + Form, + Input, + InputNumber, + Modal, + Select, + Space, + Switch, + Tabs, + message, +} from 'antd'; +import { DeleteOutlined, MinusOutlined, PlusOutlined, SyncOutlined } from '@ant-design/icons'; +import InputAddon from '@/components/InputAddon'; import JsonEditor from '@/components/JsonEditor'; +import { Wireguard } from '@/utils'; import { formValuesToWirePayload, rawOutboundToFormValues, @@ -19,6 +33,7 @@ import { OutboundProtocols as Protocols, TLS_FLOW_CONTROL, USERS_SECURITY, + WireguardDomainStrategy, } from '@/schemas/primitives'; import { SSMethodSchema } from '@/schemas/protocols/inbound/shadowsocks'; import { antdRule } from '@/utils/zodForm'; @@ -315,6 +330,175 @@ export default function OutboundFormModalNew({ )} + + {(protocol === 'socks' || protocol === 'http') && ( + <> + + + + + + + + )} + + {protocol === 'hysteria' && ( + + + + )} + + {protocol === 'loopback' && ( + + + + )} + + {protocol === 'blackhole' && ( + + + + + {t('pages.inbounds.privatekey')} + { + const pair = Wireguard.generateKeypair(); + form.setFieldValue(['settings', 'secretKey'], pair.privateKey); + form.setFieldValue(['settings', 'pubKey'], pair.publicKey); + }} + /> + + } + name={['settings', 'secretKey']} + > + + + + + + + + + + {(fields, { add, remove }) => ( + <> + +