diff --git a/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js b/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js index 7035dc476..9c7caa434 100644 --- a/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js +++ b/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js @@ -366,6 +366,14 @@ return L.view.extend({ so.value(hosts[mac].ipv4); }); + so = ss.options(form.value, 'gw', _('Gateway IPv4 Address')); + so.rmempty = true; + so.datatype = 'or(ip4addr,"ignore")'; + Object.keys(hosts).forEach(function(mac) { + if (hosts[mac].ipv4) + so.value(hosts[mac].ipv4); + }); + so = ss.option(form.Value, 'leasetime', _('Lease time')); so.rmempty = true; diff --git a/luci-mod-network/luasrc/controller/admin/network.lua b/luci-mod-network/luasrc/controller/admin/network.lua index 9d895db88..dba251a2c 100644 --- a/luci-mod-network/luasrc/controller/admin/network.lua +++ b/luci-mod-network/luasrc/controller/admin/network.lua @@ -1,5 +1,6 @@ -- Copyright 2008 Steven Barth -- Copyright 2011-2018 Jo-Philipp Wich +-- Copyright 2019 Ycarus (Yannick Chabanois) for OpenMPTCProuter project -- Licensed to the public under the Apache License 2.0. module("luci.controller.admin.network", package.seeall) @@ -138,6 +139,12 @@ function index() page = entry({"admin", "network", "diag_ping6"}, post("diag_ping6"), nil) page.leaf = true + page = entry({"admin", "network", "diag_getip"}, post("diag_getip"), nil) + page.leaf = true + + page = entry({"admin", "network", "diag_netstat"}, post("diag_netstat"), nil) + page.leaf = true + page = entry({"admin", "network", "diag_traceroute6"}, post("diag_traceroute6"), nil) page.leaf = true -- end @@ -420,3 +427,11 @@ end function diag_traceroute6(addr) diag_command("traceroute6 -q 1 -w 2 -n %s 2>&1", addr) end + +function diag_getip(addr) + diag_command("wget -4 -qO- -T 2 %s 2>&1", addr) +end + +function diag_netstat() + diag_command("netstat -lapute 2>&1","http://www.none.com/") +end diff --git a/luci-mod-network/luasrc/model/cbi/admin_network/dhcp.lua b/luci-mod-network/luasrc/model/cbi/admin_network/dhcp.lua index 0be1b3fb5..93ab68311 100644 --- a/luci-mod-network/luasrc/model/cbi/admin_network/dhcp.lua +++ b/luci-mod-network/luasrc/model/cbi/admin_network/dhcp.lua @@ -306,6 +306,9 @@ end ip = s:option(Value, "ip", translate("IPv4-Address")) ip.datatype = "or(ip4addr,'ignore')" +gw = s:option(Value, "gw", translate("Gateway IPv4 Address")) +gw.datatype = "or(ip4addr,'ignore')" + time = s:option(Value, "leasetime", translate("Lease time")) time.rmempty = true diff --git a/luci-mod-network/luasrc/view/admin_network/diagnostics.htm b/luci-mod-network/luasrc/view/admin_network/diagnostics.htm index 4ab206e81..024fc15bc 100644 --- a/luci-mod-network/luasrc/view/admin_network/diagnostics.htm +++ b/luci-mod-network/luasrc/view/admin_network/diagnostics.htm @@ -1,5 +1,6 @@ <%# Copyright 2010 Jo-Philipp Wich + Copyright 2019 Ycarus (Yannick Chabanois) for OpenMPTCProuter project Licensed to the public under the Apache License 2.0. -%> @@ -10,7 +11,7 @@ local fs = require "nixio.fs" local has_ping6 = fs.access("/bin/ping6") or fs.access("/usr/bin/ping6") local has_traceroute6 = fs.access("/bin/traceroute6") or fs.access("/usr/bin/traceroute6") local has_speedtest = fs.access("/usr/sbin/speedtestc") -local has_curl = fs.access("/usr/bin/curl") +local has_wget = fs.access("/usr/bin/wget") local has_netstat = fs.access("/bin/netstat") local dns_host = luci.config.diag and luci.config.diag.dns or "dev.openwrt.org" @@ -103,14 +104,8 @@ local getip_host = luci.config.diag and luci.config.diag.getip or "ifconfig.co"
- <% if has_speedtest and false then %> -
-
- -
- <% end %> - <% if has_curl then %> + <% if has_wget then %>