added DHCP/Static picker, minor UI tweaks

main
riley 10 months ago
parent 6ac4bfe892
commit c5c2e4e26a

@ -40,7 +40,7 @@ end
function get_verbose_hw_info(iface)
local type = iwinfo.type(iface)
if not type then
return "Unknown interface"
return "Generic Wifi Device"
end
local driver = iwinfo[type]
@ -135,15 +135,14 @@ apRadio.widget = "select"
o = s:taboption("setup", Value, "mesh_id", translate("Mesh SSID"))
o.default = "easymesh_AC"
encryption = s:taboption("setup", Flag, "encryption", translate("Encryption"), translate(""))
encryption = s:taboption("setup", Flag, "encryption", translate("Enable Password"), translate(""))
encryption.default = 0
o = s:taboption("setup", Value, "key", translate("Mesh Password"))
o.default = "easymesh"
o:depends({enabled = "1", encryption = "1"})
o:depends("encryption", 1)
o.password = true
-- Move K/V/R settings to the "Advanced" tab
enable_kvr = s:taboption("advanced", Flag, "kvr", translate("K/V/R"), translate("Enable Key Value Roaming"))
enable_kvr.default = 1
@ -196,27 +195,36 @@ o:value("node9", "node9")
o.datatype = "string"
o:depends("role", "off")
btnAPMode = s:taboption("apmode", Button, "_btn_apmode", translate("Join Mesh Network"), translate("WARNING: THIS WILL CHANGE THIS NODE'S IP ADDRESS, YOU WILL LOOSE ACCESS TO THIS UI"))
-- IP Mode (DHCP or Static)
ipmode = s:taboption("apmode", ListValue, "ipmode", translate("IP Mode"), translate("Choose if the node uses DHCP or a Static IP"))
ipmode:value("dhcp", translate("DHCP"))
ipmode:value("static", translate("Static"))
ipmode.default = "dhcp"
ipmode:depends("role", "off")
-- Static IP address
o = s:taboption("apmode", Value, "ipaddr", translate("Static IP Address"))
o.default = "192.168.70.254"
o.datatype = "ip4addr"
o:depends({ipmode="static",role="off"})
-- DNS (Mesh Gateway IP Address)
o = s:taboption("apmode", Value, "gatewayIP", translate("Mesh Gateway IP Address"))
o.default = "192.168.70.1"
o.datatype = "ip4addr"
o:depends({ipmode="static",role="off"})
-- IPv4 netmask
o = s:taboption("apmode", Value, "netmask", translate("IPv4 netmask"))
o.default = "255.255.255.0"
o.datatype = "ip4addr"
o:depends({ipmode="static",role="off"})
btnAPMode = s:taboption("apmode", Button, "_btn_apmode", translate("Enable Dumb AP Mode"), translate("WARNING: THIS WILL CHANGE THIS NODE'S IP ADDRESS, YOU WILL LOOSE ACCESS TO THIS UI"))
function btnAPMode.write()
io.popen("/easymesh/easymesh.sh dumbap &")
luci.sys.call("/easymesh/dumbap.sh")
end
btnAPMode:depends("role", "off")
---- ip address
--o = s:option(Value, "ipaddr", translate("Static IP Address"))
--o.default = "192.168.8.2"
--o.datatype = "ip4addr"
--o:depends("ap_mode", 1)
-- o = s:option(Value, "dns", translate("Mesh Gateway IP Address"))
-- o.default = "192.168.8.1"
-- o.datatype = "ip4addr"
-- o:depends("ap_mode", 1)
-- o = s:option(Value, "netmask", translate("IPv4 netmask"))
-- o.default = "255.255.255.0"
-- o.datatype = "ip4addr"
-- o:depends("ap_mode", 1)
-- MESH Node Control: apply mesh settings
ctrl = m:section(TypedSection, "easymesh", "Click Save Then Enable or Disable Your Mesh WiFi settings")

Loading…
Cancel
Save