fix(xray): align DNS outbound to spec and repair item-list rules UI

DNS outbound now mirrors xray-core's documented shape: rewriteNetwork
/ rewriteAddress / rewritePort / userLevel replace the legacy network
/ address / port keys, and unset values are dropped on the wire. Old
configs are still accepted on read so saved configs migrate cleanly.

While there, fix two latent bugs in repeat-item editors (DNS rules,
Freedom noise, WireGuard peers):
- The "+" buttons pushed plain objects into arrays of class instances,
  so toJson() crashed on the next read and the JSON tab silently went
  blank. Push proper class instances instead.
- Each item heading lived outside any a-form-item, so the delete icon
  ignored the form's column grid and slumped left. Wrap the heading
  in a form-item with the standard offset wrapper-col and switch the
  flex to space-between so the icon sits at the right of the input
  column, in line with the fields below it.
This commit is contained in:
MHSanaei
2026-05-09 23:17:31 +02:00
parent 60e2af088d
commit f68a14a3ca
3 changed files with 63 additions and 43 deletions
+5 -2
View File
@@ -128,8 +128,11 @@ function outboundAddresses(o) {
case Protocols.Trojan:
serverObj = o.settings?.servers;
break;
case Protocols.DNS:
return [`${o.settings?.address || ''}:${o.settings?.port || ''}`];
case Protocols.DNS: {
const addr = o.settings?.rewriteAddress || o.settings?.address || '';
const port = o.settings?.rewritePort || o.settings?.port || '';
return addr || port ? [`${addr}:${port}`] : [];
}
case Protocols.Wireguard:
return (o.settings?.peers || []).map((p) => p.endpoint);
default: