summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-network/htdocs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-07-19 17:59:05 +0200
committerJo-Philipp Wich <jo@mein.io>2019-07-19 17:59:05 +0200
commit8dd2df29c47ab0ce594246ebc477bddb8043bcb7 (patch)
tree1d4eda134f5d7b34021ba27c4e2cc236d28937ae /modules/luci-mod-network/htdocs
parent5510bdae399c131f8911f4d4b39ec6832252c161 (diff)
luci-mod-network: improve wifi scan status reporting
Attempt to properly report the scan status by treating 404 replies as not yet completed scans and empty array replies as successful scans that did not yield any results. Fixes: #2874 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-network/htdocs')
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/view/network/wifi_join.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wifi_join.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wifi_join.js
index d5bd7b0a6d..af926ab4a2 100644
--- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wifi_join.js
+++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wifi_join.js
@@ -113,6 +113,7 @@ function scan() {
var count = 0;
poll = L.poll(3, L.url('admin/network/wireless_scan_results', dev), null, function(s, results) {
+
if (Array.isArray(results)) {
var bss = [];
@@ -143,9 +144,13 @@ function scan() {
]);
});
- cbi_update_table(tbl, bss, E('em', { class: 'spinning' }, _('No scan results available yet...')));
+ cbi_update_table(tbl, bss, E('em' {}, _('No networks in range')));
+ }
+ else {
+ cbi_update_table(tbl, [], E('em', { class: 'spinning' }, _('No scan results available yet...')));
}
+
if (count++ >= 3) {
count = 0;
L.post(L.url('admin/network/wireless_scan_trigger', dev, 1), null, function() {});