Add connected clients popup per AP
Clicking an AP name opens a modal showing all wireless clients currently associated with that AP: hostname/MAC, IP, SSID, band, channel, signal strength with quality label, TX/RX link rate, and connection uptime. Backend: GET /api/ap-clients?mac=&site_key= calls the Omada clients endpoint with filters.apMac; falls back to client-side filtering if the controller doesn't support that query param. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
15
app/main.py
15
app/main.py
@@ -263,6 +263,21 @@ async def api_reboot(request: Request, db: Session = Depends(get_db)):
|
||||
return {"status": "ok", "mac": mac}
|
||||
|
||||
|
||||
@app.get("/api/ap-clients")
|
||||
async def api_ap_clients(request: Request, mac: str = "", site_key: str = ""):
|
||||
user = get_current_user(request)
|
||||
if not user:
|
||||
raise HTTPException(status_code=401, detail="Not authenticated")
|
||||
if not mac or not site_key:
|
||||
raise HTTPException(status_code=400, detail="mac and site_key required")
|
||||
try:
|
||||
clients = await omada_client.get_ap_clients(mac, site_key)
|
||||
return {"clients": clients}
|
||||
except Exception as exc:
|
||||
logger.error("Failed to fetch clients for AP %s: %s", mac, exc)
|
||||
raise HTTPException(status_code=502, detail=str(exc))
|
||||
|
||||
|
||||
@app.post("/api/reboot-bulk")
|
||||
async def api_reboot_bulk(request: Request, db: Session = Depends(get_db)):
|
||||
user = get_current_user(request)
|
||||
|
||||
Reference in New Issue
Block a user