From e37708641ebbc3817b2decf17ed72d9a0ec5a110 Mon Sep 17 00:00:00 2001 From: Steve <69524416+ab7pa@users.noreply.github.com> Date: Fri, 9 Sep 2022 07:41:52 -0700 Subject: [PATCH] simplify AdvConfig display (#501) --- files/www/cgi-bin/advancedconfig | 134 +++++++++++++++++-------------- 1 file changed, 72 insertions(+), 62 deletions(-) diff --git a/files/www/cgi-bin/advancedconfig b/files/www/cgi-bin/advancedconfig index 0b61ae20..4fcb6f83 100755 --- a/files/www/cgi-bin/advancedconfig +++ b/files/www/cgi-bin/advancedconfig @@ -83,7 +83,7 @@ local settings = { category = "Link Quality Settings", key = "aredn.@lqm[0].enable", type = "boolean", - desc = "Enable experimental link quality management", + desc = "Enable Link Quality Management

aredn.@lqm[0].enable", default = "1", postcallback = "lqm_defaults()", needreboot = true @@ -92,7 +92,7 @@ local settings = { category = "Link Quality Settings", key = "aredn.@lqm[0].margin_snr", type = "string", - desc = "Margin in dB above minimum SNR a signal must reach to be re-activated", + desc = "SNR Margin in dB above Min SNR a signal must reach to be re-activated

aredn.@lqm[0].margin_snr", default = "1", condition = "lqm_enabled()" }, @@ -100,7 +100,7 @@ local settings = { category = "Link Quality Settings", key = "aredn.@lqm[0].min_distance", type = "string", - desc = "Distance in meters neighbor must be over to be activated", + desc = "Min Distance in meters beyond which a neighbor RF link is allowed

aredn.@lqm[0].min_distance", default = "0", condition = "lqm_enabled()" }, @@ -108,7 +108,7 @@ local settings = { category = "Link Quality Settings", key = "aredn.@lqm[0].auto_distance", type = "string", - desc = "Distance in meters to use when actual distance cannot be calculated", + desc = "Default Distance in meters to use when actual distance cannot be calculated

aredn.@lqm[0].auto_distance", default = "0", condition = "lqm_enabled()" }, @@ -116,7 +116,7 @@ local settings = { category = "Link Quality Settings", key = "aredn.@lqm[0].margin_quality", type = "string", - desc = "Quality percentage increase before neighbor can be re-activated", + desc = "Quality Margin percentage increase before neighbor can be re-activated

aredn.@lqm[0].margin_quality", default = "1", condition = "lqm_enabled()" }, @@ -124,7 +124,7 @@ local settings = { category = "Link Quality Settings", key = "aredn.@lqm[0].ping_penalty", type = "string", - desc = "Quality percentage penalty to add when neighbor cannot be pinged", + desc = "Ping Penalty quality percentage to add when neighbor cannot be pinged

aredn.@lqm[0].ping_penalty", default = "5", condition = "lqm_enabled()" }, @@ -132,7 +132,7 @@ local settings = { category = "Link Quality Settings", key = "aredn.@lqm[0].user_blocks", type = "string", - desc = "Comma separated list of blocked MACs", + desc = "User Blocked comma-separated list of blocked MACs

aredn.@lqm[0].user_blocks", default = "", condition = "lqm_enabled()" }, @@ -140,7 +140,7 @@ local settings = { category = "Link Quality Settings", key = "aredn.@lqm[0].user_allows", type = "string", - desc = "Comma separated list of always allowed MACs", + desc = "User Allowed comma-separated list of always allowed MACs

aredn.@lqm[0].user_allows", default = "", condition = "lqm_enabled()" }, @@ -148,7 +148,7 @@ local settings = { category = "WAN Settings", key = "aredn.@wan[0].olsrd_gw", type = "boolean", - desc = "Allow other MESH nodes to use my WAN - not recommended and OFF by default", + desc = "Allow other MESH nodes to use my WAN - not recommended and OFF by default

aredn.@wan[0].olsrd_gw", default = "0", postcallback = "changeWANGW()", needreboot = true @@ -157,7 +157,7 @@ local settings = { category = "WAN Settings", key = "aredn.@wan[0].lan_dhcp_route", type = "boolean", - desc = "Allow my LAN devices to access my WAN - ON by default", + desc = "Allow my LAN devices to access my WAN - ON by default

aredn.@wan[0].lan_dhcp_route", default = "1", postcallback = "changeWANGW()", needreboot = true @@ -166,7 +166,7 @@ local settings = { category = "WAN Settings", key = "aredn.@wan[0].lan_dhcp_defaultroute", type = "boolean", - desc = "Provide default route to LAN devices even when WAN access is disabled", + desc = "Provide default route to LAN devices even when WAN access is disabled

aredn.@wan[0].lan_dhcp_defaultroute", default = "0", postcallback = "changeWANGW()", needreboot = true @@ -175,7 +175,7 @@ local settings = { category = "WAN Settings", key = "aredn.wan.vlanid", type = "string", - desc = "Specify WAN VLAN number; must be an integer in the range [1,4094]", + desc = "WAN VLAN Number - must be an integer in the range [1,4094]

aredn.wan.vlanid", default = "", condition = "supportsVLANChange()", current = "currentWANVLAN()", @@ -186,7 +186,7 @@ local settings = { category = "Power Options", key = "aredn.@poe[0].passthrough", type = "boolean", - desc = "Specifies whether PoE power passthrough should be on or off (Not all devices have PoE passthrough ports)", + desc = "PoE Passthrough specifies whether PoE power should be enabled (Not all devices have PoE passthrough ports)

aredn.@poe[0].passthrough", default = "0", condition = "hasPOE()", postcallback = "setPOEOutput()" @@ -195,7 +195,7 @@ local settings = { category = "Power Options", key = "aredn.@usb[0].passthrough", type = "boolean", - desc = "Specifies whether USB power passthrough should be on or off (Not all devices have USB powered ports)", + desc = "USB Power Passthrough specifies whether USB power should be enabled (Not all devices have USB powered ports)

aredn.@usb[0].passthrough", default = "1", postcallback = "setUSBOutput()", condition = "hasUSB()" @@ -204,7 +204,7 @@ local settings = { category = "Tunnel Options", key = "aredn.@tunnel[0].maxclients", type = "string", - desc = "Specifies the maximum number of tunnel clients this node can serve; must be an integer in the range [0,100].", + desc = "Tunnel Maxclients specifies the maximum number of tunnel clients this node can serve; must be an integer in the range [0,100].

aredn.@tunnel[0].maxclients", default = "10", precallback = "restrictTunnelLimitToValidRange()", postcallback = "adjustTunnelInterfaceCount()" @@ -213,7 +213,7 @@ local settings = { category = "Tunnel Options", key = "aredn.@tunnel[0].maxservers", type = "string", - desc = "Specifies the maximum number of tunnel servers to which this node can connect; must be an integer in the range [0,100].", + desc = "Tunnel Maxservers specifies the maximum number of tunnel servers to which this node can connect; must be an integer in the range [0,100].

aredn.@tunnel[0].maxservers", default = "10", precallback = "restrictTunnelLimitToValidRange()", postcallback = "adjustTunnelInterfaceCount()" @@ -222,7 +222,7 @@ local settings = { category = "Tunnel Options", key = "aredn.@tunnel[0].wanonly", type = "boolean", - desc = "Prevents tunnel traffic from being routed over the mesh network itself.", + desc = "WAN-Only Tunnel prevents tunnel traffic from being routed over the Mesh network itself

aredn.@tunnel[0].wanonly", default = "1", needreboot= true }, @@ -230,21 +230,21 @@ local settings = { category = "Memory Settings", key = "aredn.@meshstatus[0].lowmem", type = "string", - desc = "Specifies the low memory threshold in KB when the mesh status page will be truncated", + desc = "Low Memory Threshold in KB when the Mesh Status page will be truncated

aredn.@meshstatus[0].lowmem", default = "10000" }, { category = "Memory Settings", key = "aredn.@meshstatus[0].lowroutes", type = "string", - desc = "The maximum number of routes that will be shown on the mesh status page when low memory is detected", + desc = "Low Memory Max Routes is the maximum number of routes shown on the Mesh Status page when low memory is detected

aredn.@meshstatus[0].lowroutes", default = "1000" }, { category = "Network Tools", key = "aredn.olsr.restart", type = "none", - desc = "Will restart OLSR when executed; wait up to 2 or 3 minutes to receive response", + desc = "OLSR Restart will restart OLSR when executed; wait up to 2 or 3 minutes to receive response

aredn.olsr.restart", default = "0", postcallback = "olsr_restart()" }, @@ -252,42 +252,42 @@ local settings = { category = "Network Tools", key = "aredn.@iperf[0].enable", type = "boolean", - desc = "Enable the included iperf3 client/server support", + desc = "IPERF Enable allows the included iperf3 client/server

aredn.@iperf[0].enable", default = "1" }, { category = "Map Paths", key = "aredn.@map[0].maptiles", type = "string", - desc = "Specifies the URL of the location to access map tiles", + desc = "Map Tiles URL

aredn.@map[0].maptiles", default = "http://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.jpg" }, { category = "Map Paths", key = "aredn.@map[0].leafletcss", type = "string", - desc = "Specifies the URL of the leaflet.css file", + desc = "Leaflet.css URL

aredn.@map[0].leafletcss", default = "http://unpkg.com/leaflet@0.7.7/dist/leaflet.css" }, { category = "Map Paths", key = "aredn.@map[0].leafletjs", type = "string", - desc = "Specifies the URL of the leaflet.js file", + desc = "Leaflet.js URL

aredn.@map[0].leafletjs", default = "http://unpkg.com/leaflet@0.7.7/dist/leaflet.js" }, { category = "Firmware Paths", key = "aredn.@downloads[0].firmwarepath", type = "string", - desc = "Specifies the URL of the location from which firmware files will be downloaded", + desc = "Firmware Download URL

aredn.@downloads[0].firmwarepath", default = "http://downloads.arednmesh.org/firmware" }, { category = "Firmware Paths", key = "aredn.@downloads[0].pkgs_core", type = "string", - desc = "Specifies the URL for the 'core' packages such as kernel modules", + desc = "Core Packages Download URL

aredn.@downloads[0].pkgs_core", default = defaultPackageRepos('aredn_core'), postcallback = "writePackageRepo('core')" }, @@ -295,7 +295,7 @@ local settings = { category = "Firmware Paths", key = "aredn.@downloads[0].pkgs_base", type = "string", - desc = "Specifies the URL for the 'base' packages: libraries, shells, etc.", + desc = "Base Packages URL

aredn.@downloads[0].pkgs_base", default = defaultPackageRepos('base'), postcallback = "writePackageRepo('base')" }, @@ -303,7 +303,7 @@ local settings = { category = "Firmware Paths", key = "aredn.@downloads[0].pkgs_arednpackages", type = "string", - desc = "Specifies the URL for the 'arednpackages' packages: vtun, etc.", + desc = "AREDN Packages URL

aredn.@downloads[0].pkgs_arednpackages", default = defaultPackageRepos('arednpackages'), postcallback = "writePackageRepo('arednpackages')" }, @@ -311,7 +311,7 @@ local settings = { category = "Firmware Paths", key = "aredn.@downloads[0].pkgs_luci", type = "string", - desc = "Specifies the URL for the 'luci' packages: luci and things needed for luci.", + desc = "Luci Packages URL

aredn.@downloads[0].pkgs_luci", default = defaultPackageRepos('luci'), postcallback = "writePackageRepo('luci')" }, @@ -319,7 +319,7 @@ local settings = { category = "Firmware Paths", key = "aredn.@downloads[0].pkgs_packages", type = "string", - desc = "Specifies the URL for the 'packages' packages: everything not included in the other dirs.", + desc = "Package Download URL for packages not included in the other sections

aredn.@downloads[0].pkgs_packages", default = defaultPackageRepos('packages'), postcallback = "writePackageRepo('packages')" }, @@ -327,7 +327,7 @@ local settings = { category = "Firmware Paths", key = "aredn.@downloads[0].pkgs_routing", type = "string", - desc = "Specifies the URL for the 'routing' packages: olsr, etc.", + desc = "Routing Packages URL

aredn.@downloads[0].pkgs_routing", default = defaultPackageRepos('routing'), postcallback = "writePackageRepo('routing')" }, @@ -335,7 +335,7 @@ local settings = { category = "Firmware Paths", key = "aredn.@downloads[0].pkgs_telephony", type = "string", - desc = "Specifies the URL for the 'telephony' packages.", + desc = "Telephony Packages URL

aredn.@downloads[0].pkgs_telephony", default = defaultPackageRepos('telephony'), postcallback = "writePackageRepo('telephony')" }, @@ -343,7 +343,7 @@ local settings = { category = "Firmware Paths", key = "aredn.@downloads[0].pkgs_freifunk", type = "string", - desc = "Specifies the URL for the 'freifunk' packages.", + desc = "Freifunk Packages URL

aredn.@downloads[0].pkgs_freifunk", default = defaultPackageRepos('freifunk'), postcallback = "writePackageRepo('freifunk')" }, @@ -351,7 +351,7 @@ local settings = { category = "AREDN Alert Settings", key = "aredn.aam.refresh", type = "none", - desc = "Execute to pull any AREDN Alert messages", + desc = "Alert Message Refresh - Execute to pull any AREDN Alert messages

aredn.aam.refresh", default = "0", postcallback = "aam_refresh()" }, @@ -359,14 +359,14 @@ local settings = { category = "AREDN Alert Settings", key = "aredn.@alerts[0].localpath", type = "string", - desc = "Specifies the URL of the location from which local AREDN Alerts can be downloaded", + desc = "Alert Message Local URL - location from which local AREDN Alerts can be downloaded

aredn.@alerts[0].localpath", default = "" }, { category = "AREDN Alert Settings", key = "aredn.@alerts[0].pollrate", type = "string", - desc = "Specifies how many hours to wait between polling for new AREDN Alerts", + desc = "Alert Message Pollrate - how many hours to wait between polling for new AREDN Alerts

aredn.@alerts[0].pollrate", default = "12", needreboot = true }, @@ -374,7 +374,7 @@ local settings = { category = "AREDN Alert Settings", key = "aredn.aam.purge", type = "none", - desc = "Execute to immediately delete all AREDN (and local) Alerts from this node", + desc = "Alert Message Purge - execute to immediately delete all alerts from this node

aredn.aam.purge", default = "", postcallback = "alert_purge()" } @@ -805,38 +805,46 @@ function toggleDefault(fname, defval) { html.print("
") html.alert_banner(); -html.print("
WARNING: Changing advanced settings can be harmful to the stability, security, and performance of this node and potentially the entire mesh network.
You should only continue if you are sure of what you are doing.
") +html.print("
") +html.print("
") +html.print("WARNING: Changing advanced settings can be harmful to the stability, security, and performance of this node and potentially the entire mesh network.
You should only continue if you are sure of what you are doing.
") +html.print("") -- navbar -html.print("
") -html.print("") -html.print("") -html.print("") -html.print("") -html.print("") -html.print("") -html.print("") -html.print("
Node StatusBasic SetupPort Forwarding,
DHCP, and Services
Tunnel
Server
Tunnel
Client
Administration

") -html.print("
") +html.print("") +html.print("") +html.print("") +html.print("") +html.print("") +html.print("") +html.print("") +html.print("
Node StatusBasic SetupPort Forwarding,
DHCP, and Services
Tunnel
Server
Tunnel
Client
AdministrationAdvanced
Configuration

") -html.print("Help    ") +-- help link and buttons table +html.print("") +html.print("") +html.print("") +html.print("") +html.print("
Help
") +-- messages table +html.print("") if nixio.fs.stat("/tmp/reboot-required") then - html.print("") + html.print("") end for _, m in ipairs(msgs) do - html.print("") + html.print("") end +html.print("

Reboot is required for changes to take effect

Reboot is required for changes to take effect

" .. m .. "
" .. m .. "

") +-- advanced configuration settings table html.print([[ - - +
- - - + + @@ -844,6 +852,7 @@ html.print([[ ]]) -- settings +html.print("") local prior_category = "" for i, setting in ipairs(settings) @@ -858,12 +867,13 @@ do end sval = sval and tostring(sval) or "" if setting.category ~= prior_category then - html.print([[]]) + html.print([[]]) prior_category = setting.category end - html.print([[") + html.print("") if setting.type ~= "none" then - html.print("
Help
(hover)
Config Setting
Setting Value Actions
]] .. setting.category .. [[
]] .. setting.category .. [[
]] .. setting.key .. [[]]) + html.print("
" .. setting.desc .. "") if setting.type == "string" then - html.print("") + html.print("") elseif setting.type == "boolean" then if sval == "" then sval = setting.default @@ -878,9 +888,9 @@ do end html.print("

") + html.print("


") else - html.print("


") + html.print("


") end if setting.type == "string" then html.print("") @@ -891,7 +901,7 @@ do end end -html.print("
") +html.print("") html.footer() html.print("") http_footer()