From 067d7dc9f708d5ebeda1072fb6dc82e960de0d81 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 28 May 2018 14:57:54 +0200 Subject: treewide: convert HTML tables to div Mostly convert HTML tables to div based markup to allow for easier styling in the future. Also change JS accessor code accordingly. Signed-off-by: Jo-Philipp Wich --- .../luci-app-olsr/luasrc/view/status-olsr/hna.htm | 44 ++++++------ .../luasrc/view/status-olsr/interfaces.htm | 40 +++++------ .../luci-app-olsr/luasrc/view/status-olsr/mid.htm | 20 +++--- .../luasrc/view/status-olsr/neighbors.htm | 80 ++++++++++----------- .../luasrc/view/status-olsr/overview.htm | 40 +++++------ .../luasrc/view/status-olsr/routes.htm | 58 +++++++-------- .../luasrc/view/status-olsr/smartgw.htm | 84 +++++++++++----------- .../luasrc/view/status-olsr/topology.htm | 36 +++++----- 8 files changed, 201 insertions(+), 201 deletions(-) (limited to 'applications/luci-app-olsr/luasrc') diff --git a/applications/luci-app-olsr/luasrc/view/status-olsr/hna.htm b/applications/luci-app-olsr/luasrc/view/status-olsr/hna.htm index 5ea7b74e4d..2dc4ce1730 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/hna.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/hna.htm @@ -41,7 +41,7 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 }, { var hna = info[idx]; var linkgw = '' - s += '' + s += '
' if (hna.proto == '6') { linkgw = '' + hna.gateway + '' } else { @@ -61,11 +61,11 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 }, } s += String.format( - '%s' + - '%s' + - '%s', hna.destination + '/' + hna.genmask, linkgw + hostname, validity + '
%s
' + + '
%s
' + + '
%s
', hna.destination + '/' + hna.genmask, linkgw + hostname, validity ) - s += '' + s += '
' } hnadiv.innerHTML = s; } @@ -79,21 +79,21 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 },
<%:Overview of currently active OLSR host net announcements%> - - - - - - - +
+
+
+
<%:Announced network%>
+
<%:OLSR gateway%>
+
<%:Validity Time%>
+
-
- + +
<% for k, route in ipairs(hna) do %> -
- - + <% if hna[k].validityTime then validity = hna[k].validityTime .. 's' else validity = '-' end %> - - +
<%=validity%>
+ <% i = ((i % 2) + 1) end %> - -
<%:Announced network%><%:OLSR gateway%><%:Validity Time%>
<%=hna[k].destination%>/<%=hna[k].genmask%> +
+
<%=hna[k].destination%>/<%=hna[k].genmask%>
+
<% if hna[k].proto == '6' then %> <%=hna[k].gateway%> <% else %> @@ -102,20 +102,20 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 }, <% if hna[k].hostname then %> / <%=hna[k].hostname%> <% end %> -
<%=validity%>
+ +
<%+status-olsr/common_js%> diff --git a/applications/luci-app-olsr/luasrc/view/status-olsr/interfaces.htm b/applications/luci-app-olsr/luasrc/view/status-olsr/interfaces.htm index 81d0a3dd31..e3ccd0c23d 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/interfaces.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/interfaces.htm @@ -18,31 +18,31 @@ local i = 1
<%:Overview of interfaces where OLSR is running%> - - - - - - - - - - +
+
+
<%:Interface%>
+
<%:State%>
+
<%:MTU%>
+
<%:WLAN%>
+
<%:Source address%>
+
<%:Netmask%>
+
<%:Broadcast address%>
+
<% for k, iface in ipairs(iface) do %> -
- - - - - - - - +
+
<%=iface.name%>
+
<%=iface.state%>
+
<%=iface.olsrMTU%>
+
<%=iface.wireless and luci.i18n.translate('yes') or luci.i18n.translate('no')%>
+
<%=iface.ipv4Address or iface.ipv6Address%>
+
<%=iface.netmask%>
+
<%=iface.broadcast or iface.multicast%>
+
<% i = ((i % 2) + 1) end %> -
<%:Interface%><%:State%><%:MTU%><%:WLAN%><%:Source address%><%:Netmask%><%:Broadcast address%>
<%=iface.name%><%=iface.state%><%=iface.olsrMTU%><%=iface.wireless and luci.i18n.translate('yes') or luci.i18n.translate('no')%><%=iface.ipv4Address or iface.ipv6Address%><%=iface.netmask%><%=iface.broadcast or iface.multicast%>
+
<%+status-olsr/common_js%> <%+footer%> diff --git a/applications/luci-app-olsr/luasrc/view/status-olsr/mid.htm b/applications/luci-app-olsr/luasrc/view/status-olsr/mid.htm index f658288fc1..8c9f63af0b 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/mid.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/mid.htm @@ -15,11 +15,11 @@ local i = 1
<%:Overview of known multiple interface announcements%> - - - - - +
+
+
<%:OLSR node%>
+
<%:Secondary OLSR interfaces%>
+
<% for k, mid in ipairs(mids) do local aliases = '' @@ -37,14 +37,14 @@ local i = 1 end %> -
- - - +
+ +
<%=aliases%>
+
<% i = ((i % 2) + 1) end %> -
<%:OLSR node%><%:Secondary OLSR interfaces%>
<%=mid.ipAddress%><%=aliases%>
+
<%+status-olsr/common_js%> <%+footer%> diff --git a/applications/luci-app-olsr/luasrc/view/status-olsr/neighbors.htm b/applications/luci-app-olsr/luasrc/view/status-olsr/neighbors.htm index c077c20486..ab09865865 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/neighbors.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/neighbors.htm @@ -64,36 +64,36 @@ end if (neigh.proto == '6') { s += String.format( - '' + - '%s', + '
' + + '', neigh.proto, neigh.dfgcolor, neigh.rip, neigh.rip ); } else { s += String.format( - '' + - '%s', + '
' + + '', neigh.proto, neigh.dfgcolor, neigh.rip, neigh.rip ); } if (neigh.hn) { s += String.format( - '%s', + '', neigh.dfgcolor, neigh.hn, neigh.hn ); } else { s += String.format( - '?', + '
?
', neigh.dfgcolor ); } s += String.format( - '%s' + - '%s' + - '%s' + - '%s' + - '%s' + - '%s' + - '', + '
%s
' + + '
%s
' + + '
%s
' + + '
%s
' + + '
%s
' + + '
%s
' + + '
', 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 || '?' ); } @@ -112,21 +112,21 @@ end
<%:Overview of currently established OLSR connections%> - - - - - - - - - - - - - +
+
+
+
<%:Neighbour IP%>
+
<%:Hostname%>
+
<%:Interface%>
+
<%:Local interface IP%>
+
LQ
+
NLQ
+
ETX
+
SNR
+
+
-
+
<% local i = 1 for k, link in ipairs(links) do link.linkCost = tonumber(link.linkCost) or 0 @@ -147,25 +147,25 @@ end end %> -
+
<% if link.proto == "6" then %> -
+ <% else %> - + <% end %> - - - - - - - - + +
<%=link.interface%>
+
<%=link.localIP%>
+
<%=string.format("%.3f", link.linkQuality)%>
+
<%=string.format("%.3f", link.neighborLinkQuality)%>
+
<%=string.format("%.3f", link.linkCost)%>
+
<%=link.snr%>
+ <% i = ((i % 2) + 1) end %> - -
<%:Neighbour IP%><%:Hostname%><%:Interface%><%:Local interface IP%>LQNLQETXSNR
<%=link.remoteIP%><%=link.remoteIP%><%=link.hostname%><%=link.interface%><%=link.localIP%><%=string.format("%.3f", link.linkQuality)%><%=string.format("%.3f", link.neighborLinkQuality)%><%=string.format("%.3f", link.linkCost)%><%=link.snr%>
+
+
<%+status-olsr/legend%> diff --git a/applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm b/applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm index 61e17b3b2d..832a27aed7 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm @@ -160,48 +160,48 @@ XHR.poll(10, '<%=REQUEST_URI%>/json', { },
<%:Network%> - - - - - - - + -
<%:Interfaces%> +
+
<%:Interfaces%>
- -
<%:Neighbors%> + +
<%:Neighbors%>
- -
<%:Nodes%> + +
<%:Nodes%>
- -
<%:HNA%> + +
<%:HNA%>
- -
<%:Links total%> + +
<%:Links total%>
- -
<%:Links per node (average)%> + +
<%:Links per node (average)%>
- -
+
OLSR <%:Configuration%> - - - -
<%:Version%> +
+
<%:Version%>
- -
<%:Download Config%> + +
<%:Download Config%>
<% if has_ipv4_conf then %> OpenWrt (IPv4), <% end %> @@ -214,8 +214,8 @@ XHR.poll(10, '<%=REQUEST_URI%>/json', { }, <% if has_ipv6_conf then %> OLSRD (IPv6) <% end %> -
+ +
<%+footer%> diff --git a/applications/luci-app-olsr/luasrc/view/status-olsr/routes.htm b/applications/luci-app-olsr/luasrc/view/status-olsr/routes.htm index 8e46daa022..c75b94fcef 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/routes.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/routes.htm @@ -50,9 +50,9 @@ XHR.poll(20, '<%=REQUEST_URI%>', { status: 1 }, var route = info[idx]; s += String.format( - '' + - '%s/%s' + - '' + + '
' + + '
%s/%s
' + + '
' + '%s', route.proto, route.dest, route.genmask, route.gw, route.gw ) @@ -72,11 +72,11 @@ XHR.poll(20, '<%=REQUEST_URI%>', { status: 1 }, } s += String.format( - '' + - '%s' + - '%s' + - '%s' + - '', + '
' + + '
%s
' + + '
%s
' + + '
%s
' + + '
', route.interface, route.metric, route.color, route.etx || '?' ); } @@ -96,27 +96,27 @@ XHR.poll(20, '<%=REQUEST_URI%>', { status: 1 },
<%:Overview of currently known routes to other OLSR nodes%> - - - - - - - - - - +
+
+
+
<%:Announced network%>
+
<%:OLSR gateway%>
+
<%:Interface%>
+
<%:Metric%>
+
ETX
+
+
-
+
<% for k, route in ipairs(routes) do ETX = tonumber(route.rtpMetricCost)/1024 or '0' color = olsrtools.etx_color(ETX) %> -
- - - - - - + +
<%=route.networkInterface%>
+
<%=route.metric%>
+
<%=string.format("%.3f", ETX)%>
+ <% i = ((i % 2) + 1) end %> - -
<%:Announced network%><%:OLSR gateway%><%:Interface%><%:Metric%>ETX
<%=route.destination%>/<%=route.genmask%> +
+
<%=route.destination%>/<%=route.genmask%>
+
<% if route.proto == '6' then %> <%=route.gateway%> <% else %> @@ -125,16 +125,16 @@ XHR.poll(20, '<%=REQUEST_URI%>', { status: 1 }, <% if route.hostname then %> / <%=route.hostname%> <% end %> -
<%=route.networkInterface%><%=route.metric%><%=string.format("%.3f", ETX)%>
+ + <%+status-olsr/legend%>
diff --git a/applications/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm b/applications/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm index 6aa7a75461..7ca66816ae 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm @@ -56,7 +56,7 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 }, for (var idx = 0; idx < info.length; idx++) { var smartgw = info[idx]; - s += '' + s += '
' if (smartgw.proto == '6') { linkgw = '' + smartgw.ipAddress + '' } else { @@ -64,18 +64,18 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 }, } s += String.format( - '%s' + - '%s' + - '%s' + - '%s' + - '%s' + - '%s' + - '%s' + - '%s' + - '%s', + '
%s
' + + '
%s
' + + '
%s
' + + '
%s
' + + '
%s
' + + '
%s
' + + '
%s
' + + '
%s
' + + '
%s
', linkgw, smartgw.status, smartgw.tcPathCost, smartgw.hopCount, smartgw.uplinkSpeed, smartgw.downlinkSpeed, smartgw.v4, smartgw.v6, smartgw.externalPrefix ) - s += '' + s += '
' } smartgwdiv.innerHTML = s; } @@ -94,23 +94,23 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 },
<%:Overview of smart gateways in this network%> - - - - - - - - - - - - - - - - - +
+
+
+
<%:Gateway%>
+
<%:Status%>
+
<%:ETX%>
+
<%:Hops%>
+
<%:Uplink%>
+
<%:Downlink%>
+
<%:IPv4%>
+
<%:IPv6%>
+
<%:Prefix%>
+ +
+
+ +
<% for k, gw in ipairs(gws) do gw.tcPathCost = tonumber(gw.tcPathCost)/1024 or 0 @@ -119,27 +119,27 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 }, end %> -
+
<% if gw.proto == '6' then %> -
+ <% else %> - + <% end %> - - - - - - - - - +
<%=gw.ipv4Status or gw.ipv6Status or '-' %>
+
<%=string.format("%.3f", gw.tcPathCost)%>
+
<%=gw.hopCount%>
+
<%=gw.uplinkSpeed%>
+
<%=gw.downlinkSpeed%>
+
<%=gw.ipv4 and luci.i18n.translate('yes') or luci.i18n.translate('no')%>
+
<%=gw.ipv6 and luci.i18n.translate('yes') or luci.i18n.translate('no')%>
+
<%=gw.externalPrefix%>
+ <% i = ((i % 2) + 1) end %> - -
<%:Gateway%><%:Status%><%:ETX%><%:Hops%><%:Uplink%><%:Downlink%><%:IPv4%><%:IPv6%><%:Prefix%>
<%=gw.ipAddress%><%=gw.ipAddress%><%=gw.ipv4Status or gw.ipv6Status or '-' %><%=string.format("%.3f", gw.tcPathCost)%><%=gw.hopCount%><%=gw.uplinkSpeed%><%=gw.downlinkSpeed%><%=gw.ipv4 and luci.i18n.translate('yes') or luci.i18n.translate('no')%><%=gw.ipv6 and luci.i18n.translate('yes') or luci.i18n.translate('no')%><%=gw.externalPrefix%>
+ +
<% else %> diff --git a/applications/luci-app-olsr/luasrc/view/status-olsr/topology.htm b/applications/luci-app-olsr/luasrc/view/status-olsr/topology.htm index b3abeaecbe..02fdfddac3 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/topology.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/topology.htm @@ -17,14 +17,14 @@ local olsrtools = require "luci.tools.olsr"
<%:Overview of currently known OLSR nodes%> - - - - - - - - +
+
+
<%:OLSR node%>
+
<%:Last hop%>
+
<%:LQ%>
+
<%:NLQ%>
+
<%:ETX%>
+
<% for k, route in ipairs(routes) do local cost = string.format("%.3f", tonumber(route.tcEdgeCost/1024) or 0) @@ -33,28 +33,28 @@ local olsrtools = require "luci.tools.olsr" local nlq = string.format("%.3f", tonumber(route.neighborLinkQuality) or 0) %> -
+
<% if route.proto == "6" then %> -
- + + <% else %> - - + + <%end%> - - - - +
<%=lq%>
+
<%=nlq%>
+
<%=cost%>
+ <% i = ((i % 2) + 1) end %> -
<%:OLSR node%><%:Last hop%><%:LQ%><%:NLQ%><%:ETX%>
<%=route.destinationIP%><%=route.lastHopIP%><%=route.destinationIP%><%=route.lastHopIP%><%=lq%><%=nlq%><%=cost%>
+ <%+status-olsr/legend%>
-- cgit v1.2.3