diff --git a/routes/controller.py b/routes/controller.py index ca07275..34e8e4e 100644 --- a/routes/controller.py +++ b/routes/controller.py @@ -529,23 +529,6 @@ def proxy_passthrough(agent_id: int, subpath: str): return api_error(f"Agent error: {e}", 502) -@controller_bp.route("/agents//wifi/v2/clients", methods=["GET"]) -def proxy_wifi_clients(agent_id: int): - """Get the WiFi client list from a remote agent.""" - agent = get_agent(agent_id) - if not agent: - return api_error("Agent not found", 404) - - try: - client = create_client_from_agent(agent) - result = client.get("/wifi/v2/clients", params=request.args.to_dict()) - - return jsonify({"status": "success", "agent_id": agent_id, "result": result}) - - except (AgentHTTPError, AgentConnectionError) as e: - return api_error(f"Agent error: {e}", 502) - - @controller_bp.route("/agents//wifi/monitor", methods=["POST"]) def proxy_wifi_monitor(agent_id: int): """Toggle monitor mode on a remote agent's WiFi interface.""" diff --git a/static/js/modes/wifi.js b/static/js/modes/wifi.js index d1dffd2..7593390 100644 --- a/static/js/modes/wifi.js +++ b/static/js/modes/wifi.js @@ -32,16 +32,6 @@ const WiFiMode = (function() { // Agent Support // ========================================================================== - /** - * Get the API base URL, routing through agent proxy if agent is selected. - */ - function getApiBase() { - if (typeof currentAgent !== 'undefined' && currentAgent !== 'local') { - return `/controller/agents/${currentAgent}/wifi/v2`; - } - return CONFIG.apiBase; - } - /** * Get the current agent name for tagging data. */ @@ -1353,7 +1343,7 @@ const WiFiMode = (function() { if (isAgentMode) { // Route through agent proxy - response = await fetch(`/controller/agents/${currentAgent}/wifi/v2/clients?bssid=${encodeURIComponent(bssid)}&associated=true`); + response = await fetch(`/controller/agents/${currentAgent}/proxy/wifi/v2/clients?bssid=${encodeURIComponent(bssid)}&associated=true`); } else { response = await fetch(`${CONFIG.apiBase}/clients?bssid=${encodeURIComponent(bssid)}&associated=true`); }