luci-mod-network: properly handle "no signal" and "disabled" in signal badges
authorJo-Philipp Wich <jo@mein.io>
Sun, 1 Mar 2020 19:58:51 +0000 (20:58 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 2 Apr 2020 13:27:38 +0000 (15:27 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit cf09705ee394ea9cad90581df09a81ec48b48906)

modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js

index ec57208504b68f09d606e299cc738dee87af7995..6118e844155a888e4661597eff083fb6e1ac4127 100644 (file)
@@ -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 },