Merge pull request #2347 from shunjou/theme-material
authorJo-Philipp Wich <jo@mein.io>
Thu, 6 Dec 2018 23:10:59 +0000 (00:10 +0100)
committerGitHub <noreply@github.com>
Thu, 6 Dec 2018 23:10:59 +0000 (00:10 +0100)
luci-theme-material: partial style overhaul

17 files changed:
applications/luci-app-olsr-services/luasrc/view/freifunk-services/services.htm
applications/luci-app-olsr/luasrc/controller/olsr.lua
applications/luci-app-olsr/luasrc/view/status-olsr/hna.htm
applications/luci-app-olsr/luasrc/view/status-olsr/interfaces.htm
applications/luci-app-olsr/luasrc/view/status-olsr/mid.htm
applications/luci-app-olsr/luasrc/view/status-olsr/neighbors.htm
applications/luci-app-olsr/luasrc/view/status-olsr/routes.htm
applications/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm
applications/luci-app-olsr/luasrc/view/status-olsr/topology.htm
applications/luci-app-olsr/po/de/olsr.po
applications/luci-app-olsr/po/en/olsr.po
applications/luci-app-olsr/po/templates/olsr.pot
modules/luci-base/htdocs/luci-static/resources/cbi.js
modules/luci-mod-status/luasrc/controller/admin/status.lua
modules/luci-mod-system/luasrc/view/admin_system/sshkeys.htm
themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css
themes/luci-theme-openwrt/htdocs/luci-static/openwrt.org/cascade.css

index 91624f3b30fe0c853c2e3e8e17ab19af8926e42e..0aac36de87dc5ac18e44c7b289d0f442b3eb608f 100644 (file)
@@ -126,15 +126,20 @@ end
                var tbody = document.getElementById('olsr_services');
                        if (tbody)
                        {
-                               var s = '';
+                               var s = '<div class="tr cbi-section-table-titles">' +
+                               '<div class="th cbi-section-table-cell"><%:Url%></div>' +
+                               '<div class="th cbi-section-table-cell"><%:Protocol%></div>' +
+                               '<div class="th cbi-section-table-cell"><%:Source%></div>' +
+                               '</div>';
+
                                for (var idx = 0; idx < info.length; idx++)
                                {
                                var service = info[idx];
                                s += String.format(
                                        '<div class="tr cbi-section-table-row cbi-rowstyle-'+(1 + (idx % 2))+'">' +
-                                               '<div class="td cbi-section-table-titles"><a href="%s">%s</a></div>' +
-                                               '<div class="td cbi-section-table-titles">%s</div>' +
-                                               '<div class="td cbi-section-table-titles"><a href="http://%s/cgi-bin-status.html">%s</a></div>' +
+                                               '<div class="td cbi-section-table-cell left"><a href="%s">%s</a></div>' +
+                                               '<div class="td cbi-section-table-cell left">%s</div>' +
+                                               '<div class="td cbi-section-table-cell left"><a href="http://%s/cgi-bin-status.html">%s</a></div>' +
                                        '</div>',
                                        service.url, service.descr, service.proto, service.origin_link, service.origin || '?'
                                        );
@@ -152,16 +157,13 @@ end
 
        <fieldset class="cbi-section">
        <legend><%:Internal services%></legend>
-       <div class="table cbi-section-table">
-               <div class="thead">
+       <div class="table cbi-section-table" id="olsr_services">
                        <div class="tr cbi-section-table-titles">
                                <div class="th cbi-section-table-cell"><%:Url%></div>
                                <div class="th cbi-section-table-cell"><%:Protocol%></div>
                                <div class="th cbi-section-table-cell"><%:Source%></div>
                        </div>
-               </div>
 
-               <div class="tbody" id="olsr_services">
        <%
                for k, line in ipairs(services) do
                        local field = {}
@@ -178,13 +180,12 @@ end
                        %>
 
                        <div class="tr cbi-section-table-row cbi-rowstyle-<%=i%>">
-                               <div class="td cbi-section-table-titles"><a href="<%=url%>"><%=descr%></a></div>
-                               <div class="td cbi-section-table-titles"><%=proto%></div>
-                               <div class="td cbi-section-table-titles"><a href="http://<%=origin_link%>/cgi-bin-status.html"><%=origin%></a></div>
+                               <div class="td cbi-section-table-cell left"><a href="<%=url%>"><%=descr%></a></div>
+                               <div class="td cbi-section-table-cell left"><%=proto%></div>
+                               <div class="td cbi-section-table-cell left"><a href="http://<%=origin_link%>/cgi-bin-status.html"><%=origin%></a></div>
                        </div>
                        <% i = ((i % 2) + 1)
                end %>
-               </div>
        </div>
        <br />
        <%=last_update%>
index dc424c011462cefdb19a52878a6a39afbb4beb36..11e27d7c00e83e278236a6573812a9ca6b50f22f 100644 (file)
@@ -331,6 +331,8 @@ end
 
 function action_interfaces()
        local data, has_v4, has_v6, error = fetch_jsoninfo('interfaces')
+       local ntm = require "luci.model.network".init()
+
        if error then
                return
        end
@@ -339,6 +341,13 @@ function action_interfaces()
                return a.proto < b.proto
        end
 
+       for k, v in ipairs(data) do
+               local interface = ntm:get_status_by_address(v.olsrInterface.ipAddress)
+               if interface then
+                       v.interface = interface
+               end
+       end
+
        table.sort(data, compare)
        luci.template.render("status-olsr/interfaces", {iface=data, has_v4=has_v4, has_v6=has_v6})
 end
index f04d926918f0e556185c04c92342418addaee6f1..34cf5633631a25a220fca9dc2afd54607e329420 100644 (file)
@@ -35,7 +35,12 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 },
        var hnadiv = document.getElementById('olsrd_hna');
        if (hnadiv)
        {
-               var s = '';
+               var s = '<div class="tr cbi-section-table-titles">' +
+                       '<div class="th cbi-section-table-cell"><%:Announced network%></div>' +
+                       '<div class="th cbi-section-table-cell"><%:OLSR gateway%></div>' +
+                       '<div class="th cbi-section-table-cell"><%:Validity Time%></div>' +
+                       '</div>';
+
                for (var idx = 0; idx < info.length; idx++)
                {
                        var hna = info[idx];
@@ -62,9 +67,9 @@ 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>', hna.destination + '/' + hna.genmask, linkgw + hostname, validity
+                                '<div class="td cbi-section-table-cell left">%s</div>' +
+                                '<div class="td cbi-section-table-cell left">%s</div>' +
+                                '<div class="td cbi-section-table-cell left">%s</div>', hna.destination + '/' + hna.genmask, linkgw + hostname, validity
                                 )
                        s += '</div>'
                }
@@ -80,21 +85,18 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 },
 <fieldset class="cbi-section">
 
        <legend><%:Overview of currently active OLSR host net announcements%></legend>
-       <div class="table cbi-section-table">
-               <div class="thead">
+       <div class="table cbi-section-table" id="olsrd_hna">
                <div class="tr cbi-section-table-titles">
                        <div class="th cbi-section-table-cell"><%:Announced network%></div>
                        <div class="th cbi-section-table-cell"><%:OLSR gateway%></div>
                        <div class="th cbi-section-table-cell"><%:Validity Time%></div>
                </div>
 
-               </div>
-               <div class="tbody" id="olsrd_hna">
                <% for k, route in ipairs(hna) do %>
 
                <div class="tr cbi-section-table-row cbi-rowstyle-<%=i%> proto-<%=hna[k].proto%>">
-                       <div class="td cbi-section-table-cell"><%=hna[k].destination%>/<%=hna[k].genmask%> </div>
-                       <div class="td cbi-section-table-cell">
+                       <div class="td cbi-section-table-cell left"><%=hna[k].destination%>/<%=hna[k].genmask%> </div>
+                       <div class="td cbi-section-table-cell left">
                                <% if hna[k].proto == '6' then %>
                                <a href="http://[<%=hna[k].gateway%>]/cgi-bin-status.html"><%=hna[k].gateway%></a>
                                <% else %>
@@ -110,12 +112,11 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 },
                                validity = '-'
                        end %>
 
-                       <div class="td cbi-section-table-cell"><%=validity%></div>
+                       <div class="td cbi-section-table-cell left"><%=validity%></div>
                </div>
 
                <% i = ((i % 2) + 1)
                end %>
-               </div>
        </div>
 </fieldset>
 
index 7506f0702992b6e1a258a4ff74d104dfd4052ce4..12f7cba967ce181271610e23b2126002ae06ffab 100644 (file)
@@ -21,6 +21,7 @@ local i = 1
        <div class="table cbi-section-table">
                <div class="tr">
                        <div class="th cbi-section-table-cell"><%:Interface%></div>
+                       <div class="th cbi-section-table-cell"><%:Device%></div>
                        <div class="th cbi-section-table-cell"><%:State%></div>
                        <div class="th cbi-section-table-cell"><%:MTU%></div>
                        <div class="th cbi-section-table-cell"><%:WLAN%></div>
@@ -32,13 +33,14 @@ local i = 1
                <% for k, iface in ipairs(iface) do %>
 
                <div class="tr cbi-section-table-row cbi-rowstyle-<%=i%> proto-<%=iface.proto%>">
-                       <div class="td cbi-section-table-cell"><%=iface.name%></div>
-                       <div class="td cbi-section-table-cell"><%=iface.olsrInterface.up and luci.i18n.translate('up') or luci.i18n.translate('down')%></div>
-                       <div class="td cbi-section-table-cell"><%=iface.olsrInterface.mtu%></div>
-                       <div class="td cbi-section-table-cell"><%=iface.olsrInterface.wireless and luci.i18n.translate('yes') or luci.i18n.translate('no')%></div>
-                       <div class="td cbi-section-table-cell"><%=iface.olsrInterface.ipAddress%></div>
-                       <div class="td cbi-section-table-cell"><%=iface.olsrInterface.ipv4Address ~= '0.0.0.0' and iface.olsrInterface.ipv4Netmask%></div>
-                       <div class="td cbi-section-table-cell"><%=iface.olsrInterface.ipv4Address ~= '0.0.0.0' and iface.olsrInterface.ipv4Broadcast or iface.olsrInterface.ipv6Multicast%></div>
+                       <div class="td cbi-section-table-cell left"><%=iface.interface%></div>
+                       <div class="td cbi-section-table-cell left"><%=iface.name%></div>
+                       <div class="td cbi-section-table-cell left"><%=iface.olsrInterface.up and luci.i18n.translate('up') or luci.i18n.translate('down')%></div>
+                       <div class="td cbi-section-table-cell left"><%=iface.olsrInterface.mtu%></div>
+                       <div class="td cbi-section-table-cell left"><%=iface.olsrInterface.wireless and luci.i18n.translate('yes') or luci.i18n.translate('no')%></div>
+                       <div class="td cbi-section-table-cell left"><%=iface.olsrInterface.ipAddress%></div>
+                       <div class="td cbi-section-table-cell left"><%=iface.olsrInterface.ipv4Address ~= '0.0.0.0' and iface.olsrInterface.ipv4Netmask%></div>
+                       <div class="td cbi-section-table-cell left"><%=iface.olsrInterface.ipv4Address ~= '0.0.0.0' and iface.olsrInterface.ipv4Broadcast or iface.olsrInterface.ipv6Multicast%></div>
                </div>
                <% i = ((i % 2) + 1)
                end %>
index 9babd50a801e5919f789b09f6c38167705e307c6..469d89111aebc6a8c6ccfbc07c8fed7cfc92b153 100644 (file)
@@ -38,8 +38,8 @@ local i = 1
                %>
 
                <div class="tr cbi-section-table-row cbi-rowstyle-<%=i%> proto-<%=mid.proto%>">
-                       <div class="td cbi-section-table-cell"><a href="http://<%=host%>/cgi-bin-status.html"><%=mid.main.ipAddress%></a></div>
-                       <div class="td cbi-section-table-cell"><%=aliases%></div>
+                       <div class="td cbi-section-table-cell left"><a href="http://<%=host%>/cgi-bin-status.html"><%=mid.main.ipAddress%></a></div>
+                       <div class="td cbi-section-table-cell left"><%=aliases%></div>
                </div>
 
                <% i = ((i % 2) + 1)
index 29ea95694c3702d951c8d768698de5fbe389bb67..8cdda14916212b3e3293f14121d558299307c37c 100644 (file)
@@ -56,7 +56,17 @@ end
                var nt = document.getElementById('olsr_neigh_table');
                        if (nt)
                        {
-                               var s = '';
+                               var s = '<div class="tr cbi-section-table-cell">' +
+                               '<div class="th cbi-section-table-cell"><%:Neighbour IP%></div>' +
+                               '<div class="th cbi-section-table-cell"><%:Hostname%></div>' +
+                               '<div class="th cbi-section-table-cell"><%:Interface%></div>' +
+                               '<div class="th cbi-section-table-cell"><%:Local interface IP%></div>' +
+                               '<div class="th cbi-section-table-cell">LQ</div>' +
+                               '<div class="th cbi-section-table-cell">NLQ</div>' +
+                               '<div class="th cbi-section-table-cell">ETX</div>' +
+                               '<div class="th cbi-section-table-cell">SNR</div>' +
+                               '</div>';
+
                                for (var idx = 0; idx < info.length; idx++)
                                {
                                        var neigh = info[idx];
@@ -64,34 +74,34 @@ end
                                        if (neigh.proto == '6') {
                                                s += String.format(
                                                        '<div class="tr cbi-section-table-row cbi-rowstyle-'+(1 + (idx % 2))+' proto-%s">' +
-                                                       '<div class="td cbi-section-table-titles" style="background-color:%s"><a href="http://[%s]/cgi-bin-status.html">%s</a></div>',
+                                                       '<div class="td cbi-section-table-cell left" style="background-color:%s"><a href="http://[%s]/cgi-bin-status.html">%s</a></div>',
                                                        neigh.proto, neigh.dfgcolor, neigh.rip, neigh.rip
                                                );
                                        } else {
                                                s += String.format(
                                                        '<div class="tr cbi-section-table-row cbi-rowstyle-'+(1 + (idx % 2))+' proto-%s">' +
-                                                       '<div class="td cbi-section-table-titles" style="background-color:%s"><a href="http://%s/cgi-bin-status.html">%s</a></div>',
+                                                       '<div class="td cbi-section-table-cell left" style="background-color:%s"><a href="http://%s/cgi-bin-status.html">%s</a></div>',
                                                        neigh.proto, neigh.dfgcolor, neigh.rip, neigh.rip
                                                );
                                        }
                                        if (neigh.hn) {
                                                s += String.format(
-                                                       '<div class="td cbi-section-table-titles" style="background-color:%s"><a href="http://%s/cgi-bin-status.html">%s</a></div>',
+                                                       '<div class="td cbi-section-table-cell left" style="background-color:%s"><a href="http://%s/cgi-bin-status.html">%s</a></div>',
                                                        neigh.dfgcolor, neigh.hn, neigh.hn
                                                );
                                        } else {
                                                s += String.format(
-                                                       '<div class="td cbi-section-table-titles" style="background-color:%s">?</div>',
+                                                       '<div class="td cbi-section-table-cell left" style="background-color:%s">?</div>',
                                                        neigh.dfgcolor
                                                );
                                        }
                                        s += String.format(
-                                               '<div class="td cbi-section-table-titles" style="background-color:%s">%s</div>' +
-                                               '<div class="td cbi-section-table-titles" style="background-color:%s">%s</div>' +
-                                               '<div class="td cbi-section-table-titles" style="background-color:%s">%s</div>' +
-                                               '<div class="td cbi-section-table-titles" style="background-color:%s">%s</div>' +
-                                               '<div class="td cbi-section-table-titles" style="background-color:%s">%s</div>' +
-                                               '<div class="td cbi-section-table-titles" style="background-color:%s" title="Signal: %s Noise: %s">%s</div>' +
+                                               '<div class="td cbi-section-table-cell left" style="background-color:%s">%s</div>' +
+                                               '<div class="td cbi-section-table-cell left" style="background-color:%s">%s</div>' +
+                                               '<div class="td cbi-section-table-cell left" style="background-color:%s">%s</div>' +
+                                               '<div class="td cbi-section-table-cell left" style="background-color:%s">%s</div>' +
+                                               '<div class="td cbi-section-table-cell left" style="background-color:%s">%s</div>' +
+                                               '<div class="td cbi-section-table-cell left" style="background-color:%s" title="Signal: %s Noise: %s">%s</div>' +
                                                '</div>',
                                                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,9 +121,8 @@ end
 <fieldset class="cbi-section">
        <legend><%:Overview of currently established OLSR connections%></legend>
 
-       <div class="table cbi-section-table">
-               <div class="thead">
-                       <div class="tr cbi-section-table-titles">
+       <div class="table cbi-section-table" id="olsr_neigh_table">
+                       <div class="tr cbi-section-table-cell">
                                <div class="th cbi-section-table-cell"><%:Neighbour IP%></div>
                                <div class="th cbi-section-table-cell"><%:Hostname%></div>
                                <div class="th cbi-section-table-cell"><%:Interface%></div>
@@ -123,9 +132,7 @@ end
                                <div class="th cbi-section-table-cell">ETX</div>
                                <div class="th cbi-section-table-cell">SNR</div>
                        </div>
-               </div>
        
-               <div class="tbody" id="olsr_neigh_table">
                <%      local i = 1
                        for k, link in ipairs(links) do
                        link.linkCost = tonumber(link.linkCost) or 0
@@ -148,22 +155,21 @@ end
 
                <div class="tr cbi-section-table-row cbi-rowstyle-<%=i%> proto-<%=link.proto%>">
                        <% if link.proto == "6" then %>
-                       <div class="td cbi-section-table-titles" style="background-color:<%=defaultgw_color%>"><a href="http://[<%=link.remoteIP%>]/cgi-bin-status.html"><%=link.remoteIP%></a></div>
+                       <div class="td cbi-section-table-cell left" style="background-color:<%=defaultgw_color%>"><a href="http://[<%=link.remoteIP%>]/cgi-bin-status.html"><%=link.remoteIP%></a></div>
                        <% else %>
-                       <div class="td cbi-section-table-titles" style="background-color:<%=defaultgw_color%>"><a href="http://<%=link.remoteIP%>/cgi-bin-status.html"><%=link.remoteIP%></a></div>
+                       <div class="td cbi-section-table-cell left" style="background-color:<%=defaultgw_color%>"><a href="http://<%=link.remoteIP%>/cgi-bin-status.html"><%=link.remoteIP%></a></div>
                        <% end %>
-                       <div class="td cbi-section-table-titles" style="background-color:<%=defaultgw_color%>"><a href="http://<%=link.hostname%>/cgi-bin-status.html"><%=link.hostname%></a></div>
-                       <div class="td cbi-section-table-titles" style="background-color:<%=defaultgw_color%>"><%=link.interface%></div>
-                       <div class="td cbi-section-table-titles" style="background-color:<%=defaultgw_color%>"><%=link.localIP%></div>
-                       <div class="td cbi-section-table-titles" style="background-color:<%=defaultgw_color%>"><%=string.format("%.3f", link.linkQuality)%></div>
-                       <div class="td cbi-section-table-titles" style="background-color:<%=defaultgw_color%>"><%=string.format("%.3f", link.neighborLinkQuality)%></div>
-                       <div class="td cbi-section-table-titles" style="background-color:<%=color%>"><%=string.format("%.3f", link.linkCost)%></div>
-                       <div class="td cbi-section-table-titles" style="background-color:<%=snr_color%>" title="Signal: <%=link.signal%> Noise: <%=link.noise%>"><%=link.snr%></div>
+                       <div class="td cbi-section-table-cell left" style="background-color:<%=defaultgw_color%>"><a href="http://<%=link.hostname%>/cgi-bin-status.html"><%=link.hostname%></a></div>
+                       <div class="td cbi-section-table-cell left" style="background-color:<%=defaultgw_color%>"><%=link.interface%></div>
+                       <div class="td cbi-section-table-cell left" style="background-color:<%=defaultgw_color%>"><%=link.localIP%></div>
+                       <div class="td cbi-section-table-cell left" style="background-color:<%=defaultgw_color%>"><%=string.format("%.3f", link.linkQuality)%></div>
+                       <div class="td cbi-section-table-cell left" style="background-color:<%=defaultgw_color%>"><%=string.format("%.3f", link.neighborLinkQuality)%></div>
+                       <div class="td cbi-section-table-cell left" style="background-color:<%=color%>"><%=string.format("%.3f", link.linkCost)%></div>
+                       <div class="td cbi-section-table-cell left" style="background-color:<%=snr_color%>" title="Signal: <%=link.signal%> Noise: <%=link.noise%>"><%=link.snr%></div>
                </div>
                <% 
                        i = ((i % 2) + 1)
                end %>
-               </div>
        </div>
 <br />
 
index 4b733524a5b9d05d40de02565ab9719428b40ae5..624047f40c8dcac4a3a86ea7cd5b5a5b495743c1 100644 (file)
@@ -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,21 +43,28 @@ XHR.poll(20, '<%=REQUEST_URI%>', { status: 1 },
                var rt = document.getElementById('olsrd_routes');
                        if (rt)
                        {
-                               var s = '';
+                               var s = '<div class="tr cbi-section-table-cell">' +
+                               '<div class="th cbi-section-table-cell"><%:Announced network%></div>' +
+                               '<div class="th cbi-section-table-cell"><%:OLSR gateway%></div>' +
+                               '<div class="th cbi-section-table-cell"><%:Interface%></div>' +
+                               '<div class="th cbi-section-table-cell"><%:Metric%></div>' +
+                               '<div class="th cbi-section-table-cell">ETX</div>' +
+                               '</div>';
+
                                for (var idx = 0; idx < info.length; idx++)
                                {
                                        var route = info[idx];
 
                                        s += String.format(
                                                '<div class="tr cbi-section-table-row cbi-rowstyle-'+(1 + (idx % 2))+' proto-%s">' +
-                                                       '<div class="td cbi-section-table-cell">%s/%s</div>' +
-                                                       '<div class="td cbi-section-table-cell">' +
+                                                       '<div class="td cbi-section-table-cell left">%s/%s</div>' +
+                                                       '<div class="td cbi-section-table-cell left">' +
                                                                '<a href="http://%s/cgi-bin-status.html">%s</a>',
                                                                route.proto, route.dest, route.genmask, route.gw, route.gw
                                                )
 
                                        if (route.hostname) {
-                                               if (hna.proto == '6') {
+                                               if (route.proto == '6') {
                                                        s += String.format(
                                                                ' / <a href="http://[%s]/cgi-bin-status.html">%s</a>',
                                                                route.hostname, route.hostname || '?'
@@ -72,9 +79,9 @@ XHR.poll(20, '<%=REQUEST_URI%>', { status: 1 },
                                        }
                                        s += String.format(
                                                        '</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="background-color:%s">%s</div>' +
+                                                       '<div class="td cbi-section-table-cell left">%s</div>' +
+                                                       '<div class="td cbi-section-table-cell left">%s</div>' +
+                                                       '<div class="td cbi-section-table-cell left" style="background-color:%s">%s</div>' +
                                                '</div>',
                                                route.interface, route.metric, route.color, route.etx || '?'
                                        );
@@ -95,27 +102,23 @@ XHR.poll(20, '<%=REQUEST_URI%>', { status: 1 },
 <fieldset class="cbi-section">
 <legend><%:Overview of currently known routes to other OLSR nodes%></legend>
 
-<div class="table cbi-section-table">
-       <div class="thead">
-               <div class="tr cbi-section-table-titles">
+<div class="table cbi-section-table" id="olsrd_routes">
+               <div class="tr cbi-section-table-cell">
                        <div class="th cbi-section-table-cell"><%:Announced network%></div>
                        <div class="th cbi-section-table-cell"><%:OLSR gateway%></div>
                        <div class="th cbi-section-table-cell"><%:Interface%></div>
                        <div class="th cbi-section-table-cell"><%:Metric%></div>
                        <div class="th cbi-section-table-cell">ETX</div>
                </div>
-       </div>
-
-       <div class="tbody" id="olsrd_routes">
 
        <% for k, route in ipairs(routes) do
-               ETX = tonumber(route.rtpMetricCost)/1024 or '0'
+               ETX = tonumber(route.etx) or '0'
                color = olsrtools.etx_color(ETX)
        %>
 
                <div class="tr cbi-section-table-row cbi-rowstyle-<%=i%> proto-<%=route.proto%>">
-                       <div class="td cbi-section-table-cell"><%=route.destination%>/<%=route.genmask%></div>
-                       <div class="td cbi-section-table-cell">
+                       <div class="td cbi-section-table-cell left"><%=route.destination%>/<%=route.genmask%></div>
+                       <div class="td cbi-section-table-cell left">
                                <% if route.proto == '6' then %>
                                <a href="http://[<%=route.gateway%>]/cgi-bin-status.html"><%=route.gateway%></a>
                                <% else  %>
@@ -125,14 +128,13 @@ XHR.poll(20, '<%=REQUEST_URI%>', { status: 1 },
                                        / <a href="http://<%=route.Hostname%>/cgi-bin-status.html"><%=route.hostname%></a>  
                                <% end %>
                        </div>
-                       <div class="td cbi-section-table-cell"><%=route.networkInterface%></div>
-                       <div class="td cbi-section-table-cell"><%=route.metric%></div>
-                       <div class="td cbi-section-table-cell" style="background-color:<%=color%>"><%=string.format("%.3f", ETX)%></div>
+                       <div class="td cbi-section-table-cell left"><%=route.networkInterface%></div>
+                       <div class="td cbi-section-table-cell left"><%=route.metric%></div>
+                       <div class="td cbi-section-table-cell left" style="background-color:<%=color%>"><%=string.format("%.3f", ETX)%></div>
                </div>
        <% 
                i = ((i % 2) + 1)
        end %>
-       </div>
 </div>
 
 <%+status-olsr/legend%>
index ba36ce980ac42fd85d579febb53b49c843066fc8..8cd2088e425985969cb3d897885f416c5b8518a3 100644 (file)
@@ -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,
@@ -51,7 +51,18 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 },
        var smartgwdiv = document.getElementById('olsrd_smartgw');
        if (smartgwdiv)
        {
-               var s = '';
+               var s = '<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>' +
+                       '<div class="th cbi-section-table-cell"><%:ETX%></div>' +
+                       '<div class="th cbi-section-table-cell"><%:Hops%></div>' +
+                       '<div class="th cbi-section-table-cell"><%:Uplink%></div>' +
+                       '<div class="th cbi-section-table-cell"><%:Downlink%></div>' +
+                       '<div class="th cbi-section-table-cell"><%:IPv4%></div>' +
+                       '<div class="th cbi-section-table-cell"><%:IPv6%></div>' +
+                       '<div class="th cbi-section-table-cell"><%:Prefix%></div>' +
+                       '</div>';
+
                for (var idx = 0; idx < info.length; idx++)
                {
                        var smartgw = info[idx];
@@ -64,15 +75,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 left">%s</div>' +
+                                '<div class="td cbi-section-table-cell left">%s</div>' +
+                                '<div class="td cbi-section-table-cell left">%s</div>' +
+                                '<div class="td cbi-section-table-cell left">%s</div>' +
+                                '<div class="td cbi-section-table-cell left">%s</div>' +
+                                '<div class="td cbi-section-table-cell left">%s</div>' +
+                                '<div class="td cbi-section-table-cell left">%s</div>' +
+                                '<div class="td cbi-section-table-cell left">%s</div>' +
+                                '<div class="td cbi-section-table-cell left">%s</div>',
                                linkgw, smartgw.selected, smartgw.cost, smartgw.hops, smartgw.uplink, smartgw.downlink, smartgw.v4, smartgw.v6, smartgw.prefix
                                 )
                        s += '</div>'
@@ -83,9 +94,6 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 },
 );
 //]]></script>
 
-
-<%+header%>
-
 <h2 name="content"><%:SmartGW announcements%></h2>
 
 <div id="togglebuttons"></div>
@@ -94,8 +102,7 @@ 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="table cbi-section-table" id="olsrd_smartgw">
                        <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>
@@ -106,39 +113,35 @@ XHR.poll(10, '<%=REQUEST_URI%>', { status: 1 },
                                <div class="th cbi-section-table-cell"><%:IPv4%></div>
                                <div class="th cbi-section-table-cell"><%:IPv6%></div>
                                <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 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 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 left"><%=gw.selected and luci.i18n.translate('yes') or luci.i18n.translate('no')%></div>
+                               <div class="td cbi-section-table-cell left"><%=gw.cost > 0 and string.format("%.3f", gw.cost) or luci.i18n.translate('infinate')%></div>
+                               <div class="td cbi-section-table-cell left"><%=gw.hops%></div>
+                               <div class="td cbi-section-table-cell left"><%=gw.uplink%></div>
+                               <div class="td cbi-section-table-cell left"><%=gw.downlink%></div>
+                               <div class="td cbi-section-table-cell left"><%=gw.IPv4 and luci.i18n.translate('yes') or luci.i18n.translate('no')%></div>
+                               <div class="td cbi-section-table-cell left"><%=gw.IPv6 and luci.i18n.translate('yes') or luci.i18n.translate('no')%></div>
+                               <div class="td cbi-section-table-cell left"><%=gw.prefix%></div>
                        </div>
 
                        <% i = ((i % 2) + 1)
                        end %>
-                       </div>
                </div>
        </fieldset>
 
index 02fdfddac33be7073f2b47262513703e8ccf2d69..fe673c41112ffc7aea22a7a339167740a56794bf 100644 (file)
@@ -27,7 +27,7 @@ local olsrtools = require "luci.tools.olsr"
                </div>
 
                <% for k, route in ipairs(routes) do 
-                       local cost = string.format("%.3f", tonumber(route.tcEdgeCost/1024) or 0)
+                       local cost = string.format("%.3f", tonumber(route.tcEdgeCost) or 0)
                        local color = olsrtools.etx_color(tonumber(cost))
                        local lq = string.format("%.3f", tonumber(route.linkQuality) or 0)
                        local nlq = string.format("%.3f", tonumber(route.neighborLinkQuality) or 0)
@@ -37,19 +37,19 @@ local olsrtools = require "luci.tools.olsr"
 
                        <% if route.proto == "6" then %>
 
-                       <div class="td cbi-section-table-cell"><a href="http://[<%=route.destinationIP%>]/cgi-bin-status.html"><%=route.destinationIP%></a></div>
-                       <div class="td cbi-section-table-cell"><a href="http://[<%=route.lastHopIP%>]/cgi-bin-status.html"><%=route.lastHopIP%></a></div>
+                       <div class="td cbi-section-table-cell left"><a href="http://[<%=route.destinationIP%>]/cgi-bin-status.html"><%=route.destinationIP%></a></div>
+                       <div class="td cbi-section-table-cell left"><a href="http://[<%=route.lastHopIP%>]/cgi-bin-status.html"><%=route.lastHopIP%></a></div>
 
                        <% else %>
 
-                       <div class="td cbi-section-table-cell"><a href="http://<%=route.destinationIP%>/cgi-bin-status.html"><%=route.destinationIP%></a></div>
-                       <div class="td cbi-section-table-cell"><a href="http://<%=route.lastHopIP%>/cgi-bin-status.html"><%=route.lastHopIP%></a></div>
+                       <div class="td cbi-section-table-cell left"><a href="http://<%=route.destinationIP%>/cgi-bin-status.html"><%=route.destinationIP%></a></div>
+                       <div class="td cbi-section-table-cell left"><a href="http://<%=route.lastHopIP%>/cgi-bin-status.html"><%=route.lastHopIP%></a></div>
 
                        <%end%>
 
-                       <div class="td cbi-section-table-cell"><%=lq%></div>
-                       <div class="td cbi-section-table-cell"><%=nlq%></div>
-                       <div class="td cbi-section-table-cell" style="background-color:<%=color%>"><%=cost%></div>
+                       <div class="td cbi-section-table-cell left"><%=lq%></div>
+                       <div class="td cbi-section-table-cell left"><%=nlq%></div>
+                       <div class="td cbi-section-table-cell left" style="background-color:<%=color%>"><%=cost%></div>
                </div>
 
                <%      i = ((i % 2) + 1)
index 2f387413ffd956bba475d35e5eb55de0b93752f8..15b8412a26e31c86a9896d4ceb5456617b74a1bd 100644 (file)
@@ -1201,6 +1201,10 @@ msgstr ""
 #~ msgid "Status"
 #~ msgstr "Status"
 
+#: application/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm:97
+msgid "Selected"
+msgstr "Ausgewählt"
+
 #~ msgid "Device"
 #~ msgstr "Schnittstelle"
 
index bd7ee6fcbfa46a4aa234db6eae2899d24710e2cc..a009f848549dcd5a8d17e9c968a63df2803fa592 100644 (file)
@@ -1088,6 +1088,10 @@ msgstr ""
 msgid "yes"
 msgstr ""
 
+#: application/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm:97
+msgid "Selected"
+msgstr ""
+
 #~ msgid ""
 #~ "Make sure that OLSRd is running, the \"txtinfo\" plugin is loaded, "
 #~ "configured on port 2006 and accepts connections from \"127.0.0.1\"."
index 49f5d63501ba9884a93dea79e8655d2aac4d6c37..521af613ed03841801bbe844fc6a7bad86654235 100644 (file)
@@ -1073,3 +1073,8 @@ msgstr ""
 #: applications/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm:135
 msgid "yes"
 msgstr ""
+
+#: application/luci-app-olsr/luasrc/view/status-olsr/smartgw.htm:97
+msgid "Selected"
+msgstr ""
+
index edf634ee742085d0696af884688c56585fb964de..635740a70c1a79203feb080de2114c7e5440e7e8 100644 (file)
@@ -2196,12 +2196,12 @@ function hideModal()
 document.addEventListener('DOMContentLoaded', function() {
        document.addEventListener('validation-failure', function(ev) {
                if (ev.target === document.activeElement)
-                       showTooltip(ev);
+                       L.showTooltip(ev);
        });
 
        document.addEventListener('validation-success', function(ev) {
                if (ev.target === document.activeElement)
-                       hideTooltip(ev);
+                       L.hideTooltip(ev);
        });
 
        document.querySelectorAll('.table').forEach(cbi_update_table);
index 5b496d83f2375e42e5808f1b9d78a9b94dd1908d..63b939077574796077b53cdf2bd41ad69da91f68 100644 (file)
@@ -53,7 +53,7 @@ function dump_iptables(family, table)
                for s in lines do
                        if s == table then
                                local ipt = io.popen(
-                                       "/usr/sbin/%stables -t %s --line-numbers -nxvL"
+                                       "/usr/sbin/%stables -w -t %s --line-numbers -nxvL"
                                        %{ prefix, table })
 
                                if ipt then
index e0917995e43454dde354f293125d9372180d9062..ac453f3f6c5056ee9525c6cbd86e3ac5c62f9ab2 100644 (file)
                white-space: nowrap;
                unicode-bidi: bidi-override;
        }
+
+       @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
+               .cbi-dynlist .item > small { direction: ltr }
+       }
 </style>
 
 <div class="cbi-map">
index 98f6022ca0b8aeb65e906177026f4d6138617690..3dfac338498bb055ff911aebc64e0c18de19a74a 100644 (file)
@@ -482,6 +482,7 @@ select,
        border-radius: 3px;
        position: relative;
        pointer-events: none;
+       word-break: break-all;
 }
 
 .cbi-dynlist > .item::after {
index f8133833e8c10d2bd3ee7c206506b18361e9403a..58065948f44f5a12e8e41bb37519c88344da7a14 100644 (file)
@@ -1242,9 +1242,7 @@ ul.cbi-tabmenu li.cbi-tab {
        border-radius: 3px;
        position: relative;
        pointer-events: none;
-       overflow: hidden;
-       text-overflow: ellipsis;
-       white-space: nowrap;
+       word-break: break-all;
 }
 
 .cbi-dynlist > .item::after {