feat(amneziawg): complete frontend parity for the Inbounds list page

The Clients page (form, CRUD, QR/config) already worked from the
prior commit; this closes the remaining gap on the Inbounds side and
in a couple of protocol allowlists that a plain search for existing
wireguard/mtproto handling turned up.

lib/xray/inbound-link.ts gets amneziawg-specific link/config builders
(genAmneziaWGLink/genAmneziaWGConfig, plus the *s fan-out variants)
mirroring the wireguard ones — AmneziaWG has no legacy peers-array to
fall back to, so these read settings.clients directly and add the
obfuscation lines every client must share with the server. Wired into
genInboundLinks generically, and into three consumers that call the
wireguard builders directly rather than through that dispatcher:
QrCodeModal, InboundInfoModal, and InboundsPage's bulk export.

ClientInfoModal, ClientBulkAddModal, and the bulk attach/detach modals
each had their own protocol allowlist that needed amneziawg added
alongside wireguard/mtproto.

Two real gaps surfaced by grepping every remaining 'wireguard' /
Protocols.WIREGUARD hit in frontend/src rather than trusting the
checklist was exhaustive:
- useInbounds.ts's TRACKED_PROTOCOLS gates the deactive/depleted/
  expiring/online client counts shown per inbound on the list page;
  without amneziawg those counts would silently read zero.
- inbound-tag.ts is an explicit client-side mirror of the Go backend's
  port_conflict.go (the file says so itself: "Keep in sync"). It still
  only special-cased wireguard for UDP, so an amneziawg inbound would
  have fallen through to the TCP default and disagreed with the
  backend's own port-conflict math.

Also finishes translating the AmneziaWG UI strings into the 11 locale
files that were still falling back to English (ar-EG, es-ES, fa-IR,
id-ID, ja-JP, pt-BR, tr-TR, uk-UA, vi-VN, zh-CN, zh-TW), matching
en-US/ru-RU key-for-key (26 new keys, verified by count in every file).

Not run anywhere: npm run typecheck / build. This machine has neither
Node nor npm, so nothing here has compiled — reviewed by hand plus
brace/paren balance checks and cross-referencing the generated Zod/TS
types. Treat this as needing a real typecheck before shipping.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Kuzz007
2026-07-25 02:06:03 +03:00
parent 19082fdfe9
commit 266f40d79f
22 changed files with 614 additions and 9 deletions
+31
View File
@@ -915,6 +915,12 @@
"wireguardPreSharedKey": "WireGuard 预共享密钥",
"wireguardAllowedIPs": "WireGuard 允许的 IP",
"wireguardAllowedIPsHint": "留空则自动分配;多个条目用逗号分隔",
"amneziaWgPrivateKey": "AmneziaWG 私钥",
"amneziaWgPublicKey": "AmneziaWG 公钥",
"amneziaWgPreSharedKey": "AmneziaWG 预共享密钥",
"amneziaWgAllowedIPs": "AmneziaWG 允许的 IP",
"amneziaWgAllowedIPsHint": "留空则自动分配;多个条目用逗号分隔",
"amneziaWgConfig": "AmneziaWG 配置",
"mtprotoSecret": "MTProto 密钥",
"mtprotoSecretHint": "该客户端的 FakeTLS 密钥。重新生成即可更换。",
"mtprotoAdTag": "广告标签(赞助频道)",
@@ -1800,6 +1806,31 @@
"psk": "共享密钥",
"domainStrategy": "域策略"
},
"amneziawg": {
"privateKey": "私钥",
"publicKey": "公钥",
"subnetIp": "子网",
"subnetCidr": "子网 CIDR",
"mtu": "MTU",
"primaryDns": "主 DNS",
"secondaryDns": "备用 DNS",
"externalInterface": "外部网卡",
"externalInterfaceHint": "用于 NAT(PostUp/PostDown)的主机网卡。留空则自动检测。",
"jc": "Jc(垃圾包数量)",
"jmin": "Jmin(垃圾包最小大小)",
"jmax": "Jmax(垃圾包最大大小)",
"s1": "S1(init 包填充大小)",
"s2": "S2(response 包填充大小)",
"s3": "S3(cookie reply 填充,2.0)",
"s4": "S4(传输包填充,2.0)",
"h1": "H1(魔术头)",
"h2": "H2(魔术头)",
"h3": "H3(魔术头)",
"h4": "H4(魔术头)",
"hHint": "单个整数或范围。留空则使用经典默认值 1/2/3/4。",
"i1": "I1(签名包,2.0)",
"i1Hint": "仅适用于 AmneziaWG 2.0。留空则兼容 1.x。"
},
"tun": {
"nameDesc": "TUN 接口的名称。默认值为 'xray0'",
"mtuDesc": "最大传输单元。数据包的最大大小。默认值为 1500",