X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fadmin-full%2Fluasrc%2Fcontroller%2Fadmin%2Fnetwork.lua;h=76d432094d067360751c628044c7c45608e8b1f0;hp=f7c94f2cdff92cc193f02cf45bc14948aa86f998;hb=0ecee984afd0b64e2030b547edc9fbdf038164c7;hpb=18677e216b26acc148387c5414756a5b94c8a17c diff --git a/modules/admin-full/luasrc/controller/admin/network.lua b/modules/admin-full/luasrc/controller/admin/network.lua index f7c94f2cd..76d432094 100644 --- a/modules/admin-full/luasrc/controller/admin/network.lua +++ b/modules/admin-full/luasrc/controller/admin/network.lua @@ -2,6 +2,7 @@ LuCI - Lua Configuration Interface Copyright 2008 Steven Barth +Copyright 2011 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. @@ -66,7 +67,7 @@ function index() local wnet for _, wnet in ipairs(wdev:get_wifinets()) do entry( - {"admin", "network", "wireless", wnet.netid}, + {"admin", "network", "wireless", wnet:id()}, alias("admin", "network", "wireless"), wdev:name() .. ": " .. wnet:shortname() ) @@ -105,9 +106,9 @@ function index() ) if nixio.fs.access("/etc/config/dhcp") then - page = node("admin", "network", "dhcpleases") - page.target = cbi("admin_network/dhcpleases") - page.title = i18n("DHCP Leases") + page = node("admin", "network", "dhcp") + page.target = cbi("admin_network/dhcp") + page.title = i18n("DHCP and DNS") page.order = 30 page = entry({"admin", "network", "dhcplease_status"}, call("lease_status"), nil) @@ -206,7 +207,7 @@ function iface_status() local rv = { } local iface - for iface in path[#path]:gmatch("[%w%.%-]+") do + for iface in path[#path]:gmatch("[%w%.%-_]+") do local net = netm:get_network(iface) if net then local info @@ -326,30 +327,13 @@ function iface_delete() end function wifi_status() - local netm = require "luci.model.network".init() local path = luci.dispatcher.context.requestpath + local s = require "luci.tools.status" local rv = { } local dev for dev in path[#path]:gmatch("[%w%.%-]+") do - local j = { id = dev } - local wn = netm:get_wifinet(dev) - local iw = wn and wn.iwinfo - if iw then - local f - for _, f in ipairs({ - "channel", "frequency", "txpower", "bitrate", "signal", "noise", - "quality", "quality_max", "bssid", "country", - "encryption", "ifname", "assoclist" - }) do - j[f] = iw[f] - end - end - - j.mode = wn and wn:active_mode() or "?" - j.ssid = wn and wn:active_ssid() or "?" - - rv[#rv+1] = j + rv[#rv+1] = s.wifi_network(dev) end if #rv > 0 then