luci-mod-status: prevent trace-back loading wireless on non-WiFi devices
authorPaul Donald <newtwen+github@gmail.com>
Sun, 22 Dec 2024 00:13:26 +0000 (00:13 +0000)
committerPaul Donald <newtwen+github@gmail.com>
Sun, 22 Dec 2024 16:23:35 +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 <newtwen+github@gmail.com>
modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js

index 5804100db45bb05cc43a8a007a5254ea60a810ba..8054230530768b02cad4946ba05fd19329bd4305 100644 (file)
@@ -184,7 +184,7 @@ return baseclass.extend({
                        network.getHostHints(),
                        this.callSessionAccess('access-group', 'luci-mod-status-index-wifi', 'read'),
                        this.callSessionAccess('access-group', 'luci-mod-status-index-wifi', 'write'),
-                       uci.load('wireless')
+                       L.hasSystemFeature('wifi') ? L.resolveDefault(uci.load('wireless')) : L.resolveDefault(),
                ]).then(L.bind(function(data) {
                        var tasks = [],
                            radios_networks_hints = data[1],