Polish DHCP inactive time display
This commit is contained in:
+7
-1
@@ -2689,7 +2689,7 @@ function parse_live_wifi_rows(string $iface, string $band, string $text, array $
|
||||
$rows[] = $cur;
|
||||
}
|
||||
|
||||
return $rows;
|
||||
return array_values(array_filter($rows, static fn(array $row): bool => !wifi_client_stale($row)));
|
||||
}
|
||||
|
||||
function lan_fdb_macs(string $iface = 'eth1'): array
|
||||
@@ -2780,6 +2780,12 @@ function wifi_time_ms(string $value): int
|
||||
return PHP_INT_MAX;
|
||||
}
|
||||
|
||||
function wifi_client_stale(array $client): bool
|
||||
{
|
||||
$inactiveMs = wifi_time_ms((string)($client['inactive_time'] ?? ''));
|
||||
return $inactiveMs >= 3600000;
|
||||
}
|
||||
|
||||
function wifi_unknown(mixed $value): bool
|
||||
{
|
||||
$text = strtoupper(trim((string)$value));
|
||||
|
||||
Reference in New Issue
Block a user