mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-01 06:13:56 +08:00
⛅ Sync 2026-09-22 20:11:06
This commit is contained in:
1 parent
41d086dc94
commit
b4f0ef549f
3 files changed
+26
-2
No files matched your search
@@ -506,3 +506,7 @@
|
|||||||
--dashboard-plot-h: 140px;
|
--dashboard-plot-h: 140px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dashboard-client-addresses {
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
}
|
||||||
@@ -212,6 +212,7 @@ return baseclass.extend({
|
|||||||
return charts.table({
|
return charts.table({
|
||||||
head: [
|
head: [
|
||||||
_('Hostname'),
|
_('Hostname'),
|
||||||
|
_('IP Address'),
|
||||||
_('SSID'),
|
_('SSID'),
|
||||||
'%s / %s'.format(_('Signal'), _('Noise floor')),
|
'%s / %s'.format(_('Signal'), _('Noise floor')),
|
||||||
_('Up.'),
|
_('Up.'),
|
||||||
@@ -220,6 +221,9 @@ return baseclass.extend({
|
|||||||
],
|
],
|
||||||
rows: this.params.wifi.devices.map(device => [
|
rows: this.params.wifi.devices.map(device => [
|
||||||
device.hostname.value,
|
device.hostname.value,
|
||||||
|
device.addresses.value.length
|
||||||
|
? E('div', { 'class': 'dashboard-client-addresses' }, device.addresses.value.map(address => E('div', {}, [ address ])))
|
||||||
|
: '-',
|
||||||
device.ssid.value,
|
device.ssid.value,
|
||||||
E('span', {}, [
|
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),
|
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) {
|
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++) {
|
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() });
|
const network_items = networks.filter(net => { return net.getWifiDeviceName() == radios[i].getName() });
|
||||||
@@ -318,6 +331,12 @@ return baseclass.extend({
|
|||||||
value: name || '?'
|
value: name || '?'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
addresses: {
|
||||||
|
title: _('IP Address'),
|
||||||
|
visible: true,
|
||||||
|
value: this.clientAddresses(hosts[bss.mac.toUpperCase()])
|
||||||
|
},
|
||||||
|
|
||||||
ssid : {
|
ssid : {
|
||||||
title: _('SSID'),
|
title: _('SSID'),
|
||||||
visible: true,
|
visible: true,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"admin/dashboard": {
|
"admin/status/dashboard": {
|
||||||
"order": 1,
|
"title": "Dashboard",
|
||||||
|
"order": 2,
|
||||||
"action": {
|
"action": {
|
||||||
"type": "view",
|
"type": "view",
|
||||||
"path": "dashboard/index"
|
"path": "dashboard/index"
|
||||||
|
|||||||
Reference in new issue
Block a user