From 4506cbc569be54502d17fa3d21558702a79e74cc Mon Sep 17 00:00:00 2001 From: rakadu1 Date: Mon, 23 Mar 2026 11:58:20 +0530 Subject: [PATCH] feat(offline): enable GridStack offline-first fallback and harden local launch scripts - Downloaded GridStack.js and CSS assets (v10.1.2) to the vendor folder for offline support. - Configured index.html with local-first script loading and CDN fallback logic. - Hardened server.py to explicitly bind to 127.0.0.1 and anchor to the script directory. - Optimized Visualization_Start.bat with working directory anchoring and a delayed browser launch to ensure the server is fully ready. --- steps/Visualization_Start.bat | 20 +++++++++++++++----- steps/index.html | 17 +++++++++++++++-- steps/server.py | 14 ++++++++------ steps/vendor/gridstack-all.js | 3 +++ steps/vendor/gridstack.min.css | 1 + 5 files changed, 42 insertions(+), 13 deletions(-) create mode 100644 steps/vendor/gridstack-all.js create mode 100644 steps/vendor/gridstack.min.css diff --git a/steps/Visualization_Start.bat b/steps/Visualization_Start.bat index 06fcd8c..c07a657 100644 --- a/steps/Visualization_Start.bat +++ b/steps/Visualization_Start.bat @@ -1,8 +1,11 @@ @echo off +:: Force the working directory to be the folder containing this script +cd /d "%~dp0" + title Radar and Video Visualizer - Server color 0B - cls + echo. echo ====================================================== echo Radar and Video Visualizer - Local Server @@ -16,10 +19,17 @@ echo ====================================================== echo. echo Launching the application in your default browser... -start http://127.0.0.1:8000/index.html +:: Delay the browser launch by 2 seconds to allow the Python server to start up +start /b "" cmd /c "timeout /t 2 /nobreak > nul && start http://127.0.0.1:8000/index.html" -echo Server is now running on http://127.0.0.1:8000 +echo Server is starting on http://127.0.0.1:8000 echo Press CTRL+C at any time to stop the server. +echo. -:: Run the server command directly. We know 'python' works from our test. -python server.py \ No newline at end of file +:: Detect python and run server.py +python server.py || py server.py || python3 server.py || ( + echo. + echo ERROR: Could not start Python server. + echo Check if Python is installed and in your PATH. + pause +) \ No newline at end of file diff --git a/steps/index.html b/steps/index.html index 42aac52..b76baed 100644 --- a/steps/index.html +++ b/steps/index.html @@ -71,8 +71,21 @@ })(); - - + + +