<%# LuCI - Lua Configuration Interface Copyright 2010 Jo-Philipp Wich Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 $Id: diagnostics.htm 9623 2013-01-18 14:08:37Z jow $ -%> <%+header%> <% local fs = require "nixio.fs" local uci = luci.model.uci.cursor() local has_ping6 = fs.access("/bin/ping6") or fs.access("/usr/bin/ping6") local has_traceroute6 = fs.access("/usr/bin/traceroute6") local tabs_i18n = {} if uci:get('functionlist','functionlist','NOT_SUPPORT_DEVICE_DISCOVERY') ~= '1' then tabs_map = {["ping"]=translate("Ping"), ["traceroute"]=translate("Traceroute"), ["nslookup"]=translate("Nslookup"), ["iperf"]=translate("Speed Test"), ["led"]=translate("LED"), ["locator"]=translate("Device Discovery")} else tabs_map = {["ping"]=translate("Ping"), ["traceroute"]=translate("Traceroute"), ["nslookup"]=translate("Nslookup"), ["iperf"]=translate("Speed Test"), ["led"]=translate("LED")} end -- default tabs local tabs = {"ping", "traceroute", "nslookup", "iperf", "led", "locator"} if uci:get('functionlist','functionlist','SUPPORT_HIDE_LED_SETTING') == '1' then table.remove(tabs, 5) end for k,v in ipairs(tabs) do tabs_i18n[tabs[k]] = tabs_map[v] end local curtab = luci.http.formvalue("tab") if curtab == nil then curtab = "ping" end local discover = fs.access("/usr/sbin/discover") local power_led, lan1_led, wifi0_led, wifi1_led, wifi2_led, mesh_led, led1, led2, led3, led4, led5, led_status local PING_SIZE_MAX = uci:get('functionlist','vendorlist','PING_SIZE_MAX') or 20480 local PING_SIZE_MIN = uci:get('functionlist','vendorlist','PING_SIZE_MIN') or 64 if uci:get('functionlist','functionlist','SUPPORT_LED_ONLY_STATUS') == '1' then --[[ #### SUPPORT_LED_ONLY_STATUS START ### --]] led_status = luci.util.trim(luci.util.exec("uci get system.@system[0].led_status")) else if uci:get('functionlist','functionlist','SUPPORT_LED_MODULE_NAME') == '1' then --[[ #### SUPPORT_LED_MODULE_NAME START ### --]] power_led = luci.model.uci.cursor():get("system", "power_led", "default") or 0 lan1_led = luci.model.uci.cursor():get("system", "lan1_led", "default") or 0 wifi0_led = luci.model.uci.cursor():get("system", "wifi0_led", "default") or 0 wifi1_led = luci.model.uci.cursor():get("system", "wifi1_led", "default") or 0 mesh_led = luci.model.uci.cursor():get("system", "mesh_led", "default") or 0 --[[ #### mesh led ### --]] wifi2_led = luci.model.uci.cursor():get("system", "wifi2_led", "default") or 0 else led1 = luci.model.uci.cursor():get_first("system", "led1", "default") or 0 led2 = luci.model.uci.cursor():get_first("system", "led2", "default") or 0 led3 = luci.model.uci.cursor():get_first("system", "led3", "default") or 0 led4 = luci.model.uci.cursor():get_first("system", "led4", "default") or 0 led5 = luci.model.uci.cursor():get_first("system", "led5", "default") or 0 --[[ #### mesh led ### --]] end end --[[ #### SUPPORT_LED_ONLY_STATUS END ### --]] %>

<%:It can specify the destination for Traceroute troubleshooting on network paths from this device.%>

<%:This utility performs DNS look up for available domain records.%>

">
<%:Ping Test Parameters%>
<%:Target IP%> / <%:Domain Name%>
<%:Ping Packet Size%>  <%:Bytes%>
<%:Number of Pings%>
">
<%:Traceroute Test Parameters%> 
<%:Target IP%> / <%:Domain Name%>
">
<%:Nslookup Test Parameters%> 
<%:Target IP%> / <%:Domain Name%>
"> <% local iperf_port=5001 if uci:get("iperf3","iperf3","disabled") == "0" then iperf_port=5201 end %> <% if uci:get('functionlist','functionlist','SUPPORT_IPERF_PORT_V6') == '1' then --[[ #### SUPPORT_IPERF_PORT_V6 START ### --]] %> <% local iperf_port_v6=5002 if uci:get("iperf3","iperf3","disabled") == "0" then iperf_port_v6=60001 end %> <% else --[[ #### SUPPORT_IPERF_PORT_V6 else ### --]] %> <% end --[[ #### SUPPORT_IPERF_PORT_V6 END ### --]] %>
<%:NOTE: Speedtest results are for general network performance testing only (100Mbps is the maximum), and not exact throughput values for the wireless link between two peer-to-peer devices. To find throughput values on the P2P link, run iperf on devices connected behind the P2P devices.%>
<%:Speed Test Parameters%>
<%:Target IP%> / <%:Domain Name%>
<%:Time Period%>  <%:Sec%>
<%:Check Interval%>  <%:Sec%>
IPv4<%: Port%> <%=iperf_port%>
IPv6<%: Port%> <%=iperf_port_v6%>
<%:Port%> <%=iperf_port%>
"> <% if uci:get('functionlist','functionlist','SUPPORT_LED_ONLY_STATUS') == '1' then %> <% else %> <% if uci:get('functionlist','vendorlist','WEB_GUI_VER') ~= nil and uci:get('functionlist','vendorlist','WEB_GUI_VER') > "1" then --[[ #### WEB_GUI_VER feature ### --]] %> <% end --[[ #### WEB_GUI_VER feature ### --]] %> <% if uci:get('functionlist','functionlist','SUPPORT_LED_MODULE_NAME') == '1' then --[[ #### SUPPORT_LED_MODULE_NAME START ### --]] %> <% if uci:get('system','lan1_led') == 'led' then --[[ #### exist lan1_led config #### --]] %> "1" then %> style="display:none" <% end %> > <% end --[[ #### exist lan1_led config end #### --]] %> <% else --[[ #### SUPPORT_LED_MODULE_NAME else ### --]] %> "1" then %> style="display:none" <% end %> > <% end --[[ #### SUPPORT_LED_MODULE_NAME END ### --]] %> <% if WLAN24G == '1' then %> "1" then %> style="display:none" <% end %> > <% end %> <% if WLAN5G == '1' then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %> "1" then %> style="display:none" <% end %> > "1" then %> style="display:none" <% end %> > <% else %> "1" then %> style="display:none" <% end %> > <% end --[[ #### WLAN5G_2 feature ### --]] %> <% end %> <% if uci:get('functionlist','functionlist','SUPPORT_MESH_SETTING') == "1" then --[[ #### SUPPORT_MESH_SETTING START ### --]] %> <% if (uci:get('system','mesh_led') == 'led') or (uci:get_first('system','led5') ~= nil) then --[[ #### exist mesh_led config or led5 config ### --]] %> "1" then %> style="display:none" <% end %> > <% end --[[ #### exist mesh_led config or led5 config end #### --]] %> <% end --[[ #### SUPPORT_MESH_SETTING END ### --]] %> <% end %>
<%:LED Control%>
<%:Status%>  <%:Enable%>  <%:Disable%>
<%:Power%>  <%:Enable%>  <%:Disable%>
<%:Other%>  <%:Enable%>  <%:Disable%>
<%:LAN%>  <%:Enable%>  <%:Disable%>
<%:LAN%>  <%:Enable%>  <%:Disable%>
<%:WLAN%>-2.4GHz  <%:Enable%>  <%:Disable%>
<%:WLAN%>-5GHz - 1  <%:Enable%>  <%:Disable%>
<%:WLAN%>-5GHz - 2  <%:Enable%>  <%:Disable%>
<%:WLAN%>-5GHz  <%:Enable%>  <%:Disable%>
<%:Mesh%>  <%:Enable%>  <%:Disable%>
 <%:Apply saved settings to take effect%>
<% if uci:get('functionlist','functionlist','NOT_SUPPORT_DEVICE_DISCOVERY') ~= '1' then %>
<%:Device Discovery%>
<%:Device Name%> <%:Operation Mode%> <%:IP Address%> <%:System MAC Address%> <%:Firmware Version%>
 
  
<% end %>

<%+footer%>