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:
13
app/main.py
13
app/main.py
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user