Dumb AP UI refactor

main
riley 1 year ago
parent 344ffd5002
commit fd4733c61d

@ -105,6 +105,7 @@ s.anonymous = true
--app.rmempty = true --app.rmempty = true
s:tab("setup", translate("Basic Setup")) s:tab("setup", translate("Basic Setup"))
s:tab("apmode", translate("AP Mode"))
s:tab("advanced", translate("Advanced Settings")) s:tab("advanced", translate("Advanced Settings"))
---- Eanble ---- Eanble
@ -121,7 +122,7 @@ o:value("client", translate("Client (advanced)"))
o:depends("enabled", 1) o:depends("enabled", 1)
o.rmempty = false o.rmempty = false
apRadio = s:taboption("setup", ListValue, "apRadio", translate("Mesh Radio")) apRadio = s:taboption("setup", MultiValue, "apRadio", translate("Mesh Radio(s)"))
uci:foreach("wireless", "wifi-device", uci:foreach("wireless", "wifi-device",
function(s) function(s)
@ -130,10 +131,10 @@ uci:foreach("wireless", "wifi-device",
local desc = string.format("%s (%s)", iface, hw_modes) local desc = string.format("%s (%s)", iface, hw_modes)
apRadio:value(iface, desc) -- Display radio interface with its hardware modes apRadio:value(iface, desc) -- Display radio interface with its hardware modes
end) end)
apRadio:value("all", translate("ALL"))
apRadio.default = "radio0" apRadio.default = "radio0"
apRadio:depends("enabled", 1) apRadio:depends("enabled", 1)
apRadio.rmempty = false apRadio.rmempty = false
apRadio.widget = "select"
o = s:taboption("setup", Value, "mesh_id", translate("Mesh SSID")) o = s:taboption("setup", Value, "mesh_id", translate("Mesh SSID"))
o.default = "easymesh_AC" o.default = "easymesh_AC"
@ -186,31 +187,11 @@ low_rssi_val:depends("kvr", 1)
--enable.rmempty = false --enable.rmempty = false
-- NodeMode -- NodeMode
s = m:section(TypedSection, "easymesh", translate("Enable Router as DHCP Mesh Node"), translate("Set up Easy Mesh WiFi on your server and nodes first. All mesh nodes will utilize your mesh server for DHCP. ")) -- s = m:section(TypedSection, "easymesh", translate("Enable Router as DHCP Mesh Node"), translate("Set up Easy Mesh WiFi on your server and nodes first. All mesh nodes will utilize your mesh server for DHCP. "))
s.anonymous = true -- s.anonymous = true
---- ap_mode ---- ap_mode
enable = s:option(Flag, "ap_mode", translate("Enable as DHCP Mesh Node"), translate("Important: Setup your mesh WiFi network before enabling.")) o = s:taboption("apmode", Value, "gateway", translate("Node Hostname"))
enable.default = 0
enable.rmempty = false
---- 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)
o = s:option(Value, "gateway", translate("Set Hostname for this Mesh Node"))
o.default = "node2" o.default = "node2"
o:value("node2", "node2") o:value("node2", "node2")
o:value("node3", "node3") o:value("node3", "node3")
@ -221,7 +202,28 @@ o:value("node7", "node7")
o:value("node8", "node8") o:value("node8", "node8")
o:value("node9", "node9") o:value("node9", "node9")
o.datatype = "string" o.datatype = "string"
o:depends("ap_mode", 1) 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"))
function btnAPMode.write()
luci.sys.call("/easymesh/easymesh.sh apmode")
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 -- MESH Node Control: apply mesh settings
ctrl = m:section(TypedSection, "easymesh", "Click Save Then Enable or Disable Your Mesh WiFi settings") ctrl = m:section(TypedSection, "easymesh", "Click Save Then Enable or Disable Your Mesh WiFi settings")

Loading…
Cancel
Save