diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-10-31 16:43:48 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-11-01 12:03:33 +0100 |
commit | 650d7f64d5b1b76d58b6c719e9efe15270468cc8 (patch) | |
tree | 9a2fb7b5148227e0c9d62ba20616852c91900799 /modules/luci-mod-network/luasrc/controller | |
parent | c85af3d7618b55c499ce4bf58e3896068bd413ae (diff) |
luci-base: remove unused Lua code
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-network/luasrc/controller')
-rw-r--r-- | modules/luci-mod-network/luasrc/controller/admin/network.lua | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/modules/luci-mod-network/luasrc/controller/admin/network.lua b/modules/luci-mod-network/luasrc/controller/admin/network.lua index f8623be93e..662fe8cf88 100644 --- a/modules/luci-mod-network/luasrc/controller/admin/network.lua +++ b/modules/luci-mod-network/luasrc/controller/admin/network.lua @@ -31,9 +31,6 @@ function index() end) if has_wifi then - page = entry({"admin", "network", "wireless_status"}, call("wifi_status"), nil) - page.leaf = true - page = entry({"admin", "network", "wireless_reconnect"}, post("wifi_reconnect"), nil) page.leaf = true @@ -42,9 +39,6 @@ function index() end - page = entry({"admin", "network", "iface_status"}, call("iface_status"), nil) - page.leaf = true - page = entry({"admin", "network", "iface_reconnect"}, post("iface_reconnect"), nil) page.leaf = true @@ -95,77 +89,6 @@ function index() -- end end -function iface_status(ifaces) - local netm = require "luci.model.network".init() - local rv = { } - - local iface - for iface in ifaces:gmatch("[%w%.%-_]+") do - local net = netm:get_network(iface) - local device = net and net:get_interface() - if device then - local data = { - id = iface, - desc = net:get_i18n(), - proto = net:proto(), - uptime = net:uptime(), - gwaddr = net:gwaddr(), - ipaddrs = net:ipaddrs(), - ip6addrs = net:ip6addrs(), - dnsaddrs = net:dnsaddrs(), - ip6prefix = net:ip6prefix(), - errors = net:errors(), - name = device:shortname(), - type = device:type(), - typename = device:get_type_i18n(), - ifname = device:name(), - macaddr = device:mac(), - is_up = net:is_up() and device:is_up(), - is_alias = net:is_alias(), - is_dynamic = net:is_dynamic(), - is_auto = net:is_auto(), - rx_bytes = device:rx_bytes(), - tx_bytes = device:tx_bytes(), - rx_packets = device:rx_packets(), - tx_packets = device:tx_packets(), - - subdevices = { } - } - - for _, device in ipairs(net:get_interfaces() or {}) do - data.subdevices[#data.subdevices+1] = { - name = device:shortname(), - type = device:type(), - typename = device:get_type_i18n(), - ifname = device:name(), - macaddr = device:mac(), - is_up = device:is_up(), - rx_bytes = device:rx_bytes(), - tx_bytes = device:tx_bytes(), - rx_packets = device:rx_packets(), - tx_packets = device:tx_packets(), - } - end - - rv[#rv+1] = data - else - rv[#rv+1] = { - id = iface, - name = iface, - type = "ethernet" - } - end - end - - if #rv > 0 then - luci.http.prepare_content("application/json") - luci.http.write_json(rv) - return - end - - luci.http.status(404, "No such device") -end - function iface_reconnect(iface) local netmd = require "luci.model.network".init() local net = netmd:get_network(iface) @@ -235,26 +158,6 @@ function iface_down(iface, force) luci.http.status(404, "No such interface") end -function wifi_status(devs) - local s = require "luci.tools.status" - local rv = { } - - if type(devs) == "string" then - local dev - for dev in devs:gmatch("[%w%.%-]+") do - rv[#rv+1] = s.wifi_network(dev) - end - end - - if #rv > 0 then - luci.http.prepare_content("application/json") - luci.http.write_json(rv) - return - end - - luci.http.status(404, "No such device") -end - function wifi_reconnect(radio) local rc = luci.sys.call("env -i /sbin/wifi up %s >/dev/null" % luci.util.shellquote(radio)) |