From: Manuel Munz Date: Thu, 1 Aug 2013 21:53:58 +0000 (+0000) Subject: applications/olsr: Remove macs from olsr neighbors page; show '?' for SNR when no... X-Git-Url: http://git.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=2eb088f0845db8eeed285ec6a756361aae9dc8e3 applications/olsr: Remove macs from olsr neighbors page; show '?' for SNR when no info is available; use a seperate column for local interface --- 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( '' + - '%s/%s', - neigh.proto, neigh.dfgcolor, neigh.rip, neigh.rip, neigh.rmac + '%s', + neigh.proto, neigh.dfgcolor, neigh.rip, neigh.rip ); } else { s += String.format( '' + - '%s/%s', - neigh.proto, neigh.dfgcolor, neigh.rip, neigh.rip, neigh.rmac + '%s', + neigh.proto, neigh.dfgcolor, neigh.rip, neigh.rip ); } if (neigh.hn) { @@ -96,13 +94,14 @@ end ); } s += String.format( - '%s/%s/%s' + + '%s' + + '%s' + '%s' + '%s' + '%s' + '%s' + '', - 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 <%:Neighbour IP%> <%:Hostname%> + <%:Interface%> <%:Local interface IP%> LQ NLQ @@ -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 <% if link.proto == "6" then %> - <%=link.remoteIP%>/<%=link.remoteMAC%> + <%=link.remoteIP%> <% else %> - <%=link.remoteIP%>/<%=link.remoteMAC%> + <%=link.remoteIP%> <% end %> <%=link.hostname%> - <%=link.interface%>/<%=link.localIP%>/<%=link.localMAC%> + <%=link.interface%> + <%=link.localIP%> <%=string.format("%.3f", link.linkQuality)%> <%=string.format("%.3f", link.neighborLinkQuality)%> <%=string.format("%.3f", link.linkCost)%>