From b4f0ef549f4b014c6edf82b1ef08fef65309bcaa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 22 Sep 2026 20:11:06 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9B=85=20Sync=202026-09-22=2020:11:06?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/view/dashboard/css/custom.css | 4 ++++ .../view/dashboard/include/30_wifi.js | 19 +++++++++++++++++++ .../share/luci/menu.d/luci-mod-dashboard.json | 5 +++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/css/custom.css b/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/css/custom.css index 5fb8baec1..d780ae310 100644 --- a/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/css/custom.css +++ b/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/css/custom.css @@ -506,3 +506,7 @@ --dashboard-plot-h: 140px; } } + +.dashboard-client-addresses { + overflow-wrap: anywhere; +} diff --git a/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js b/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js index 14f7da942..b75ab8314 100644 --- a/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js +++ b/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js @@ -212,6 +212,7 @@ return baseclass.extend({ return charts.table({ head: [ _('Hostname'), + _('IP Address'), _('SSID'), '%s / %s'.format(_('Signal'), _('Noise floor')), _('Up.'), @@ -220,6 +221,9 @@ return baseclass.extend({ ], rows: this.params.wifi.devices.map(device => [ device.hostname.value, + device.addresses.value.length + ? E('div', { 'class': 'dashboard-client-addresses' }, device.addresses.value.map(address => E('div', {}, [ address ]))) + : '-', device.ssid.value, E('span', {}, [ charts.badge((device.signal.value.rssi != null) ? '%d %s'.format(device.signal.value.rssi, _('dBm')) : _('No RX signal'), signalGrade(device.signal.value.rssi).kind), @@ -245,7 +249,16 @@ return baseclass.extend({ ]); }, + clientAddresses(hint) { + const ipv4 = L.toArray(hint?.ipaddrs || hint?.ipv4); + const ipv6 = L.toArray(hint?.ip6addrs || hint?.ipv6) + .filter(address => !/^fe[89ab][0-9a-f]:/i.test(address)); + + return Array.from(new Set(ipv4.concat(ipv6).filter(Boolean))); + }, + renderUpdateData(radios, networks, hosthints) { + const hosts = Object.fromEntries(Object.entries(hosthints.hosts || {}).map(([ mac, hint ]) => [ mac.toUpperCase(), hint ])); for (let i = 0; i < radios.sort((a, b) => a.getName().localeCompare(b.getName())).length; i++) { const network_items = networks.filter(net => { return net.getWifiDeviceName() == radios[i].getName() }); @@ -318,6 +331,12 @@ return baseclass.extend({ value: name || '?' }, + addresses: { + title: _('IP Address'), + visible: true, + value: this.clientAddresses(hosts[bss.mac.toUpperCase()]) + }, + ssid : { title: _('SSID'), visible: true, diff --git a/luci-mod-dashboard/root/usr/share/luci/menu.d/luci-mod-dashboard.json b/luci-mod-dashboard/root/usr/share/luci/menu.d/luci-mod-dashboard.json index 3d04b4c7d..52d6c0b5b 100644 --- a/luci-mod-dashboard/root/usr/share/luci/menu.d/luci-mod-dashboard.json +++ b/luci-mod-dashboard/root/usr/share/luci/menu.d/luci-mod-dashboard.json @@ -1,6 +1,7 @@ { - "admin/dashboard": { - "order": 1, + "admin/status/dashboard": { + "title": "Dashboard", + "order": 2, "action": { "type": "view", "path": "dashboard/index"