diff options
Diffstat (limited to 'modules/luci-mod-status')
-rw-r--r-- | modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js index 9ea5555deb..ab1852323b 100644 --- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js +++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js @@ -209,7 +209,7 @@ function buildInterfaceMapping(zones, networks) { return portmap; } -function formatSpeed(speed, duplex) { +function formatSpeed(carrier, speed, duplex) { if (speed && duplex) { var d = (duplex == 'half') ? '\u202f(H)' : '', e = E('span', { 'title': _('Speed: %d Mibit/s, Duplex: %s').format(speed, duplex) }); @@ -229,7 +229,7 @@ function formatSpeed(speed, duplex) { return e; } - return _('no link'); + return carrier ? _('Connected') : _('no link'); } function formatStats(portdev) { @@ -352,15 +352,16 @@ return baseclass.extend({ return E('div', { 'style': 'display:grid;grid-template-columns:repeat(auto-fit, minmax(70px, 1fr));margin-bottom:1em' }, known_ports.map(function(port) { var speed = port.netdev.getSpeed(), duplex = port.netdev.getDuplex(), + carrier = port.netdev.getCarrier(), pmap = port_map[port.netdev.getName()], pzones = (pmap && pmap.zones.length) ? pmap.zones.sort(function(a, b) { return L.naturalCompare(a.getName(), b.getName()) }) : [ null ]; return E('div', { 'class': 'ifacebox', 'style': 'margin:.25em;min-width:70px;max-width:100px' }, [ E('div', { 'class': 'ifacebox-head', 'style': 'font-weight:bold' }, [ port.netdev.getName() ]), E('div', { 'class': 'ifacebox-body' }, [ - E('img', { 'src': L.resource('icons/port_%s.png').format((speed && duplex) ? 'up' : 'down') }), + E('img', { 'src': L.resource('icons/port_%s.png').format(carrier ? 'up' : 'down') }), E('br'), - formatSpeed(speed, duplex) + formatSpeed(carrier, speed, duplex) ]), E('div', { 'class': 'ifacebox-head cbi-tooltip-container', 'style': 'display:flex' }, [ E([], pzones.map(function(zone) { |