Add IP range filter button (.150–.155)

New "Filter .150–.155" button fetches all connected clients via
GET /api/all-clients (one request per site, grouped by AP MAC),
then hides any AP row that has no client with a last-octet IP
between 150 and 155. Clicking again clears the filter.

The name/site search and IP filter compose (AND logic) via a shared
applyFilters() function. Client data is cached in-memory for the
current page session so repeated toggles don't re-fetch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-27 15:48:50 +02:00
parent 1041777b9a
commit d693321ba1
3 changed files with 127 additions and 5 deletions

View File

@@ -263,6 +263,19 @@ async def api_reboot(request: Request, db: Session = Depends(get_db)):
return {"status": "ok", "mac": mac}
@app.get("/api/all-clients")
async def api_all_clients(request: Request):
user = get_current_user(request)
if not user:
raise HTTPException(status_code=401, detail="Not authenticated")
try:
data = await omada_client.get_all_clients()
return {"ap_clients": data}
except Exception as exc:
logger.error("Failed to fetch all clients: %s", exc)
raise HTTPException(status_code=502, detail=str(exc))
@app.get("/api/ap-clients")
async def api_ap_clients(request: Request, mac: str = "", site_key: str = ""):
user = get_current_user(request)