summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-03-01 20:58:51 +0100
committerJo-Philipp Wich <jo@mein.io>2020-03-01 20:58:51 +0100
commitcf09705ee394ea9cad90581df09a81ec48b48906 (patch)
tree34bb66bb3bda90033a443dde1e13395039fd5ba2
parent9ae591b38fedf16c3e5c97350b7182c5e28ed71f (diff)
luci-mod-network: properly handle "no signal" and "disabled" in signal badges
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js6
1 files changed, 5 insertions, 1 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 be8358d0f..eaa081354 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 },