This commit is contained in:
@@ -24,15 +24,27 @@ import {
|
||||
|
||||
function Ssids({ ssids }: { ssids: string[] }) {
|
||||
if (ssids.length === 0) return <span className="text-muted-foreground">—</span>
|
||||
const extra = ssids.length - 1
|
||||
return (
|
||||
<span className="inline-flex items-center gap-1.5" title={ssids.join(', ')}>
|
||||
<Wifi className="h-3.5 w-3.5 text-muted-foreground" />
|
||||
{ssids[0]}
|
||||
{extra > 0 && (
|
||||
<span className="text-muted-foreground">(and {extra} more…)</span>
|
||||
)}
|
||||
</span>
|
||||
<div className="flex flex-col gap-1">
|
||||
{ssids.map((ssid) => (
|
||||
<span key={ssid} className="inline-flex items-center gap-1.5">
|
||||
<Wifi className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />
|
||||
{ssid}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function Ips({ value }: { value: string | null }) {
|
||||
const ips = value?.split(',').map((ip) => ip.trim()).filter(Boolean) ?? []
|
||||
if (ips.length === 0) return <span className="text-muted-foreground">—</span>
|
||||
return (
|
||||
<div className="flex flex-col gap-1">
|
||||
{ips.map((ip) => (
|
||||
<span key={ip}>{ip}</span>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -99,7 +111,9 @@ export function Devices() {
|
||||
devices.map((d) => (
|
||||
<TableRow key={d.ap_mac}>
|
||||
<TableCell className="font-mono text-xs">{d.ap_mac}</TableCell>
|
||||
<TableCell className="font-mono text-xs">{d.nasipaddress ?? '—'}</TableCell>
|
||||
<TableCell className="font-mono text-xs">
|
||||
<Ips value={d.nasipaddress} />
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Ssids ssids={d.ssids} />
|
||||
</TableCell>
|
||||
|
||||
Reference in New Issue
Block a user