diff options
author | pmelange <isprotejesvalkata@gmail.com> | 2018-11-15 14:55:42 +0100 |
---|---|---|
committer | pmelange <isprotejesvalkata@gmail.com> | 2018-12-06 20:57:35 +0100 |
commit | 7387553a042c9357081e4baaa2141ce2d1964ecb (patch) | |
tree | 1d44f28b3405c397c7dfd53f24017378690a4102 /applications/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm | |
parent | a92c94df32eaf9d0693eb799bfcf5bd7e92151b8 (diff) |
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 <isprotejesvalkata@gmail.com>
Diffstat (limited to 'applications/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm')
-rw-r--r-- | applications/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm | 53 |
1 files changed, 23 insertions, 30 deletions
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( - '<div class="td cbi-section-table-cell">%s</div>' + - '<div class="td cbi-section-table-cell">%s</div>' + - '<div class="td cbi-section-table-cell">%s</div>' + - '<div class="td cbi-section-table-cell">%s</div>' + - '<div class="td cbi-section-table-cell">%s</div>' + - '<div class="td cbi-section-table-cell">%s</div>' + - '<div class="td cbi-section-table-cell">%s</div>' + - '<div class="td cbi-section-table-cell">%s</div>' + - '<div class="td cbi-section-table-cell">%s</div>', + '<div class="td cbi-section-table-cell" style="text-align: left">%s</div>' + + '<div class="td cbi-section-table-cell" style="text-align: left">%s</div>' + + '<div class="td cbi-section-table-cell" style="text-align: left">%s</div>' + + '<div class="td cbi-section-table-cell" style="text-align: left">%s</div>' + + '<div class="td cbi-section-table-cell" style="text-align: left">%s</div>' + + '<div class="td cbi-section-table-cell" style="text-align: left">%s</div>' + + '<div class="td cbi-section-table-cell" style="text-align: left">%s</div>' + + '<div class="td cbi-section-table-cell" style="text-align: left">%s</div>' + + '<div class="td cbi-section-table-cell" style="text-align: left">%s</div>', linkgw, smartgw.selected, smartgw.cost, smartgw.hops, smartgw.uplink, smartgw.downlink, smartgw.v4, smartgw.v6, smartgw.prefix ) s += '</div>' @@ -83,9 +83,6 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 }, ); //]]></script> - -<%+header%> - <h2 name="content"><%:SmartGW announcements%></h2> <div id="togglebuttons"></div> @@ -95,7 +92,6 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 }, <fieldset class="cbi-section"> <legend><%:Overview of smart gateways in this network%></legend> <div class="table cbi-section-table"> - <div class="thead"> <div class="tr cbi-section-table-titles"> <div class="th cbi-section-table-cell"><%:Gateway%></div> <div class="th cbi-section-table-cell"><%:Selected%></div> @@ -108,37 +104,34 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 }, <div class="th cbi-section-table-cell"><%:Prefix%></div> </div> - </div> - <div class="tbody" id="olsrd_smartgw"> - <% 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 %> <div class="tr cbi-section-table-row cbi-rowstyle-<%=i%> proto-<%=proto%>"> <% if gw.proto == '6' then %> - <div class="td cbi-section-table-cell"><a href="http://[<%=gw.originator%>]/cgi-bin-status.html"><%=gw.originator%></a></div> + <div class="td cbi-section-table-cell" style="text-align: left"><a href="http://[<%=gw.originator%>]/cgi-bin-status.html"><%=gw.originator%></a></div> <% else %> - <div class="td cbi-section-table-cell"><a href="http://<%=gw.originator%>/cgi-bin-status.html"><%=gw.originator%></a></div> + <div class="td cbi-section-table-cell" style="text-align: left"><a href="http://<%=gw.originator%>/cgi-bin-status.html"><%=gw.originator%></a></div> <% end %> - <div class="td cbi-section-table-cell"><%=gw.selected and luci.i18n.translate('yes') or luci.i18n.translate('no')%></div> - <div class="td cbi-section-table-cell"><%=string.format("%.3f", gw.cost)%></div> - <div class="td cbi-section-table-cell"><%=gw.hops%></div> - <div class="td cbi-section-table-cell"><%=gw.uplink%></div> - <div class="td cbi-section-table-cell"><%=gw.downlink%></div> - <div class="td cbi-section-table-cell"><%=gw.IPv4 and luci.i18n.translate('yes') or luci.i18n.translate('no')%></div> - <div class="td cbi-section-table-cell"><%=gw.IPv6 and luci.i18n.translate('yes') or luci.i18n.translate('no')%></div> - <div class="td cbi-section-table-cell"><%=gw.prefix%></div> + <div class="td cbi-section-table-cell" style="text-align: left"><%=gw.selected and luci.i18n.translate('yes') or luci.i18n.translate('no')%></div> + <div class="td cbi-section-table-cell" style="text-align: left"><%=gw.cost > 0 and string.format("%.3f", gw.cost) or luci.i18n.translate('infinate')%></div> + <div class="td cbi-section-table-cell" style="text-align: left"><%=gw.hops%></div> + <div class="td cbi-section-table-cell" style="text-align: left"><%=gw.uplink%></div> + <div class="td cbi-section-table-cell" style="text-align: left"><%=gw.downlink%></div> + <div class="td cbi-section-table-cell" style="text-align: left"><%=gw.IPv4 and luci.i18n.translate('yes') or luci.i18n.translate('no')%></div> + <div class="td cbi-section-table-cell" style="text-align: left"><%=gw.IPv6 and luci.i18n.translate('yes') or luci.i18n.translate('no')%></div> + <div class="td cbi-section-table-cell" style="text-align: left"><%=gw.prefix%></div> </div> <% i = ((i % 2) + 1) end %> - </div> </div> </fieldset> |