From: Jo-Philipp Wich Date: Sun, 1 Mar 2020 19:58:51 +0000 (+0100) Subject: luci-mod-network: properly handle "no signal" and "disabled" in signal badges X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b572c6d82eed487b9e48b7537921d967787c83f1;p=oweals%2Fluci.git luci-mod-network: properly handle "no signal" and "disabled" in signal badges Signed-off-by: Jo-Philipp Wich (cherry picked from commit cf09705ee394ea9cad90581df09a81ec48b48906) --- 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 ec5720850..6118e8441 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 @@ -56,9 +56,13 @@ function render_signal_badge(signalPercent, signalValue, noiseValue, wrap) { value = '%d %s'.format(signalValue, _('dBm')); title = '%s: %d %s'.format(_('Signal'), signalValue, _('dBm')); } + else if (signalPercent > -1) { + value = '\xa0---\xa0'; + title = _('No signal'); + } else { value = E('em', {}, E('small', {}, [ _('disabled') ])); - title = _('No signal'); + title = _('Interface is disabled'); } return E('div', { 'class': wrap ? 'center' : 'ifacebadge', 'title': title },