summaryrefslogtreecommitdiffhomepage
path: root/applications
diff options
context:
space:
mode:
authorManuel Munz <freifunk@somakoma.de>2013-08-01 21:53:58 +0000
committerManuel Munz <freifunk@somakoma.de>2013-08-01 21:53:58 +0000
commit2eb088f0845db8eeed285ec6a756361aae9dc8e3 (patch)
tree1174b83c0b0ed34722c2363959cd90c1ae5ffac2 /applications
parentb87051fe021d1f86020208701099c64dc53ffad5 (diff)
applications/olsr: Remove macs from olsr neighbors page; show '?' for SNR when no info is available; use a seperate column for local interface
Diffstat (limited to 'applications')
-rw-r--r--applications/luci-olsr/luasrc/controller/olsr.lua6
-rw-r--r--applications/luci-olsr/luasrc/view/status-olsr/neighbors.htm27
2 files changed, 19 insertions, 14 deletions
diff --git a/applications/luci-olsr/luasrc/controller/olsr.lua b/applications/luci-olsr/luasrc/controller/olsr.lua
index 19e549df9b..94240dac16 100644
--- a/applications/luci-olsr/luasrc/controller/olsr.lua
+++ b/applications/luci-olsr/luasrc/controller/olsr.lua
@@ -163,9 +163,9 @@ function action_neigh(json)
for k, v in ipairs(data) do
local interface
- local snr = 1
- local signal = 1
- local noise = 1
+ local snr = 0
+ local signal = 0
+ local noise = 0
local arptable = sys.net.arptable()
local mac = ""
local rmac = ""
diff --git a/applications/luci-olsr/luasrc/view/status-olsr/neighbors.htm b/applications/luci-olsr/luasrc/view/status-olsr/neighbors.htm
index 176457d71c..daa52831f6 100644
--- a/applications/luci-olsr/luasrc/view/status-olsr/neighbors.htm
+++ b/applications/luci-olsr/luasrc/view/status-olsr/neighbors.htm
@@ -32,10 +32,8 @@ if luci.http.formvalue("status") == "1" then
rv[#rv+1] = {
rip = link.remoteIP,
- rmac = link.remoteMAC,
hn = link.hostname,
lip = link.localIP,
- lmac = link.localMAC,
ifn = link.interface,
lq = string.format("%.3f", link.linkQuality),
nlq = string.format("%.3f",link.neighborLinkQuality),
@@ -74,14 +72,14 @@ end
if (neigh.proto == '6') {
s += String.format(
'<tr class="cbi-section-table-row cbi-rowstyle-'+(1 + (idx % 2))+' proto-%s">' +
- '<td class="cbi-section-table-titles" style="background-color:%s"><a href="http://[%s]/cgi-bin-status.html">%s/%s</a></td>',
- neigh.proto, neigh.dfgcolor, neigh.rip, neigh.rip, neigh.rmac
+ '<td class="cbi-section-table-titles" style="background-color:%s"><a href="http://[%s]/cgi-bin-status.html">%s</a></td>',
+ neigh.proto, neigh.dfgcolor, neigh.rip, neigh.rip
);
} else {
s += String.format(
'<tr class="cbi-section-table-row cbi-rowstyle-'+(1 + (idx % 2))+' proto-%s">' +
- '<td class="cbi-section-table-titles" style="background-color:%s"><a href="http://%s/cgi-bin-status.html">%s/%s</a></td>',
- neigh.proto, neigh.dfgcolor, neigh.rip, neigh.rip, neigh.rmac
+ '<td class="cbi-section-table-titles" style="background-color:%s"><a href="http://%s/cgi-bin-status.html">%s</a></td>',
+ neigh.proto, neigh.dfgcolor, neigh.rip, neigh.rip
);
}
if (neigh.hn) {
@@ -96,13 +94,14 @@ end
);
}
s += String.format(
- '<td class="cbi-section-table-titles" style="background-color:%s">%s/%s/%s</td>' +
+ '<td class="cbi-section-table-titles" style="background-color:%s">%s</td>' +
+ '<td class="cbi-section-table-titles" style="background-color:%s">%s</td>' +
'<td class="cbi-section-table-titles" style="background-color:%s">%s</td>' +
'<td class="cbi-section-table-titles" style="background-color:%s">%s</td>' +
'<td class="cbi-section-table-titles" style="background-color:%s">%s</td>' +
'<td class="cbi-section-table-titles" style="background-color:%s" title="Signal: %s Noise: %s">%s</td>' +
'</tr>',
- neigh.dfgcolor, neigh.ifn, neigh.lip, neigh.lmac, neigh.dfgcolor, neigh.lq, neigh.dfgcolor, neigh.nlq, neigh.color, neigh.cost, neigh.snr_color, neigh.signal, neigh.noise, neigh.snr || '?'
+ neigh.dfgcolor, neigh.ifn, neigh.dfgcolor, neigh.lip, neigh.dfgcolor, neigh.lq, neigh.dfgcolor, neigh.nlq, neigh.color, neigh.cost, neigh.snr_color, neigh.signal, neigh.noise, neigh.snr || '?'
);
}
@@ -125,6 +124,7 @@ end
<tr class="cbi-section-table-titles">
<th class="cbi-section-table-cell"><%:Neighbour IP%></th>
<th class="cbi-section-table-cell"><%:Hostname%></th>
+ <th class="cbi-section-table-cell"><%:Interface%></th>
<th class="cbi-section-table-cell"><%:Local interface IP%></th>
<th class="cbi-section-table-cell">LQ</th>
<th class="cbi-section-table-cell">NLQ</th>
@@ -144,6 +144,10 @@ end
color = olsrtools.etx_color(link.linkCost)
snr_color = olsrtools.snr_color(link.snr)
+ if link.snr == 0 then
+ link.snr = '?'
+ end
+
defaultgw_color = ""
if link.defaultgw == 1 then
defaultgw_color = "#ffff99"
@@ -152,12 +156,13 @@ end
<tr class="cbi-section-table-row cbi-rowstyle-<%=i%> proto-<%=link.proto%>">
<% if link.proto == "6" then %>
- <td class="cbi-section-table-titles" style="background-color:<%=defaultgw_color%>"><a href="http://[<%=link.remoteIP%>]/cgi-bin-status.html"><%=link.remoteIP%>/<%=link.remoteMAC%></a></td>
+ <td class="cbi-section-table-titles" style="background-color:<%=defaultgw_color%>"><a href="http://[<%=link.remoteIP%>]/cgi-bin-status.html"><%=link.remoteIP%></a></td>
<% else %>
- <td class="cbi-section-table-titles" style="background-color:<%=defaultgw_color%>"><a href="http://<%=link.remoteIP%>/cgi-bin-status.html"><%=link.remoteIP%>/<%=link.remoteMAC%></a></td>
+ <td class="cbi-section-table-titles" style="background-color:<%=defaultgw_color%>"><a href="http://<%=link.remoteIP%>/cgi-bin-status.html"><%=link.remoteIP%></a></td>
<% end %>
<td class="cbi-section-table-titles" style="background-color:<%=defaultgw_color%>"><a href="http://<%=link.hostname%>/cgi-bin-status.html"><%=link.hostname%></a></td>
- <td class="cbi-section-table-titles" style="background-color:<%=defaultgw_color%>"><%=link.interface%>/<%=link.localIP%>/<%=link.localMAC%></td>
+ <td class="cbi-section-table-titles" style="background-color:<%=defaultgw_color%>"><%=link.interface%></td>
+ <td class="cbi-section-table-titles" style="background-color:<%=defaultgw_color%>"><%=link.localIP%></td>
<td class="cbi-section-table-titles" style="background-color:<%=defaultgw_color%>"><%=string.format("%.3f", link.linkQuality)%></td>
<td class="cbi-section-table-titles" style="background-color:<%=defaultgw_color%>"><%=string.format("%.3f", link.neighborLinkQuality)%></td>
<td class="cbi-section-table-titles" style="background-color:<%=color%>"><%=string.format("%.3f", link.linkCost)%></td>