Correctly handle speed = -1
authorStephen Fenwick <stephen@stephenfenwick.co.nz>
Tue, 18 Jun 2024 08:47:43 +0000 (20:47 +1200)
committerPaul Donald <newtwen+github@gmail.com>
Mon, 24 Jun 2024 12:20:08 +0000 (14:20 +0200)
modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js

index b5118979212c061cf00730ec9ddf61e148fbfbd0..3718d70ccff167ad57183866cb242840e447727a 100644 (file)
@@ -210,7 +210,7 @@ function buildInterfaceMapping(zones, networks) {
 }
 
 function formatSpeed(carrier, speed, duplex) {
-       if (speed && duplex) {
+       if ((speed > 0) && duplex) {
                var d = (duplex == 'half') ? '\u202f(H)' : '',
                    e = E('span', { 'title': _('Speed: %d Mibit/s, Duplex: %s').format(speed, duplex) });