From c7cf8ef8c14dce298b26185355b9ca2e458b7a92 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 13 Mar 2011 17:25:54 +0000 Subject: modules/admin-full: use luci.tools.status for remaining wifi status displays --- .../admin-full/luasrc/controller/admin/network.lua | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'modules/admin-full/luasrc/controller/admin') diff --git a/modules/admin-full/luasrc/controller/admin/network.lua b/modules/admin-full/luasrc/controller/admin/network.lua index f7c94f2cd..badb696cc 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. @@ -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 -- cgit v1.2.3