Changeset 6601

Show
Ignore:
Timestamp:
12/01/10 22:17:39 (2 years ago)
Author:
jow
Message:

modules/admin-full: add uptime to iface status templates

Location:
luci/trunk/modules/admin-full/luasrc/view/admin_network
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/modules/admin-full/luasrc/view/admin_network/iface_overview.htm

    r6508 r6601  
    8282                        var txp = ifc.stats ? ifc.stats["tx_packets"] : 0; 
    8383                        var mac = ifc.macaddr ? ifc.macaddr : '00:00:00:00:00:00'; 
     84                        var upt = '-'; 
    8485 
    8586                        var icon; 
    8687                        if (is_up) 
     88                        { 
     89                            if (ifc.uptime) 
     90                                upt = String.format('%t', ifc.uptime); 
     91 
    8792                            icon = "<%=resource%>/icons/ethernet.png"; 
     93                        } 
    8894                        else 
     95                        { 
    8996                            icon = "<%=resource%>/icons/ethernet_disabled.png"; 
     97                        } 
    9098 
    9199                        var s = document.getElementById(ifc.id + '-ifc-signal'); 
     
    97105                                    icon, ifc.ifname ? ifc.ifname : '?' 
    98106                            ); 
     107                        } 
     108 
     109                        var u = document.getElementById(ifc.id + '-ifc-uptime'); 
     110                        if (u) 
     111                        { 
     112                            u.innerHTML = upt; 
    99113                        } 
    100114 
     
    185199                <th class="cbi-section-table-cell">&nbsp;</th> 
    186200                <th class="cbi-section-table-cell"><%:Interface%></th> 
     201                <th class="cbi-section-table-cell"><%:Uptime%></th> 
    187202                <th class="cbi-section-table-cell"><%:MAC%></th> 
    188203                <th class="cbi-section-table-cell" style="text-align:left"><%:Addresses%></th> 
     
    199214                        <small>?</small> 
    200215                    </td> 
     216                    <td class="cbi-value-field" id="<%=net%>-ifc-uptime">?</td> 
    201217                    <td class="cbi-value-field" id="<%=net%>-ifc-mac">?</td> 
    202218                    <td class="cbi-value-field" style="text-align:left; padding:3px" id="<%=net%>-ifc-addrs"><em><%:Collecting data...%></em></td> 
  • luci/trunk/modules/admin-full/luasrc/view/admin_network/iface_status.htm

    r6496 r6601  
    1515                    var txp = ifc.stats ? ifc.stats["tx_packets"] : 0; 
    1616                    var mac = ifc.macaddr ? ifc.macaddr : '00:00:00:00:00:00'; 
     17                    var upt = '-'; 
    1718 
    1819                    var icon; 
    1920                    if (is_up) 
     21                    { 
     22                        if (ifc.uptime) 
     23                            upt = String.format('%t', ifc.uptime); 
     24 
    2025                        icon = "<%=resource%>/icons/ethernet.png"; 
     26                    } 
    2127                    else 
     28                    { 
    2229                        icon = "<%=resource%>/icons/ethernet_disabled.png"; 
     30                    } 
    2331 
    2432                    var s = document.getElementById('<%=self.option%>-ifc-signal'); 
     
    3341                    { 
    3442                        d.innerHTML = String.format( 
     43                            '<strong><%:Uptime%>:</strong> %s<br />' + 
    3544                            '<strong><%:MAC Address%>:</strong> %s<br />' + 
    3645                            '<strong><%:RX%></strong>: %.2f <%:KB%> (%d <%:Pkts.%>)<br />' + 
    3746                            '<strong><%:TX%></strong>: %.2f <%:KB%> (%d <%:Pkts.%>)<br />', 
    38                                 mac, rxb, rxp, txb, txp 
     47                                upt, mac, rxb, rxp, txb, txp 
    3948                        ); 
    4049