3x-ui/frontend/src/pages
MHSanaei 9de527b35f
feat(frontend): link import on outbound modal (vmess/vless/trojan/ss/hy2)
The legacy outbound modal could import a vmess://, vless://, trojan://,
ss://, or hysteria2:// share link via a Convert button on the JSON
tab. Restore that UX with a focused pure-function parser.

lib/xray/outbound-link-parser.ts:
- parseVmessLink: base64 JSON, maps net/tls + per-network params onto
  the discriminated stream branch.
- parseVlessLink: standard URL with type/security/sni/pbk/sid/fp/flow
  query params, dispatches transport via buildStream + applies
  security params via applySecurityParams.
- parseTrojanLink: same URL pattern, defaults security to tls.
- parseShadowsocksLink: both modern (base64 userinfo@host:port) and
  legacy (base64 of whole thing) ss:// formats.
- parseHysteria2Link: accepts both hysteria2:// and hy2:// schemes,
  uses the hysteria stream branch with version=2 + TLS h3.
- parseOutboundLink dispatcher returns the first non-null parser
  result, or null when no scheme matches.

test/outbound-link-parser.test.ts:
- 13 cases covering happy paths for each protocol family plus malformed
  input, ss:// dual-format handling, hy2:// alias.

OutboundFormModal.tsx:
- Import button on the JSON tab Input.Search; on success, parsed
  payload flows through rawOutboundToFormValues, the form is reset,
  and we switch back to the Basic tab.
- Tag is preserved when the parsed link does not carry one.

Out of scope: advanced fields the legacy parser handled (xmux, padding
obfs, reality short IDs, finalmask from fm= param). Power users can
finish the import in the form after the basics land.
2026-05-26 13:28:04 +02:00
..
api-docs refactor(frontend): port api-docs/endpoints to TypeScript 2026-05-25 15:29:26 +02:00
clients refactor(frontend): lift Protocols + TLS_FLOW_CONTROL consts to schemas/primitives 2026-05-26 00:51:52 +02:00
inbounds feat(frontend): inbound TCP HTTP camouflage response fields + request headers 2026-05-26 13:21:16 +02:00
index refactor(frontend): tighten HttpUtil generics from any to unknown 2026-05-25 19:51:39 +02:00
login feat(frontend): add Zod runtime validation at API boundary 2026-05-25 16:02:27 +02:00
nodes feat(frontend): drive form validation from Zod schemas 2026-05-25 16:41:56 +02:00
settings feat(frontend): block invalid settings saves with Zod pre-save check 2026-05-25 17:55:21 +02:00
sub Migrate frontend models/api/utils to TypeScript and modernize AntD theming (#4563) 2026-05-25 14:34:53 +02:00
xray feat(frontend): link import on outbound modal (vmess/vless/trojan/ss/hy2) 2026-05-26 13:28:04 +02:00