Move the unconfigued setup earlier

Fixes bad band label display on first boot
This commit is contained in:
Tim Wilkinson 2023-02-21 15:25:18 -08:00 committed by Joe AE6XE
parent 6a27a8fb28
commit e284ff98e2
1 changed files with 7 additions and 7 deletions

View File

@ -1053,6 +1053,13 @@ html.print([[
<table cellpadding=5 border=1 style='border-collapse:collapse;' width=100%><tr><td valign=top width=33%>
]])
-- reset wifi channel/bandwidth to default
if nixio.fs.stat("/etc/config/unconfigured") or parms.button_reset then
local defaultwifi = aredn.hardware.get_default_channel()
wifi_channel = defaultwifi.channel
wifi_chanbw = tostring(defaultwifi.bandwidth)
end
-- mesh rf settings
html.print("<table width=100% style='border-collapse: collapse;'>")
html.print("<tr><th colspan=2>Mesh RF (" .. (M3model and "3GHz" or M9model and "900MHz" or wifi_channel < 36 and "2GHz" or "5GHz") .. ")</th></tr>")
@ -1067,13 +1074,6 @@ end
html.print("></td></tr>")
html.print("<tr><td><nobr>IP Address</nobr></td><td><input type=text size=15 name=wifi_ip value='" .. wifi_ip .. "'></td></tr><tr><td>Netmask</td><td><input type=text size=15 name=wifi_mask value='" .. wifi_mask .. "'></td></tr>")
-- reset wifi channel/bandwidth to default
if nixio.fs.stat("/etc/config/unconfigured") or parms.button_reset then
local defaultwifi = aredn.hardware.get_default_channel()
wifi_channel = defaultwifi.channel
wifi_chanbw = tostring(defaultwifi.bandwidth)
end
if wifi_enable == "1" then
html.print("<tr><td>SSID</td><td><input type=text size=15 name=wifi_ssid value='" .. wifi_ssid .. "'>-" .. wifi_chanbw .. "-v3</td></tr>")
hidden[#hidden + 1] = "<input type=hidden name=wifi_mode value='" .. wifi_mode .. "'>"