projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
595020f
)
modules/admin-full: convert admin templates to new network model
author
Jo-Philipp Wich
<jow@openwrt.org>
Sat, 30 Oct 2010 00:44:34 +0000
(
00:44
+0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Sat, 30 Oct 2010 00:44:34 +0000
(
00:44
+0000)
modules/admin-full/luasrc/view/admin_network/iface_status.htm
patch
|
blob
|
history
modules/admin-full/luasrc/view/admin_network/wifi_overview.htm
patch
|
blob
|
history
modules/admin-full/luasrc/view/admin_network/wifi_status.htm
patch
|
blob
|
history
diff --git
a/modules/admin-full/luasrc/view/admin_network/iface_status.htm
b/modules/admin-full/luasrc/view/admin_network/iface_status.htm
index 4deebeec14e9f4b489d684c28ee70cb50dfff177..c2790db2c4391fb37157bed8f1c72ddf993f5523 100644
(file)
--- a/
modules/admin-full/luasrc/view/admin_network/iface_status.htm
+++ b/
modules/admin-full/luasrc/view/admin_network/iface_status.htm
@@
-7,7
+7,7
@@
function(x)
{
var ifc = x.responseText ? eval('(' + x.responseText + ')') : { };
function(x)
{
var ifc = x.responseText ? eval('(' + x.responseText + ')') : { };
- if (ifc)
+ if (ifc
&& (ifc = ifc[0])
)
{
var is_up = (ifc.flags && ifc.flags.up);
var rxb = ifc.stats ? (ifc.stats["rx_bytes"] / 1024) : 0;
{
var is_up = (ifc.flags && ifc.flags.up);
var rxb = ifc.stats ? (ifc.stats["rx_bytes"] / 1024) : 0;
diff --git
a/modules/admin-full/luasrc/view/admin_network/wifi_overview.htm
b/modules/admin-full/luasrc/view/admin_network/wifi_overview.htm
index 4ccee76c07aca2c4829df39050f0593ed2e6588b..9f0354cb884c36674487ab5af10568d354ef284e 100644
(file)
--- a/
modules/admin-full/luasrc/view/admin_network/wifi_overview.htm
+++ b/
modules/admin-full/luasrc/view/admin_network/wifi_overview.htm
@@
-1,7
+1,7
@@
<%#
LuCI - Lua Configuration Interface
Copyright 2008-2009 Steven Barth <steven@midlink.org>
<%#
LuCI - Lua Configuration Interface
Copyright 2008-2009 Steven Barth <steven@midlink.org>
-Copyright 2008-20
09 Jo-Philipp Wich <xm@leipzig.freifunk.net
>
+Copyright 2008-20
10 Jo-Philipp Wich <xm@subsignal.org
>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@
-18,9
+18,9
@@
$Id$
local sys = require "luci.sys"
local utl = require "luci.util"
local uci = require "luci.model.uci".cursor()
local sys = require "luci.sys"
local utl = require "luci.util"
local uci = require "luci.model.uci".cursor()
- local
wlm = require "luci.model.wireless
"
+ local
ntm = require "luci.model.network
"
-
wl
m.init(uci)
+
nt
m.init(uci)
function guess_wifi_hw(ifname)
local name, idx = ifname:match("^([a-z]+)(%d+)")
function guess_wifi_hw(ifname)
local name, idx = ifname:match("^([a-z]+)(%d+)")
@@
-92,7
+92,7
@@
$Id$
return icon
end
return icon
end
- local devices =
wlm:get_device
s()
+ local devices =
ntm:get_wifidev
s()
local arpcache = { }
sys.net.arptable(function(e) arpcache[e["HW address"]] = e["IP address"] end)
-%>
local arpcache = { }
sys.net.arptable(function(e) arpcache[e["HW address"]] = e["IP address"] end)
-%>
@@
-103,7
+103,7
@@
$Id$
<div class="cbi-map">
<div class="cbi-map">
- <% for _, dev in ipairs(devices) do local nets = dev:get_
network
s() %>
+ <% for _, dev in ipairs(devices) do local nets = dev:get_
wifinet
s() %>
<!-- device <%=dev:name()%> -->
<fieldset class="cbi-section">
<table class="cbi-section-table" style="margin:10px; empty-cells:hide">
<!-- device <%=dev:name()%> -->
<fieldset class="cbi-section">
<table class="cbi-section-table" style="margin:10px; empty-cells:hide">
@@
-140,8
+140,8
@@
$Id$
<strong>Encryption:</strong> <%=net:active_encryption()%>
</td>
<td class="cbi-value-field" style="width:40px">
<strong>Encryption:</strong> <%=net:active_encryption()%>
</td>
<td class="cbi-value-field" style="width:40px">
- <a href="<%=
REQUEST_URI%>/<%=dev:name()%>/<%=net:name
()%>"><img style="border:none" src="<%=resource%>/cbi/edit.gif" alt="Edit this network" title="Edit this network" /></a>
- <a href="<%=luci.dispatcher.build_url("admin/network/wireless_delete", net:name())%>"><img style="border:none" src="<%=resource%>/cbi/remove.gif" alt="Delete this network" title="Delete this network" /></a>
+ <a href="<%=
net:adminlink
()%>"><img style="border:none" src="<%=resource%>/cbi/edit.gif" alt="Edit this network" title="Edit this network" /></a>
+ <a href="<%=luci.dispatcher.build_url("admin/network/wireless_delete", net:
if
name())%>"><img style="border:none" src="<%=resource%>/cbi/remove.gif" alt="Delete this network" title="Delete this network" /></a>
</td>
</tr>
<% end %>
</td>
</tr>
<% end %>
@@
-176,7
+176,7
@@
$Id$
</tr>
<% local count = -1 %>
</tr>
<% local count = -1 %>
- <% for _, dev in ipairs(devices) do local nets = dev:get_
network
s() %>
+ <% for _, dev in ipairs(devices) do local nets = dev:get_
wifinet
s() %>
<% for _, net in ipairs(nets) do %>
<% for mac, info in utl.kspairs(net:assoclist()) do count = count + 1 %>
<tr class="cbi-section-table-row cbi-rowstyle-<%=1 + (count % 2)%>">
<% for _, net in ipairs(nets) do %>
<% for mac, info in utl.kspairs(net:assoclist()) do count = count + 1 %>
<tr class="cbi-section-table-row cbi-rowstyle-<%=1 + (count % 2)%>">
diff --git
a/modules/admin-full/luasrc/view/admin_network/wifi_status.htm
b/modules/admin-full/luasrc/view/admin_network/wifi_status.htm
index fee8db498bda5648e890bd641b770d47bf328b6e..63bd26147de910789214ede08287d3a3da831360 100644
(file)
--- a/
modules/admin-full/luasrc/view/admin_network/wifi_status.htm
+++ b/
modules/admin-full/luasrc/view/admin_network/wifi_status.htm
@@
-7,7
+7,7
@@
function(x)
{
var iw = x.responseText ? eval('(' + x.responseText + ')') : null;
function(x)
{
var iw = x.responseText ? eval('(' + x.responseText + ')') : null;
- if (iw)
+ if (iw
&& (iw = iw[0])
)
{
var is_assoc = (iw.bssid && iw.channel);
var p = (100 / iw.quality_max * iw.quality);
{
var is_assoc = (iw.bssid && iw.channel);
var p = (100 / iw.quality_max * iw.quality);
@@
-37,15
+37,15
@@
var d = document.getElementById('<%=self.option%>-iw-description');
if (d && is_assoc)
d.innerHTML = String.format(
var d = document.getElementById('<%=self.option%>-iw-description');
if (d && is_assoc)
d.innerHTML = String.format(
- '<strong><%:Mode%>:</strong> %s |' +
+ '<strong><%:Mode%>:</strong> %s |
' +
'<strong><%:SSID%>:</strong> %s<br />' +
'<strong><%:SSID%>:</strong> %s<br />' +
- '<strong><%:BSSID%>:</strong> %s |' +
+ '<strong><%:BSSID%>:</strong> %s |
' +
'<strong><%:Encryption%>:</strong> %s<br />' +
'<strong><%:Encryption%>:</strong> %s<br />' +
- '<strong><%:Channel%>:</strong> %d (%.3f GHz) |' +
+ '<strong><%:Channel%>:</strong> %d (%.3f GHz) |
' +
'<strong><%:Tx-Power%>:</strong> %d dBm<br />' +
'<strong><%:Tx-Power%>:</strong> %d dBm<br />' +
- '<strong><%:Signal%>:</strong> %d dBm |' +
+ '<strong><%:Signal%>:</strong> %d dBm |
' +
'<strong><%:Noise%>:</strong> %d dBm<br />' +
'<strong><%:Noise%>:</strong> %d dBm<br />' +
- '<strong><%:Bit Rate%>:</strong> %.1f MBit/s |' +
+ '<strong><%:Bit Rate%>:</strong> %.1f MBit/s |
' +
'<strong><%:Country%>:</strong> %s',
iw.mode, iw.ssid, iw.bssid,
iw.encryption ? iw.encryption.description : '<%:None%>',
'<strong><%:Country%>:</strong> %s',
iw.mode, iw.ssid, iw.bssid,
iw.encryption ? iw.encryption.description : '<%:None%>',