luci-base: prevent trace-back loading wireless on non-WiFi devices
authorPaul Donald <redacted>
Sun, 22 Dec 2024 00:38:32 +0000 (00:38 +0000)
committerPaul Donald <redacted>
Sun, 22 Dec 2024 16:23:26 +0000 (16:23 +0000)
Manifests in the console as:

RPCError: RPC call to uci/get failed with ubus code 4: Resource not found

The lazy-loading is harmless and has been that way for years, but the
presence of the trace-back clouds other problems. This should keep the
console cleaner; it conditionally attempts to load wireless when a more
fundamental check for it passes.

Signed-off-by: Paul Donald <redacted>
modules/luci-base/htdocs/luci-static/resources/network.js

index 5f77d8354a4b30b2668999a1a491ac1b1200d978..d71aa69fa361436d6018c708c1aff68cc559b915 100644 (file)
@@ -357,7 +357,7 @@ function initNetworkState(refresh) {
                        L.resolveDefault(callLuciHostHints(), {}),
                        getProtocolHandlers(),
                        L.resolveDefault(uci.load('network')),
-                       L.resolveDefault(uci.load('wireless')),
+                       L.hasSystemFeature('wifi') ? L.resolveDefault(uci.load('wireless')) : L.resolveDefault(),
                        L.resolveDefault(uci.load('luci'))
                ]).then(function(data) {
                        var netifd_ifaces = data[0],
git clone https://git.99rst.org/PROJECT