From 8de9b69b1a32e120b838caa284372e03765a0fdc Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 3 Nov 2019 18:12:28 +0100 Subject: [PATCH] luci-mod-status: 60_wifi.js: fix channel and bitrate display Signed-off-by: Jo-Philipp Wich --- .../resources/view/status/include/60_wifi.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js index 08a2f5de1..8242711b6 100644 --- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js +++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js @@ -3,10 +3,9 @@ 'require network'; function renderbox(radio) { - var net0 = radio.networks[0], - chan = net0 ? net0.getChannel() : null, - freq = net0 ? net0.getFrequency() : null, - rate = net0 ? net0.getBitRate() : null, + var chan = null, + freq = null, + rate = null, badges = []; for (var i = 0; i < radio.networks.length; i++) { @@ -42,6 +41,10 @@ function renderbox(radio) { badge.lastElementChild.style.textOverflow = 'ellipsis'; badges.push(badge); + + chan = (chan != null) ? chan : net.getChannel(); + freq = (freq != null) ? freq : net.getFrequency(); + rate = (rate != null) ? rate : net.getBitRate(); } return E('div', { class: 'ifacebox' }, [ -- 2.25.1