This commit introduces a refined layout and styling for the camera streams in the unified web UI. Key changes include: - **Responsive Grid Layout:** Implemented a CSS Grid-based layout for camera feeds, ensuring the color camera occupies 1/3 height and mono cameras 2/3 height. - **Improved Stream Fit:** Adjusted CSS to ensure individual camera streams (visual containers) perfectly fit within their designated borders without cropping, distortion, or excessive transparent space, addressing user feedback regarding "zoomed out" or ill-fitting streams. - **Aesthetic Enhancements:** Removed black backgrounds from stream containers and applied corner radii for a modern look. - **Padding Adjustments:** Optimized padding to prevent UI elements from appearing cramped while maintaining visual separation. - **New Tests:** Added robust visual tests () to programmatically verify layout correctness and ensure tight fitting of camera feeds within their containers. - **Dependency Updates:** Updated to reflect any new or changed Python dependencies. - **Test Runner & Gitignore:** Included script and updated to properly ignore virtual environment artifacts.
60 lines
1.4 KiB
Bash
Executable File
60 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Start the Flask application in the background
|
|
python src/unified_web_ui/app.py &
|
|
APP_PID=$!
|
|
|
|
# Wait for the application to start
|
|
echo "Waiting for application to start..."
|
|
sleep 10
|
|
|
|
# Check if the application is running
|
|
if ! ps -p $APP_PID > /dev/null
|
|
then
|
|
echo "Application failed to start."
|
|
exit 1
|
|
fi
|
|
|
|
# Run the curl tests
|
|
echo "Running curl tests..."
|
|
http_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:5000/)
|
|
echo "Main page status code: $http_code"
|
|
if [ "$http_code" != "200" ]; then
|
|
echo "Main page test failed."
|
|
fi
|
|
|
|
http_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:5000/get_fps)
|
|
echo "get_fps status code: $http_code"
|
|
if [ "$http_code" != "200" ]; then
|
|
echo "get_fps test failed."
|
|
fi
|
|
|
|
matrix_data='{"matrix":['
|
|
for i in {1..5}; do
|
|
matrix_data+='['
|
|
for j in {1..5}; do
|
|
matrix_data+='{"ww":0,"cw":0,"blue":0}'
|
|
if [ $j -lt 5 ]; then
|
|
matrix_data+=','
|
|
fi
|
|
done
|
|
matrix_data+=']'
|
|
if [ $i -lt 5 ]; then
|
|
matrix_data+=','
|
|
fi
|
|
done
|
|
matrix_data+=']}'
|
|
|
|
http_code=$(curl -s -o /dev/null -w "%{http_code}" -X POST -H "Content-Type: application/json" -d "$matrix_data" http://localhost:5000/set_matrix)
|
|
echo "set_matrix status code: $http_code"
|
|
if [ "$http_code" != "200" ]; then
|
|
echo "set_matrix test failed."
|
|
fi
|
|
|
|
# Run the pytest tests
|
|
echo "Running pytest tests..."
|
|
pytest src/unified_web_ui/tests/
|
|
|
|
# Kill the Flask application
|
|
kill $APP_PID
|