More verbose descriptions that look sexy, better input validation

main
riley 10 months ago
parent bfbcfd46dd
commit 1b3930dd2d

@ -68,7 +68,7 @@ end
local Nodes = luci.sys.exec("batctl n 2>/dev/null| tail +3 | wc -l")
local Node = detect_Node()
v = m:section(Table, Node, translate("Active Nodes") ,"<b>" .. translate("Number of Active Nodes: ") .. Nodes .. "</b>")
v = m:section(Table, Node, translate("Mesh Status") ,"<b>" .. translate("Number of Active Nodes: ") .. Nodes .. "</b>")
v:option(DummyValue, "IF", translate("Interface"))
v:option(DummyValue, "Neighbor", translate("Neighbor Nodes"))
v:option(DummyValue, "lastseen", translate("Last Seen Timestamp"))
@ -102,7 +102,7 @@ s:tab("apmode", translate("AP Mode"))
s:tab("advanced", translate("Advanced Settings"))
---- Eanble
o = s:taboption("setup", Flag, "enabled", translate("Enable Mesh Network"), translate("Toggle this switch to activate or deactivate the Mesh Network on this device according to the settings specified in this configuration. Make sure to configure all necessary settings before enabling the Mesh Network. Changes will apply when you click Save and Apply"))
o = s:taboption("setup", Flag, "enabled", translate("Enable Mesh Networking"), translate('<p style="text-align: justify; padding: 0;">Toggle this switch to activate or deactivate the Mesh Network on this device according to the settings specified in this configuration. Make sure to configure all necessary settings before enabling the Mesh Network. </p><p style="text-align: justify; padding: 0;"><strong>Changes will apply when you click Save and Apply</strong></p>'))
o.default = 0
@ -113,7 +113,7 @@ o:value("off", translate("Node"))
o.default = "server"
--o:value("client", translate("Client (advanced)"))
apRadio = s:taboption("setup", MultiValue, "apRadio", translate("Mesh Radio(s)"), translate('<p style="text-align: justify; padding: 0;">Select one or multiple radio interfaces to be used for the mesh network. Each selected radio interface will be configured to participate in the mesh network, extending its range and improving its resilience. By using multiple radios, your mesh network can balance the network load and handle a larger number of connected devices.</p>'))
apRadio = s:taboption("setup", MultiValue, "apRadio", translate("Mesh Radio(s)"), translate('<p style="text-align: justify; padding: 0;">Select one or multiple radio interfaces to be used for the mesh network. Each selected radio interface will be configured to participate in the mesh network, extending its range and improving its resilience. By using multiple radios, your mesh network can balance the network load and handle a larger number of connected devices.</p><strong><p style="text-align: justify; padding: 0;">Ensure the radios you select support mesh networking</p></strong>'))
uci:foreach("wireless", "wifi-device",
function(s)
@ -125,33 +125,34 @@ uci:foreach("wireless", "wifi-device",
apRadio.default = "radio0"
apRadio.widget = "select"
o = s:taboption("setup", Value, "mesh_id", translate("Mesh SSID"))
o = s:taboption("setup", Value, "mesh_id", translate("Mesh Network SSID"), translate('<p style="text-align: justify; padding: 0;"><strong>Ensure that the SSID is the same across all the servers/nodes in your mesh network.</strong></p>'))
o.default = "easymesh_AC"
encryption = s:taboption("setup", Flag, "encryption", translate("Enable Password"), translate(""))
encryption = s:taboption("setup", Flag, "encryption", translate("Password Protection"), translate('<p style="text-align: justify; padding: 0;"><strong>Enable this switch to require a password to join your Mesh Network.</strong></p>'))
encryption.default = 0
o = s:taboption("setup", Value, "key", translate("Mesh Password"))
o.default = "easymesh"
o:depends("encryption", 1)
o.password = true
o.datatype = "minlength(8)"
enable_kvr = s:taboption("advanced", Flag, "kvr", translate("K/V/R"), translate("Enable Key Value Roaming"))
enable_kvr = s:taboption("advanced", Flag, "kvr", translate("K/V/R"), translate('<p style="text-align: justify; padding: 0;"><strong>Leave these settings as default unless you know what you\'re doing</p></strong>'))
enable_kvr.default = 1
mobility_domain = s:taboption("advanced", Value, "mobility_domain", translate("Mobility Domain"), translate("4-character hexadecimal ID"))
mobility_domain = s:taboption("advanced", Value, "mobility_domain", translate("Mobility Domain"))
mobility_domain.default = "4f57"
--mobility_domain.datatype = "and(hexstring,rangelength(4,4))"
mobility_domain.datatype = "and(hexstring,rangelength(4,4))"
rssi_val = s:taboption("advanced", Value, "rssi_val", translate("Threshold for a good RSSI"))
rssi_val = s:taboption("advanced", Value, "rssi_val", translate("Good RSSI Threshold"))
rssi_val.default = "-60"
--rssi_val.datatype = "range(-1,-120)"
rssi_val.datatype = "range(-120,-1)"
low_rssi_val = s:taboption("advanced", Value, "low_rssi_val", translate("Threshold for a bad RSSI"))
low_rssi_val = s:taboption("advanced", Value, "low_rssi_val", translate("Bad RSSI Threshold"))
low_rssi_val.default = "-88"
--low_rssi_val.datatype = "range(-1,-120)"
low_rssi_val.datatype = "range(-120,-1)"

Loading…
Cancel
Save