From 7387553a042c9357081e4baaa2141ce2d1964ecb Mon Sep 17 00:00:00 2001 From: pmelange Date: Thu, 15 Nov 2018 14:55:42 +0100 Subject: luci-app-olsr: make cosmetic changes. modify the status tables so that then headers and columns align, values left justified. Additionally, add the openwrt style interface name to the interfaces table, change huge ETX numbers to 'infinate', and add the german translation for 'Selected'. Signed-off-by: pmelange --- .../luasrc/view/freifunk-services/services.htm | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'applications/luci-app-olsr-services/luasrc/view') diff --git a/applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm b/applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm index 91624f3b30..d1fdb22852 100644 --- a/applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm +++ b/applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm @@ -132,9 +132,9 @@ end var service = info[idx]; s += String.format( '
' + - '' + - '
%s
' + - '' + + '' + + '
%s
' + + '' + '
', service.url, service.descr, service.proto, service.origin_link, service.origin || '?' ); @@ -153,15 +153,12 @@ end
<%:Internal services%>
-
<%:Url%>
<%:Protocol%>
<%:Source%>
-
-
<% for k, line in ipairs(services) do local field = {} @@ -178,13 +175,12 @@ end %>
- -
<%=proto%>
- + +
<%=proto%>
+
<% i = ((i % 2) + 1) end %> -

<%=last_update%> -- cgit v1.2.3 From 4974ddb1f1d2e9d8870f6b907876c39a55a436a1 Mon Sep 17 00:00:00 2001 From: pmelange Date: Sat, 17 Nov 2018 23:40:37 +0100 Subject: luci-app-olsr change ccs style to use class "left" instead of "style=text-align: left" Signed-off-by: pmelange --- .../luasrc/view/freifunk-services/services.htm | 12 +++---- .../luci-app-olsr/luasrc/view/status-olsr/hna.htm | 12 +++---- .../luasrc/view/status-olsr/interfaces.htm | 16 ++++----- .../luci-app-olsr/luasrc/view/status-olsr/mid.htm | 4 +-- .../luasrc/view/status-olsr/neighbors.htm | 38 +++++++++++----------- .../luasrc/view/status-olsr/routes.htm | 20 ++++++------ .../luasrc/view/status-olsr/smartgw.htm | 38 +++++++++++----------- .../luasrc/view/status-olsr/topology.htm | 14 ++++---- 8 files changed, 77 insertions(+), 77 deletions(-) (limited to 'applications/luci-app-olsr-services/luasrc/view') diff --git a/applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm b/applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm index d1fdb22852..f6a81d0020 100644 --- a/applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm +++ b/applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm @@ -132,9 +132,9 @@ end var service = info[idx]; s += String.format( '
' + - '' + - '
%s
' + - '' + + '' + + '
%s
' + + '' + '
', service.url, service.descr, service.proto, service.origin_link, service.origin || '?' ); @@ -175,9 +175,9 @@ end %>
- -
<%=proto%>
- + +
<%=proto%>
+
<% i = ((i % 2) + 1) end %> 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 29832f1350..85cdc5f479 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/hna.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/hna.htm @@ -62,9 +62,9 @@ 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 += '' } @@ -90,8 +90,8 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 }, <% for k, route in ipairs(hna) do %>
-
<%=hna[k].destination%>/<%=hna[k].genmask%>
-
+
<%=hna[k].destination%>/<%=hna[k].genmask%>
+
<% if hna[k].proto == '6' then %> <%=hna[k].gateway%> <% else %> @@ -107,7 +107,7 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 }, validity = '-' end %> -
<%=validity%>
+
<%=validity%>
<% i = ((i % 2) + 1) 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 639dbc23e9..12f7cba967 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/interfaces.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/interfaces.htm @@ -33,14 +33,14 @@ local i = 1 <% for k, iface in ipairs(iface) do %>
-
<%=iface.interface%>
-
<%=iface.name%>
-
<%=iface.olsrInterface.up and luci.i18n.translate('up') or luci.i18n.translate('down')%>
-
<%=iface.olsrInterface.mtu%>
-
<%=iface.olsrInterface.wireless and luci.i18n.translate('yes') or luci.i18n.translate('no')%>
-
<%=iface.olsrInterface.ipAddress%>
-
<%=iface.olsrInterface.ipv4Address ~= '0.0.0.0' and iface.olsrInterface.ipv4Netmask%>
-
<%=iface.olsrInterface.ipv4Address ~= '0.0.0.0' and iface.olsrInterface.ipv4Broadcast or iface.olsrInterface.ipv6Multicast%>
+
<%=iface.interface%>
+
<%=iface.name%>
+
<%=iface.olsrInterface.up and luci.i18n.translate('up') or luci.i18n.translate('down')%>
+
<%=iface.olsrInterface.mtu%>
+
<%=iface.olsrInterface.wireless and luci.i18n.translate('yes') or luci.i18n.translate('no')%>
+
<%=iface.olsrInterface.ipAddress%>
+
<%=iface.olsrInterface.ipv4Address ~= '0.0.0.0' and iface.olsrInterface.ipv4Netmask%>
+
<%=iface.olsrInterface.ipv4Address ~= '0.0.0.0' and iface.olsrInterface.ipv4Broadcast or iface.olsrInterface.ipv6Multicast%>
<% i = ((i % 2) + 1) end %> 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 705b905e90..469d89111a 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/mid.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/mid.htm @@ -38,8 +38,8 @@ local i = 1 %>
- -
<%=aliases%>
+ +
<%=aliases%>
<% i = ((i % 2) + 1) 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 4432cb5416..262326b490 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/neighbors.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/neighbors.htm @@ -64,34 +64,34 @@ end if (neigh.proto == '6') { s += String.format( '
' + - '', + '', neigh.proto, neigh.dfgcolor, neigh.rip, neigh.rip ); } else { s += String.format( '
' + - '', + '', neigh.proto, neigh.dfgcolor, neigh.rip, neigh.rip ); } if (neigh.hn) { s += String.format( - '', + '', 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 || '?' ); @@ -145,17 +145,17 @@ 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%>
+ +
<%=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) 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 a03bd5ad27..ba738c016d 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/routes.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/routes.htm @@ -50,8 +50,8 @@ XHR.poll(20, '<%=REQUEST_URI%>', { status: 1 }, s += String.format( '
' + - '
%s/%s
' + - '
' + + '
%s/%s
' + + '
' + '%s', route.proto, route.dest, route.genmask, route.gw, route.gw ) @@ -72,9 +72,9 @@ XHR.poll(20, '<%=REQUEST_URI%>', { status: 1 }, } s += String.format( '
' + - '
%s
' + - '
%s
' + - '
%s
' + + '
%s
' + + '
%s
' + + '
%s
' + '
', route.interface, route.metric, route.color, route.etx || '?' ); @@ -110,8 +110,8 @@ XHR.poll(20, '<%=REQUEST_URI%>', { status: 1 }, %>
-
<%=route.destination%>/<%=route.genmask%>
-
+
<%=route.destination%>/<%=route.genmask%>
+
<% if route.proto == '6' then %> <%=route.gateway%> <% else %> @@ -121,9 +121,9 @@ XHR.poll(20, '<%=REQUEST_URI%>', { status: 1 }, / <%=route.hostname%> <% end %>
-
<%=route.networkInterface%>
-
<%=route.metric%>
-
<%=string.format("%.3f", ETX)%>
+
<%=route.networkInterface%>
+
<%=route.metric%>
+
<%=string.format("%.3f", ETX)%>
<% i = ((i % 2) + 1) 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 56dd868381..fc86e17d9c 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm @@ -64,15 +64,15 @@ 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.selected, smartgw.cost, smartgw.hops, smartgw.uplink, smartgw.downlink, smartgw.v4, smartgw.v6, smartgw.prefix ) s += '
' @@ -115,19 +115,19 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 },
<% if gw.proto == '6' then %> - + <% else %> - + <% end %> -
<%=gw.selected and luci.i18n.translate('yes') or luci.i18n.translate('no')%>
-
<%=gw.cost > 0 and string.format("%.3f", gw.cost) or luci.i18n.translate('infinate')%>
-
<%=gw.hops%>
-
<%=gw.uplink%>
-
<%=gw.downlink%>
-
<%=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.prefix%>
+
<%=gw.selected and luci.i18n.translate('yes') or luci.i18n.translate('no')%>
+
<%=gw.cost > 0 and string.format("%.3f", gw.cost) or luci.i18n.translate('infinate')%>
+
<%=gw.hops%>
+
<%=gw.uplink%>
+
<%=gw.downlink%>
+
<%=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.prefix%>
<% i = ((i % 2) + 1) 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 70b3d99854..fe673c4111 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/topology.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/topology.htm @@ -37,19 +37,19 @@ local olsrtools = require "luci.tools.olsr" <% if route.proto == "6" then %> - - + + <% else %> - - + + <%end%> -
<%=lq%>
-
<%=nlq%>
-
<%=cost%>
+
<%=lq%>
+
<%=nlq%>
+
<%=cost%>
<% i = ((i % 2) + 1) -- cgit v1.2.3 From d2bda6c34bada854893ddf935ed3794cfab2579b Mon Sep 17 00:00:00 2001 From: pmelange Date: Sun, 18 Nov 2018 14:26:23 +0100 Subject: luci-app-olsr: reenable the "auto refresh" feature Signed-off-by: pmelange --- .../luasrc/view/freifunk-services/services.htm | 9 +++++++-- .../luci-app-olsr/luasrc/view/status-olsr/hna.htm | 9 +++++++-- .../luci-app-olsr/luasrc/view/status-olsr/neighbors.htm | 16 +++++++++++++--- .../luci-app-olsr/luasrc/view/status-olsr/routes.htm | 17 ++++++++++++----- .../luci-app-olsr/luasrc/view/status-olsr/smartgw.htm | 16 +++++++++++++--- 5 files changed, 52 insertions(+), 15 deletions(-) (limited to 'applications/luci-app-olsr-services/luasrc/view') diff --git a/applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm b/applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm index f6a81d0020..0aac36de87 100644 --- a/applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm +++ b/applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm @@ -126,7 +126,12 @@ end var tbody = document.getElementById('olsr_services'); if (tbody) { - var s = ''; + var s = '
' + + '
<%:Url%>
' + + '
<%:Protocol%>
' + + '
<%:Source%>
' + + '
'; + for (var idx = 0; idx < info.length; idx++) { var service = info[idx]; @@ -152,7 +157,7 @@ end
<%:Internal services%> -
+
<%:Url%>
<%:Protocol%>
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 85cdc5f479..34cf563363 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/hna.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/hna.htm @@ -35,7 +35,12 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 }, var hnadiv = document.getElementById('olsrd_hna'); if (hnadiv) { - var s = ''; + var s = '
' + + '
<%:Announced network%>
' + + '
<%:OLSR gateway%>
' + + '
<%:Validity Time%>
' + + '
'; + for (var idx = 0; idx < info.length; idx++) { var hna = info[idx]; @@ -80,7 +85,7 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 },
<%:Overview of currently active OLSR host net announcements%> -
+
<%:Announced network%>
<%:OLSR gateway%>
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 262326b490..8cdda14916 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/neighbors.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/neighbors.htm @@ -56,7 +56,17 @@ end var nt = document.getElementById('olsr_neigh_table'); if (nt) { - var s = ''; + var s = '
' + + '
<%:Neighbour IP%>
' + + '
<%:Hostname%>
' + + '
<%:Interface%>
' + + '
<%:Local interface IP%>
' + + '
LQ
' + + '
NLQ
' + + '
ETX
' + + '
SNR
' + + '
'; + for (var idx = 0; idx < info.length; idx++) { var neigh = info[idx]; @@ -91,7 +101,7 @@ end '
%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 || '?' ); @@ -111,7 +121,7 @@ end
<%:Overview of currently established OLSR connections%> -
+
<%:Neighbour IP%>
<%:Hostname%>
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 ba738c016d..624047f40c 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/routes.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/routes.htm @@ -13,7 +13,7 @@ local i = 1 if luci.http.formvalue("status") == "1" then local rv = {} for k, route in ipairs(routes) do - local ETX = string.format("%.3f", tonumber(route.rtpMetricCost)/1024 or 0) + local ETX = string.format("%.3f", tonumber(route.etx) or 0) rv[#rv+1] = { hostname = route.hostname, dest = route.destination, @@ -43,7 +43,14 @@ XHR.poll(20, '<%=REQUEST_URI%>', { status: 1 }, var rt = document.getElementById('olsrd_routes'); if (rt) { - var s = ''; + var s = '
' + + '
<%:Announced network%>
' + + '
<%:OLSR gateway%>
' + + '
<%:Interface%>
' + + '
<%:Metric%>
' + + '
ETX
' + + '
'; + for (var idx = 0; idx < info.length; idx++) { var route = info[idx]; @@ -57,7 +64,7 @@ XHR.poll(20, '<%=REQUEST_URI%>', { status: 1 }, ) if (route.hostname) { - if (hna.proto == '6') { + if (route.proto == '6') { s += String.format( ' / %s', route.hostname, route.hostname || '?' @@ -95,8 +102,8 @@ XHR.poll(20, '<%=REQUEST_URI%>', { status: 1 },
<%:Overview of currently known routes to other OLSR nodes%> -
-
+
+
<%:Announced network%>
<%:OLSR gateway%>
<%:Interface%>
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 fc86e17d9c..8cd2088e42 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm @@ -51,7 +51,18 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 }, var smartgwdiv = document.getElementById('olsrd_smartgw'); if (smartgwdiv) { - var s = ''; + var s = '
' + + '
<%:Gateway%>
' + + '
<%:Selected%>
' + + '
<%:ETX%>
' + + '
<%:Hops%>
' + + '
<%:Uplink%>
' + + '
<%:Downlink%>
' + + '
<%:IPv4%>
' + + '
<%:IPv6%>
' + + '
<%:Prefix%>
' + + '
'; + for (var idx = 0; idx < info.length; idx++) { var smartgw = info[idx]; @@ -91,7 +102,7 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 },
<%:Overview of smart gateways in this network%> -
+
<%:Gateway%>
<%:Selected%>
@@ -102,7 +113,6 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 },
<%:IPv4%>
<%:IPv6%>
<%:Prefix%>
-
<% for k, gw in ipairs(gws.ipv4, gws.ipv6) do -- cgit v1.2.3