<%
local sys = require "luci.sys"
local twa = require "luci.tools.webadmin"
-
-- System
local system, model, memtotal, memcached, membuffers, memfree = sys.sysinfo()
local uptime = twa.date_format(tonumber(sys.uptime()))
)
-- wireless
-local uci = require "luci.model.uci".cursor()
-local ntm = require "luci.model.network"
-ntm.init(uci)
+local ntm = require "luci.model.network".init()
local devices = ntm:get_wifidevs()
local netlist = { }
local netdevs = { }
local dev
+local has_iwinfo = pcall(require, "iwinfo")
-- Routes
local defroutev4 = sys.net.defaultroute()
<div class="cbi-map">
<h2><%:Wireless Overview%></h2>
+
+ <% if not has_iwinfo then %>
+ <div class="errorbox">
+ <strong><%:Package libiwinfo required!%></strong><br />
+ <%_The <em>libiwinfo</em> package is not installed. You must install this component for working wireless configuration!%>
+ </div>
+ <% end %>
+
<div class="cbi-section">
<div class="cbi-section-node">
<table class="cbi-section-table">
netdevs[net:ifname()] = dev:name()
if net.iwdata.ifname then
- local signal = net.iwinfo.signal or "N/A"
- local noise = net.iwinfo.noise or "N/A"
+ local signal = net.iwinfo.signal or "N/A"
+ local noise = net.iwinfo.noise or "N/A"
local q = net.iwinfo.quality or "0"
local qmax = net.iwinfo.quality_max or "100"
local qperc = q / qmax * 100
<% end %>
<%+footer%>
-