mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-01 16:07:17 +00:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user