From 4d8adffa8b8b5c241a3af79a8d4bd3f0485ca9a0 Mon Sep 17 00:00:00 2001 From: spicyneutrino <107169289+spicyneutrino@users.noreply.github.com> Date: Sun, 1 Feb 2026 17:25:00 -0600 Subject: [PATCH 1/4] feat: migrate architecture from HTTP polling to WebSocket push - Enhanced backend broadcast_state to push V2G and AI focus data via WebSocket - Removed all frontend setInterval polling loops in script.js - Implemented WebSocket event listeners for system_update and v2g_restoration_complete - Refactored scenario-director to use event-driven status checks - Updated index.html cache busting to force reload of new scripts Performance: Eliminated ~5-7 req/sec from periodic polling of /api/network_state, /api/v2g/status, and /api/ai/map_focus_status --- index.html | 27 +-- main_complete_integration.py | 130 +++++++++++- static/scenario-director.js | 160 ++++++++++----- static/script.js | 383 +++++++++++++++++------------------ 4 files changed, 431 insertions(+), 269 deletions(-) diff --git a/index.html b/index.html index d1509af..9f9951a 100644 --- a/index.html +++ b/index.html @@ -8,6 +8,7 @@ + @@ -19,8 +20,8 @@ - - + +
@@ -531,18 +532,20 @@