Prefix 'WiFi' to WAN address when WiFi wan is enabled (#470)

This commit is contained in:
Tim Wilkinson 2022-08-02 16:57:44 -07:00 committed by GitHub
parent c3a317d424
commit 102c4112c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -1312,7 +1312,7 @@ end
html.print("<tr><td><nobr>Prevent LAN devices<br>from accessing WAN</td><td><input type=checkbox name=lan_dhcp_noroute value=1 title='Disable LAN devices to access the internet'" .. (lan_dhcp_noroute ~= "0" and " checked" or "") .. ">&nbsp;&nbsp;<a href='/help.html#preventwan' target='_blank'><img src='/qmark.png'></a></td></tr>")
-- wan wifi client
if (phycount > 1 and (wifi_enable ~= "1" or wifi2_enable ~= "1")) or (phycount == 1 and wifi_enable ~= "1" and wifi2_enable ~= "1") and not M390model then
if (phycount > 1 and (wifi_enable ~= "1" or wifi2_enable ~= "1")) or (phycount == 1 and wifi_enable ~= "1" and wifi2_enable ~= "1") and not M39model then
-- wifi client shows as an option
-- determine hardware options and set band accordingly

View File

@ -320,11 +320,15 @@ end
local wan_iface = aredn.hardware.get_iface_name("wan")
if not hide_local and wan_iface then
local ip, bcast, mask = aredn.hardware.get_interface_ip4(wan_iface)
local wprefix = ""
if wan_iface:match("^wlan%d+$") then
wprefix = "WiFi "
end
if ip then
cidr = netmask_to_cidr(mask)
col1[#col1 + 1] = "<th align=right><nobr>WAN address</nobr></th><td>" .. ip .. " <small>/ " .. cidr .. "</small><br>"
col1[#col1 + 1] = "<th align=right><nobr>" .. wprefix .. "WAN address</nobr></th><td>" .. ip .. " <small>/ " .. cidr .. "</small><br>"
else
col1[#col1 + 1] = "<th align=right><nobr>WAN address</nobr></th><td>none</small><br>"
col1[#col1 + 1] = "<th align=right><nobr>" .. wprefix .. "WAN address</nobr></th><td>none</small><br>"
end
end