From 04c73f1613734b3f2a7204c24d7c9267d1b45955 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 24 Mar 2020 22:13:01 +0100 Subject: [PATCH] luci-mod-network, luci-mod-status: allow assoclist wrapping Signed-off-by: Jo-Philipp Wich (cherry picked from commit a600ebb5fe14b13cb53669eb73b86f66cc699e94) --- .../resources/view/network/wireless.js | 25 +++++++++++-------- .../resources/view/status/include/60_wifi.js | 20 +++++++-------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js index 767bab254..268287134 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js @@ -46,7 +46,7 @@ function render_signal_badge(signalPercent, signalValue, noiseValue, wrap) { icon = L.resource('icons/signal-75-100.png'); if (signalValue != null && signalValue != 0 && noiseValue != null && noiseValue != 0) { - value = '%d / %d %s'.format(signalValue, noiseValue, _('dBm')); + value = '%d/%d\xa0%s'.format(signalValue, noiseValue, _('dBm')); title = '%s: %d %s / %s: %d %s / %s %d'.format( _('Signal'), signalValue, _('dBm'), _('Noise'), noiseValue, _('dBm'), @@ -165,13 +165,16 @@ function render_modal_status(node, radioNet) { } function format_wifirate(rate) { - var s = '%.1f Mbit/s, %dMHz'.format(rate.rate / 1000, rate.mhz); - - if (rate.ht || rate.vht) { - if (rate.vht) s += ', VHT-MCS %d'.format(rate.mcs); - if (rate.nss) s += ', VHT-NSS %d'.format(rate.nss); - if (rate.ht) s += ', MCS %s'.format(rate.mcs); - if (rate.short_gi) s += ', Short GI'; + var s = '%.1f\xa0%s, %d\xa0%s'.format(rate.rate / 1000, _('Mbit/s'), rate.mhz, _('MHz')), + ht = rate.ht, vht = rate.vht, + mhz = rate.mhz, nss = rate.nss, + mcs = rate.mcs, sgi = rate.short_gi; + + if (ht || vht) { + if (vht) s += ', VHT-MCS\xa0%d'.format(mcs); + if (nss) s += ', VHT-NSS\xa0%d'.format(nss); + if (ht) s += ', MCS\xa0%s'.format(mcs); + if (sgi) s += ', ' + _('Short GI').replace(/ /g, '\xa0'); } return s; @@ -586,7 +589,7 @@ return L.view.extend({ if (bss.network.isClientDisconnectSupported()) { if (table.firstElementChild.childNodes.length < 6) - table.firstElementChild.appendChild(E('div', { 'class': 'th nowrap right'}, [ _('Disconnect') ])); + table.firstElementChild.appendChild(E('div', { 'class': 'th cbi-section-actions'})); row.push(E('button', { 'class': 'cbi-button cbi-button-remove', @@ -2164,8 +2167,8 @@ return L.view.extend({ E('div', { 'class': 'th nowrap' }, _('Network')), E('div', { 'class': 'th hide-xs' }, _('MAC-Address')), E('div', { 'class': 'th' }, _('Host')), - E('div', { 'class': 'th nowrap' }, _('Signal / Noise')), - E('div', { 'class': 'th nowrap' }, _('RX Rate / TX Rate')) + E('div', { 'class': 'th' }, _('Signal / Noise')), + E('div', { 'class': 'th' }, _('RX Rate / TX Rate')) ]) ]); 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 0d7d4f4a8..5eff56153 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 @@ -58,16 +58,16 @@ function renderbox(radio, networks) { } function wifirate(rt) { - var s = '%.1f %s, %d%s'.format(rt.rate / 1000, _('Mbit/s'), rt.mhz, _('MHz')), + var s = '%.1f\xa0%s, %d\xa0%s'.format(rt.rate / 1000, _('Mbit/s'), rt.mhz, _('MHz')), ht = rt.ht, vht = rt.vht, mhz = rt.mhz, nss = rt.nss, mcs = rt.mcs, sgi = rt.short_gi; if (ht || vht) { - if (vht) s += ', VHT-MCS %d'.format(mcs); - if (nss) s += ', VHT-NSS %d'.format(nss); - if (ht) s += ', MCS %s'.format(mcs); - if (sgi) s += ', ' + _('Short GI'); + if (vht) s += ', VHT-MCS\xa0%d'.format(mcs); + if (nss) s += ', VHT-NSS\xa0%d'.format(nss); + if (ht) s += ', MCS\xa0%s'.format(mcs); + if (sgi) s += ', ' + _('Short GI').replace(/ /g, '\xa0'); } return s; @@ -124,8 +124,8 @@ return L.Class.extend({ E('div', { 'class': 'th nowrap' }, _('Network')), E('div', { 'class': 'th hide-xs' }, _('MAC-Address')), E('div', { 'class': 'th' }, _('Host')), - E('div', { 'class': 'th nowrap' }, '%s / %s'.format(_('Signal'), _('Noise'))), - E('div', { 'class': 'th nowrap' }, '%s / %s'.format(_('RX Rate'), _('TX Rate'))) + E('div', { 'class': 'th' }, '%s / %s'.format(_('Signal'), _('Noise'))), + E('div', { 'class': 'th' }, '%s / %s'.format(_('RX Rate'), _('TX Rate'))) ]) ]); @@ -154,14 +154,14 @@ return L.Class.extend({ var sig_title, sig_value; if (bss.noise) { - sig_value = '%d / %d %s'.format(bss.signal, bss.noise, _('dBm')); + sig_value = '%d/%d\xa0%s'.format(bss.signal, bss.noise, _('dBm')); sig_title = '%s: %d %s / %s: %d %s / %s %d'.format( _('Signal'), bss.signal, _('dBm'), _('Noise'), bss.noise, _('dBm'), _('SNR'), bss.signal - bss.noise); } else { - sig_value = '%d %s'.format(bss.signal, _('dBm')); + sig_value = '%d\xa0%s'.format(bss.signal, _('dBm')); sig_title = '%s: %d %s'.format(_('Signal'), bss.signal, _('dBm')); } @@ -209,7 +209,7 @@ return L.Class.extend({ if (networks[i].isClientDisconnectSupported()) { if (assoclist.firstElementChild.childNodes.length < 6) - assoclist.firstElementChild.appendChild(E('div', { 'class': 'th nowrap right' }, [ _('Disconnect') ])); + assoclist.firstElementChild.appendChild(E('div', { 'class': 'th cbi-section-actions' })); row.push(E('button', { 'class': 'cbi-button cbi-button-remove', -- 2.25.1