luci-app-travelmate: fixes in station.js
authorDirk Brenken <[email protected]>
Thu, 6 Nov 2025 05:22:01 +0000 (06:22 +0100)
committerDirk Brenken <[email protected]>
Thu, 6 Nov 2025 05:22:01 +0000 (06:22 +0100)
Fixes errors in the display/workflow of scan results:
- Display of stations with a strength of "100"
- Display/Workflow of "hidden" SSIDs

Signed-off-by: Dirk Brenken <[email protected]>
applications/luci-app-travelmate/htdocs/luci-static/resources/view/travelmate/stations.js

index c471d75d59ca6ed4283b2950a669775e95fadea8..e0e4b81b9cbbf82b6c787ccd908d9c4347554de8 100644 (file)
@@ -792,7 +792,7 @@ return view.extend({
                                                        if (res) {
                                                                lines = res.split('\n');
                                                                for (let i = 0; i < lines.length; i++) {
-                                                                       if (lines[i].match(/^\s+[0-9]/)) {
+                                                                       if (lines[i].match(/^\s*\d+/)) {
                                                                                strength = lines[i].slice(0,3).trim();
                                                                                channel = lines[i].slice(3,7).trim();
                                                                                bssid = lines[i].slice(7,25).trim();
@@ -801,6 +801,11 @@ return view.extend({
                                                                                cipher = lines[i].slice(29,40).trim();
                                                                                auth = lines[i].slice(40,71).trim().split(',');
                                                                                ssid = lines[i].slice(71).trim();
+                                                                               let tbl_ssid = ssid;
+                                                                               if (ssid === "") {
+                                                                                       tbl_ssid = "<em>hidden</em>";
+                                                                                       ssid = "hidden";
+                                                                               }
                                                                                let encryption = 'Open';
                                                                                let tbl_encryption = '';
                                                                                let hasWPA = wpa === '+';
@@ -857,7 +862,7 @@ return view.extend({
                                                                                rows.push([
                                                                                        strength,
                                                                                        channel,
-                                                                                       ssid,
+                                                                                       tbl_ssid,
                                                                                        bssid,
                                                                                        tbl_encryption,
                                                                                        E('div', { 'class': 'right' },