modules/admin-full: use %m format in interface overview
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 13 Mar 2011 11:13:52 +0000 (11:13 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 13 Mar 2011 11:13:52 +0000 (11:13 +0000)
modules/admin-full/luasrc/view/admin_network/iface_overview.htm

index 8df2de0ef86ede436505e478da28e8c464cd622c..92376207a49ebb8a63eca70255072d3b72bcd207 100644 (file)
@@ -76,8 +76,8 @@ $Id$
                                        {
                                                var ifc = ifcs[i];
                                                var is_up = (ifc.flags && ifc.flags.up);
-                                               var rxb = ifc.stats ? (ifc.stats["rx_bytes"] / 1024) : 0;
-                                               var txb = ifc.stats ? (ifc.stats["tx_bytes"] / 1024) : 0;
+                                               var rxb = ifc.stats ? ifc.stats["rx_bytes"] : 0;
+                                               var txb = ifc.stats ? ifc.stats["tx_bytes"] : 0;
                                                var rxp = ifc.stats ? ifc.stats["rx_packets"] : 0;
                                                var txp = ifc.stats ? ifc.stats["tx_packets"] : 0;
                                                var mac = ifc.macaddr ? ifc.macaddr : '00:00:00:00:00:00';
@@ -168,8 +168,8 @@ $Id$
                                                if (t)
                                                {
                                                        t.innerHTML = String.format(
-                                                               '<strong><%:RX%></strong>: %.2f <%:KB%> (%d <%:Pkts.%>)<br />' +
-                                                               '<strong><%:TX%></strong>: %.2f <%:KB%> (%d <%:Pkts.%>)<br />',
+                                                               '<strong><%:RX%></strong>: %1024.2mB (%d <%:Pkts.%>)<br />' +
+                                                               '<strong><%:TX%></strong>: %1024.2mB (%d <%:Pkts.%>)<br />',
                                                                        rxb, rxp, txb, txp
                                                        );
                                                }