mirror of https://github.com/aredn/aredn.git
Fix inability to set initial WAN VLAN (#1454)
This commit is contained in:
parent
4ab2629c33
commit
9240bf87cf
|
@ -150,13 +150,13 @@ if (request.env.REQUEST_METHOD === "PUT") {
|
|||
}
|
||||
}
|
||||
if ("wan_vlan" in request.args) {
|
||||
const wan_iface = split(configuration.getSettingAsString("wan_intf", ""), ".");
|
||||
const wan_iface = keys(hardware.getDefaultNetworkConfiguration().wan.ports)[0];
|
||||
const wan_vlan = int(request.args.wan_vlan || 0);
|
||||
if (wan_vlan === 0) {
|
||||
configuration.setSetting("wan_intf", wan_iface[0]);
|
||||
configuration.setSetting("wan_intf", wan_iface);
|
||||
}
|
||||
else if (wan_vlan >= 3 && wan_vlan <= 4095) {
|
||||
configuration.setSetting("wan_intf", `${wan_iface[0]}.${wan_vlan}`);
|
||||
configuration.setSetting("wan_intf", `${wan_iface}.${wan_vlan}`);
|
||||
}
|
||||
}
|
||||
if ("olsrd_gw" in request.args) {
|
||||
|
|
|
@ -143,6 +143,9 @@ export function getSettingAsInt(key, def)
|
|||
export function setSetting(key, value, def)
|
||||
{
|
||||
initSetup();
|
||||
if (!(key in setup)) {
|
||||
push(setupKeys, key);
|
||||
}
|
||||
const old = setup[key];
|
||||
setup[key] = replace(`${value ?? def ?? ""}`, /[\r\n]/g, " ");
|
||||
if (old !== setup[key]) {
|
||||
|
|
Loading…
Reference in New Issue