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/status-olsr/smartgw.htm | 53 ++++++++++------------ 1 file changed, 23 insertions(+), 30 deletions(-) (limited to 'applications/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm') 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 ba36ce980a..56dd868381 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm @@ -19,7 +19,7 @@ if luci.http.formvalue("status") == "1" then local rv = {} for k, gw in ipairs(gws.ipv4, gws.ipv6) do gw.cost = tonumber(gw.cost)/1024 or 0 - if gw.cost == 4096 then + if gw.cost >= 100 then gw.cost = 0 end @@ -27,7 +27,7 @@ if luci.http.formvalue("status") == "1" then proto = gw.IPv4 and '4' or '6', originator = gw.originator, selected = gw.selected and luci.i18n.translate('yes') or luci.i18n.translate('no'), - cost = string.format("%.3f", gw.cost), + cost = gw.cost > 0 and string.format("%.3f", gw.cost) or luci.i18n.translate('infinate'), hops = gw.hops, uplink = gw.uplink, downlink = gw.downlink, @@ -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 += '' @@ -83,9 +83,6 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 }, ); //]]> - -<%+header%> -

<%:SmartGW announcements%>

@@ -95,7 +92,6 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 },
<%:Overview of smart gateways in this network%>
-
<%:Gateway%>
<%:Selected%>
@@ -108,37 +104,34 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 },
<%:Prefix%>
-
-
- <% for k, gw in ipairs(gws) do + <% for k, gw in ipairs(gws.ipv4, gws.ipv6) do gw.cost = tonumber(gw.cost)/1024 or 0 - if gw.cost == 4096 then + if gw.cost >= 100 then gw.cost = 0 end %>
<% if gw.proto == '6' then %> - + <% else %> - + <% end %> -
<%=gw.selected and luci.i18n.translate('yes') or luci.i18n.translate('no')%>
-
<%=string.format("%.3f", gw.cost)%>
-
<%=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) end %> -
-- cgit v1.2.3