luci-mod-network: widgets shall show devices that are online as online
authorPaul Donald <[email protected]>
Wed, 23 Apr 2025 12:03:39 +0000 (14:03 +0200)
committerPaul Donald <[email protected]>
Wed, 23 Apr 2025 12:03:39 +0000 (14:03 +0200)
Tunnel devices which are up, show as down, since the config being
enumerated does not have access to any device status. The 'device' being
enumerated is e.g. 'wireguard_wg0', a configuration for a tunnel
interface, whose parent is an 'ethernet' type.

That's a bug for another day. So they shall use parent device status.

Signed-off-by: Paul Donald <[email protected]>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js

index 9074d9b9fa78d2e1d5de0527555499f8009d8189..702fb3fde22eb57773364fce6c56c3f6542c2e12 100644 (file)
@@ -103,7 +103,7 @@ function render_modal_status(node, ifc) {
 
        dom.content(node, [
                E('img', {
-                       'src': L.resource('icons/%s%s.png').format(dev ? dev.getType() : 'ethernet', (dev && dev.isUp()) ? '' : '_disabled'),
+                       'src': L.resource('icons/%s%s.png').format(dev ? dev.getType() : 'ethernet', ifc.isUp() ? '' : '_disabled'),
                        'title': dev ? dev.getTypeI18n() : _('Not present')
                }),
                ifc ? render_status(E('span'), ifc, true) : E('em', _('Interface not present or not connected yet.'))
@@ -297,7 +297,7 @@ return view.extend({
                                var dev = ifc.getDevice();
                                dom.content(stat, [
                                        E('img', {
-                                               'src': L.resource('icons/%s%s.png').format(dev ? dev.getType() : 'ethernet', (dev && dev.isUp()) ? '' : '_disabled'),
+                                               'src': L.resource('icons/%s%s.png').format(dev ? dev.getType() : 'ethernet', ifc.isUp() ? '' : '_disabled'),
                                                'title': dev ? dev.getTypeI18n() : _('Not present')
                                        }),
                                        render_status(E('span'), ifc, true)