summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-dashboard/htdocs/luci-static/resources/view
diff options
context:
space:
mode:
authorPaul Donald <newtwen+github@gmail.com>2024-10-26 16:11:06 +0200
committerPaul Donald <newtwen+github@gmail.com>2024-10-26 16:11:06 +0200
commit392b7e6b0d56d7d292b7f662b0728620397613e9 (patch)
tree7eed9884ef56515e0e944626ffcb9dd88abbd383 /modules/luci-mod-dashboard/htdocs/luci-static/resources/view
parent0df7955d37e8db2fc18138186d8ff1113105c58b (diff)
luci-mod-dashboard: fix for devices that do not report noise floor
Closes #7355 Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Diffstat (limited to 'modules/luci-mod-dashboard/htdocs/luci-static/resources/view')
-rw-r--r--modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js b/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js
index e2742dd020..f87131ceac 100644
--- a/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js
+++ b/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js
@@ -83,7 +83,7 @@ return baseclass.extend({
E('th', { 'class': 'th nowrap' }, _('Hostname')),
E('th', { 'class': 'th' }, _('SSID')),
E('th', { 'class': 'th', 'width': '45%' }, _('Signal Strength')),
- E('th', { 'class': 'th' }, 'Transferred %s / %s'.format( _('Up.'), _('Down.')))
+ E('th', { 'class': 'th' }, _('Transferred') + ' %s / %s'.format( _('Up.'), _('Down.')))
])
]);
@@ -205,8 +205,10 @@ return baseclass.extend({
name = hosthints.getHostnameByMACAddr(bss.mac);
var progress_style;
+ var defaultNF = -90; // default noise floor for devices that do not report it
+ var defaultCeil = -30;
// var q = Math.min((bss.signal + 110) / 70 * 100, 100);
- var q = 100 * ((bss.signal - bss.noise) / (-30 - bss.noise));
+ var q = 100 * ((bss.signal - (bss.noise ? bss.noise: defaultNF) ) / (defaultCeil - (bss.noise ? bss.noise : defaultNF)));
if (q == 0 || q < 25)
progress_style = 'bg-danger';