luci-app-olsr: convert interfaces.htm to new json plugin
authorpmelange <isprotejesvalkata@gmail.com>
Mon, 5 Nov 2018 10:44:53 +0000 (11:44 +0100)
committerpmelange <isprotejesvalkata@gmail.com>
Wed, 7 Nov 2018 17:41:58 +0000 (18:41 +0100)
Signed-off-by: pmelange <isprotejesvalkata@gmail.com>
applications/luci-app-olsr/luasrc/view/status-olsr/interfaces.htm

index e3ccd0c23dc0a1b2038fe13d93f40d14be70570d..7506f0702992b6e1a258a4ff74d104dfd4052ce4 100644 (file)
@@ -33,12 +33,12 @@ local i = 1
 
                <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.state%></div>
-                       <div class="td cbi-section-table-cell"><%=iface.olsrMTU%></div>
-                       <div class="td cbi-section-table-cell"><%=iface.wireless and luci.i18n.translate('yes') or luci.i18n.translate('no')%></div>
-                       <div class="td cbi-section-table-cell"><%=iface.ipv4Address or iface.ipv6Address%></div>
-                       <div class="td cbi-section-table-cell"><%=iface.netmask%></div>
-                       <div class="td cbi-section-table-cell"><%=iface.broadcast or iface.multicast%></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>
                <% i = ((i % 2) + 1)
                end %>