mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-07 10:46:19 +00:00
wireguard save domainStrategy and reserved(not implemented in form but will work)
This commit is contained in:
parent
b2e1c46ffe
commit
f570674d4e
1 changed files with 6 additions and 3 deletions
|
@ -850,9 +850,8 @@ Outbound.ShadowsocksSettings = class extends CommonClass {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Outbound.WireguardSettings = class extends CommonClass {
|
Outbound.WireguardSettings = class extends CommonClass {
|
||||||
constructor(secretKey, address, peers, mtu, workers, domainStrategy) {
|
constructor(secretKey, address, peers, mtu, workers, domainStrategy, reserved) {
|
||||||
super();
|
super();
|
||||||
this.secretKey = secretKey || '';
|
this.secretKey = secretKey || '';
|
||||||
this.address = address ? [...address] : [];
|
this.address = address ? [...address] : [];
|
||||||
|
@ -863,6 +862,7 @@ Outbound.WireguardSettings = class extends CommonClass {
|
||||||
this.mtu = mtu;
|
this.mtu = mtu;
|
||||||
this.workers = workers;
|
this.workers = workers;
|
||||||
this.domainStrategy = domainStrategy;
|
this.domainStrategy = domainStrategy;
|
||||||
|
this.reserved = reserved;
|
||||||
}
|
}
|
||||||
|
|
||||||
static fromJson(json={}) {
|
static fromJson(json={}) {
|
||||||
|
@ -872,6 +872,8 @@ Outbound.WireguardSettings = class extends CommonClass {
|
||||||
json.peers,
|
json.peers,
|
||||||
json.mtu,
|
json.mtu,
|
||||||
json.workers,
|
json.workers,
|
||||||
|
json.domainStrategy,
|
||||||
|
json.reserved,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -907,7 +909,7 @@ Outbound.WireguardSettings = class extends CommonClass {
|
||||||
this.peers[index].allowedIPs.splice(ipIndex, 1);
|
this.peers[index].allowedIPs.splice(ipIndex, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
optionalFields = ['mtu', 'workers', 'domainStrategy', 'address'];
|
optionalFields = ['mtu', 'workers', 'domainStrategy', 'address', 'reserved'];
|
||||||
optionalPeerFields = ['allowedIPs', 'keepAlive', 'preSharedKey'];
|
optionalPeerFields = ['allowedIPs', 'keepAlive', 'preSharedKey'];
|
||||||
|
|
||||||
cleanUpOptionalFields(obj) {
|
cleanUpOptionalFields(obj) {
|
||||||
|
@ -943,6 +945,7 @@ Outbound.WireguardSettings = class extends CommonClass {
|
||||||
mtu: this.mtu,
|
mtu: this.mtu,
|
||||||
workers: this.workers,
|
workers: this.workers,
|
||||||
domainStrategy: this.domainStrategy,
|
domainStrategy: this.domainStrategy,
|
||||||
|
reserved: this.reserved,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue