Changeset 7547
- Timestamp:
- 09/24/11 04:14:48 (20 months ago)
- Location:
- luci/trunk/modules/admin-full/luasrc/view/admin_network
- Files:
-
- 2 modified
-
iface_overview.htm (modified) (3 diffs)
-
iface_status.htm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
luci/trunk/modules/admin-full/luasrc/view/admin_network/iface_overview.htm
r7545 r7547 78 78 { 79 79 var ifc = ifcs[i]; 80 var rxb = ifc.rx_bytes || 0;81 var txb = ifc.tx_bytes || 0;82 var rxp = ifc.rx_packets || 0;83 var txp = ifc.tx_packets || 0;84 var mac = ifc.macaddr;85 var upt = null;86 87 80 var html = ''; 88 89 var icon;90 if (ifc.is_up)91 {92 if (ifc.uptime)93 upt = String.format('%t', ifc.uptime);94 95 icon = "<%=resource%>/icons/%s.png";96 }97 else98 {99 icon = "<%=resource%>/icons/%s_disabled.png";100 }101 81 102 82 var s = document.getElementById(ifc.id + '-ifc-devices'); … … 139 119 if (d && ifc.ifname) 140 120 { 141 if ( upt)142 { 143 html += String.format('<strong><%:Uptime%>:</strong> % s<br />', upt);121 if (ifc.is_up) 122 { 123 html += String.format('<strong><%:Uptime%>:</strong> %t<br />', ifc.uptime); 144 124 } 145 125 146 126 if (ifc.type != 'tunnel') 147 127 { 148 html += String.format('<strong><%:MAC Address%>:</strong> %s<br />', mac);128 html += String.format('<strong><%:MAC Address%>:</strong> %s<br />', ifc.macaddr); 149 129 } 150 130 … … 152 132 '<strong><%:RX%></strong>: %.2mB (%d <%:Pkts.%>)<br />' + 153 133 '<strong><%:TX%></strong>: %.2mB (%d <%:Pkts.%>)<br />', 154 rxb, rxp, txb, txp 134 ifc.rx_bytes, ifc.rx_packets, 135 ifc.tx_bytes, ifc.tx_packets 155 136 ); 156 137 -
luci/trunk/modules/admin-full/luasrc/view/admin_network/iface_status.htm
r7545 r7547 5 5 6 6 function iface_shutdown(id, reconnect) { 7 if (!reconnect && !confirm(String.format('<%_Really shutdown network ?\nYou might lo ose access to this router if you are connected via this interface.%>', id)))7 if (!reconnect && !confirm(String.format('<%_Really shutdown network ?\nYou might lose access to this router if you are connected via this interface.%>', id))) 8 8 return; 9 9 … … 50 50 if (ifc && (ifc = ifc[0])) 51 51 { 52 var rxb = ifc.rx_bytes || 0;53 var txb = ifc.tx_bytes || 0;54 var rxp = ifc.rx_packets || 0;55 var txp = ifc.tx_packets || 0;56 var mac = ifc.macaddr;57 58 52 var html = ''; 59 var upt, icon;60 61 if (ifc.is_up)62 {63 if (ifc.uptime)64 upt = String.format('%t', ifc.uptime);65 66 icon = "<%=resource%>/icons/%s.png";67 }68 else69 {70 icon = "<%=resource%>/icons/%s_disabled.png";71 }72 53 73 54 var s = document.getElementById('<%=self.option%>-ifc-signal'); … … 81 62 82 63 var d = document.getElementById('<%=self.option%>-ifc-description'); 83 if (d && ifc.ifname && mac!= '00:00:00:00:00:00')64 if (d && ifc.ifname && ifc.macaddr != '00:00:00:00:00:00') 84 65 { 85 if ( upt)66 if (ifc.is_up) 86 67 { 87 html += String.format('<strong><%:Uptime%>:</strong> % s<br />', upt);68 html += String.format('<strong><%:Uptime%>:</strong> %t<br />', ifc.uptime); 88 69 } 89 70 90 71 if (ifc.type != 'tunnel') 91 72 { 92 html += String.format('<strong><%:MAC Address%>:</strong> %s<br />', mac);73 html += String.format('<strong><%:MAC Address%>:</strong> %s<br />', ifc.macaddr); 93 74 } 94 75 … … 96 77 '<strong><%:RX%></strong>: %.2mB (%d <%:Pkts.%>)<br />' + 97 78 '<strong><%:TX%></strong>: %.2mB (%d <%:Pkts.%>)<br />', 98 rxb, rxp, txb, txp 79 ifc.rx_bytes, ifc.rx_packets, 80 ifc.tx_bytes, ifc.tx_packets 99 81 ); 100 82
