From 326b6247908669184973555514add6b7eaf66646 Mon Sep 17 00:00:00 2001 From: Paul Donald Date: Wed, 23 Apr 2025 14:03:28 +0200 Subject: [PATCH] luci-base: widgets shall show devices that are online as online Tunnel devices which are up, show as down, since they don't 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 get parent device status. Signed-off-by: Paul Donald (cherry picked from commit 832680bb84d18132d04f424b7d70ce18d62e1150) --- .../htdocs/luci-static/resources/tools/widgets.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/luci-base/htdocs/luci-static/resources/tools/widgets.js b/modules/luci-base/htdocs/luci-static/resources/tools/widgets.js index 3760dbfd28..8bd6456572 100644 --- a/modules/luci-base/htdocs/luci-static/resources/tools/widgets.js +++ b/modules/luci-base/htdocs/luci-static/resources/tools/widgets.js @@ -111,7 +111,7 @@ var CBIZoneSelect = form.ListValue.extend({ continue; var span = E('span', { - 'class': 'ifacebadge' + (network.getName() == this.network ? ' ifacebadge-active' : '') + 'class': 'ifacebadge' + (network.isUp() ? ' ifacebadge-active' : '') }, network.getName() + ': '); var devices = getDevices(network); @@ -119,7 +119,7 @@ var CBIZoneSelect = form.ListValue.extend({ for (var k = 0; k < devices.length; k++) { span.appendChild(E('img', { 'title': devices[k].getI18n(), - 'src': L.resource('icons/%s%s.png'.format(devices[k].getType(), devices[k].isUp() ? '' : '_disabled')) + 'src': L.resource('icons/%s%s.png'.format(devices[k].getType(), network.isUp() ? '' : '_disabled')) })); } @@ -252,7 +252,7 @@ var CBIZoneForwards = form.DummyValue.extend({ continue; var span = E('span', { - 'class': 'ifacebadge' + (network.getName() == this.network ? ' ifacebadge-active' : '') + 'class': 'ifacebadge' + (network.isUp() ? ' ifacebadge-active' : '') }, network.getName() + ': '); var subdevs = getDevices(network); @@ -260,7 +260,7 @@ var CBIZoneForwards = form.DummyValue.extend({ for (var k = 0; k < subdevs.length && subdevs[k]; k++) { span.appendChild(E('img', { 'title': subdevs[k].getI18n(), - 'src': L.resource('icons/%s%s.png'.format(subdevs[k].getType(), subdevs[k].isUp() ? '' : '_disabled')) + 'src': L.resource('icons/%s%s.png'.format(subdevs[k].getType(), network.isUp() ? '' : '_disabled')) })); } @@ -534,7 +534,7 @@ var CBIDeviceSelect = form.ListValue.extend({ var item = E([ E('img', { 'title': device.getI18n(), - 'src': L.resource('icons/alias%s.png'.format(net.isUp() ? '' : '_disabled')) + 'src': L.resource('icons/alias%s.png'.format(device.isUp() ? '' : '_disabled')) }), E('span', { 'class': 'hide-open' }, [ name ]), E('span', { 'class': 'hide-close'}, [ device.getI18n() ]) -- 2.30.2