From 09a3fdcfebd0771fc4aac0a9719c65c8b6b2b805 Mon Sep 17 00:00:00 2001 From: Jason Staack Date: Sun, 15 Mar 2026 20:06:25 -0500 Subject: [PATCH] feat: add APs Needing Attention dashboard card Co-Authored-By: Claude Sonnet 4.6 --- .../components/dashboard/WirelessIssues.tsx | 73 +++++++++++++++++++ .../src/components/fleet/FleetDashboard.tsx | 6 ++ 2 files changed, 79 insertions(+) create mode 100644 frontend/src/components/dashboard/WirelessIssues.tsx diff --git a/frontend/src/components/dashboard/WirelessIssues.tsx b/frontend/src/components/dashboard/WirelessIssues.tsx new file mode 100644 index 0000000..c6dbb46 --- /dev/null +++ b/frontend/src/components/dashboard/WirelessIssues.tsx @@ -0,0 +1,73 @@ +import { useQuery } from '@tanstack/react-query' +import { Wifi, CheckCircle2 } from 'lucide-react' +import { metricsApi, type WirelessIssue } from '@/lib/api' + +interface WirelessIssuesProps { + tenantId: string | null // null = all orgs (super admin) +} + +function signalColor(signal: number | null): string { + if (signal === null) return 'text-muted-foreground' + if (signal > -60) return 'text-green-400' + if (signal > -70) return 'text-yellow-400' + return 'text-red-400' +} + +export function WirelessIssues({ tenantId }: WirelessIssuesProps) { + const { data: issues = [], isLoading } = useQuery({ + queryKey: ['wireless-issues', tenantId], + queryFn: () => + tenantId + ? metricsApi.wirelessIssues(tenantId) + : metricsApi.fleetWirelessIssues(), + refetchInterval: 60_000, + }) + + return ( +
+

+ + APs Needing Attention +

+ + {isLoading ? ( +
Loading...
+ ) : issues.length === 0 ? ( +
+ + All APs Healthy + No wireless issues detected +
+ ) : ( +
+ {issues.map((ap, i) => ( +
+
+
+
+
+ {ap.hostname} + ({ap.interface}) +
+ {ap.tenant_name && ( +
{ap.tenant_name}
+ )} +
+
+
+ {ap.issue} +
+
+ ))} +
+ )} +
+ ) +} diff --git a/frontend/src/components/fleet/FleetDashboard.tsx b/frontend/src/components/fleet/FleetDashboard.tsx index d0d5715..06d8990 100644 --- a/frontend/src/components/fleet/FleetDashboard.tsx +++ b/frontend/src/components/fleet/FleetDashboard.tsx @@ -17,6 +17,7 @@ import { EventsTimeline } from '@/components/dashboard/EventsTimeline' import { BandwidthChart, type BandwidthDevice } from '@/components/dashboard/BandwidthChart' import { AlertSummary } from '@/components/dashboard/AlertSummary' import { QuickActions } from '@/components/dashboard/QuickActions' +import { WirelessIssues } from '@/components/dashboard/WirelessIssues' // ─── Types ─────────────────────────────────────────────────────────────────── @@ -289,6 +290,11 @@ export function FleetDashboard() { criticalAlerts={criticalCount} />
+ + {/* Wireless Issues */} +
+ +
)}