diff --git a/camera-management-api/usda_vision_system/api/server.py b/camera-management-api/usda_vision_system/api/server.py index d9d25df..7adcc26 100644 --- a/camera-management-api/usda_vision_system/api/server.py +++ b/camera-management-api/usda_vision_system/api/server.py @@ -688,6 +688,29 @@ class APIServer: except Exception as e: self.logger.error(f"Failed to add video routes: {e}") + @self.app.get("/debug/camera-manager") + async def debug_camera_manager(): + """Debug endpoint to check camera manager state""" + try: + if not self.camera_manager: + return {"error": "Camera manager not available"} + + return { + "available_cameras": len(self.camera_manager.available_cameras), + "camera_recorders": list(self.camera_manager.camera_recorders.keys()), + "camera_streamers": list(self.camera_manager.camera_streamers.keys()), + "streamer_states": { + name: { + "exists": streamer is not None, + "is_streaming": streamer.is_streaming() if streamer else False, + "streaming": getattr(streamer, 'streaming', False) if streamer else False + } + for name, streamer in self.camera_manager.camera_streamers.items() + } + } + except Exception as e: + return {"error": str(e)} + def _setup_event_subscriptions(self): """Setup event subscriptions for WebSocket broadcasting""" diff --git a/camera-management-api/usda_vision_system/camera/manager.py b/camera-management-api/usda_vision_system/camera/manager.py index fac36ef..8886493 100644 --- a/camera-management-api/usda_vision_system/camera/manager.py +++ b/camera-management-api/usda_vision_system/camera/manager.py @@ -460,12 +460,16 @@ class CameraManager: def _initialize_streamers(self) -> None: """Initialize camera streamers for configured cameras""" + self.logger.info("Starting camera streamer initialization...") with self._lock: for camera_config in self.config.cameras: if not camera_config.enabled: + self.logger.debug(f"Skipping disabled camera: {camera_config.name}") continue try: + self.logger.info(f"Initializing streamer for camera: {camera_config.name}") + # Find matching physical camera device_info = self._find_camera_device(camera_config.name) if device_info is None: @@ -481,6 +485,10 @@ class CameraManager: except Exception as e: self.logger.error(f"Error initializing streamer for {camera_config.name}: {e}") + import traceback + self.logger.error(f"Traceback: {traceback.format_exc()}") + + self.logger.info(f"Camera streamer initialization complete. Created {len(self.camera_streamers)} streamers: {list(self.camera_streamers.keys())}") def get_camera_streamer(self, camera_name: str) -> Optional[CameraStreamer]: """Get camera streamer for a specific camera""" diff --git a/camera-management-api/usda_vision_system/camera/monitor.py b/camera-management-api/usda_vision_system/camera/monitor.py index 71fac9f..9107537 100644 --- a/camera-management-api/usda_vision_system/camera/monitor.py +++ b/camera-management-api/usda_vision_system/camera/monitor.py @@ -172,14 +172,37 @@ class CameraMonitor: if not device_info: return "disconnected", "Camera device not found", None + # ALWAYS check our streamer state first, before doing any camera availability tests + streamer = self.camera_manager.camera_streamers.get(camera_name) + self.logger.info(f"Checking streamer for {camera_name}: {streamer}") + if streamer and streamer.is_streaming(): + self.logger.info(f"Camera {camera_name} is streaming - setting status to streaming") + return "streaming", "Camera streaming (live preview)", self._get_device_info_dict(device_info) + + # Also check if our recorder is active + recorder = self.camera_manager.camera_recorders.get(camera_name) + if recorder and recorder.hCamera and recorder.recording: + self.logger.info(f"Camera {camera_name} is recording - setting status to available") + return "available", "Camera recording (in use by system)", self._get_device_info_dict(device_info) + # Check if camera is already opened by another process - if mvsdk.CameraIsOpened(device_info): - # Camera is opened - check if it's our recorder that's currently recording - recorder = self.camera_manager.camera_recorders.get(camera_name) - if recorder and recorder.hCamera and recorder.recording: - return "available", "Camera recording (in use by system)", self._get_device_info_dict(device_info) - else: + try: + self.logger.info(f"Checking if camera {camera_name} is opened...") + is_opened = mvsdk.CameraIsOpened(device_info) + self.logger.info(f"CameraIsOpened result for {camera_name}: {is_opened}") + + if is_opened: + self.logger.info(f"Camera {camera_name} is opened by another process - setting status to busy") return "busy", "Camera opened by another process", self._get_device_info_dict(device_info) + else: + self.logger.info(f"Camera {camera_name} is not opened, will try initialization") + # Camera is not opened, so we can try to initialize it + pass + + except Exception as e: + self.logger.warning(f"CameraIsOpened failed for {camera_name}: {e}") + # If we can't determine the status, try to initialize to see what happens + self.logger.info(f"CameraIsOpened failed for {camera_name}, will try initialization: {e}") # Try to initialize camera briefly to test availability try: diff --git a/camera-management-api/usda_vision_system/core/state_manager.py b/camera-management-api/usda_vision_system/core/state_manager.py index 5683d22..9482d05 100644 --- a/camera-management-api/usda_vision_system/core/state_manager.py +++ b/camera-management-api/usda_vision_system/core/state_manager.py @@ -28,6 +28,7 @@ class CameraStatus(Enum): UNKNOWN = "unknown" AVAILABLE = "available" BUSY = "busy" + STREAMING = "streaming" # New status for when camera is streaming ERROR = "error" DISCONNECTED = "disconnected" diff --git a/docker-compose.yml b/docker-compose.yml index 6cee373..c11aae9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -45,6 +45,8 @@ services: web: image: node:20-alpine working_dir: /app + env_file: + - ./management-dashboard-web-app/.env volumes: - ./management-dashboard-web-app:/app environment: diff --git a/management-dashboard-web-app/.env.example b/management-dashboard-web-app/.env.example old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/.gitignore b/management-dashboard-web-app/.gitignore old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/.vscode/extensions.json b/management-dashboard-web-app/.vscode/extensions.json old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/AI_AGENT_VIDEO_INTEGRATION_GUIDE.md b/management-dashboard-web-app/API Documentations/docs/AI_AGENT_VIDEO_INTEGRATION_GUIDE.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/API_CHANGES_SUMMARY.md b/management-dashboard-web-app/API Documentations/docs/API_CHANGES_SUMMARY.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/API_DOCUMENTATION.md b/management-dashboard-web-app/API Documentations/docs/API_DOCUMENTATION.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/API_QUICK_REFERENCE.md b/management-dashboard-web-app/API Documentations/docs/API_QUICK_REFERENCE.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/CURRENT_CONFIGURATION.md b/management-dashboard-web-app/API Documentations/docs/CURRENT_CONFIGURATION.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/MP4_FORMAT_UPDATE.md b/management-dashboard-web-app/API Documentations/docs/MP4_FORMAT_UPDATE.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/PROJECT_COMPLETE.md b/management-dashboard-web-app/API Documentations/docs/PROJECT_COMPLETE.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/REACT_INTEGRATION_GUIDE.md b/management-dashboard-web-app/API Documentations/docs/REACT_INTEGRATION_GUIDE.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/README.md b/management-dashboard-web-app/API Documentations/docs/README.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/VIDEO_STREAMING.md b/management-dashboard-web-app/API Documentations/docs/VIDEO_STREAMING.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/WEB_AI_AGENT_VIDEO_INTEGRATION.md b/management-dashboard-web-app/API Documentations/docs/WEB_AI_AGENT_VIDEO_INTEGRATION.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/api/CAMERA_CONFIG_API.md b/management-dashboard-web-app/API Documentations/docs/api/CAMERA_CONFIG_API.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/camera/BLOWER_CAMERA_CONFIG.md b/management-dashboard-web-app/API Documentations/docs/camera/BLOWER_CAMERA_CONFIG.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/camera/CONVEYOR_CAMERA_CONFIG.md b/management-dashboard-web-app/API Documentations/docs/camera/CONVEYOR_CAMERA_CONFIG.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/camera/PREVIEW_ENHANCEMENT.md b/management-dashboard-web-app/API Documentations/docs/camera/PREVIEW_ENHANCEMENT.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/features/AUTO_RECORDING_FEATURE_GUIDE.md b/management-dashboard-web-app/API Documentations/docs/features/AUTO_RECORDING_FEATURE_GUIDE.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/guides/CAMERA_RECOVERY_GUIDE.md b/management-dashboard-web-app/API Documentations/docs/guides/CAMERA_RECOVERY_GUIDE.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/guides/MQTT_LOGGING_GUIDE.md b/management-dashboard-web-app/API Documentations/docs/guides/MQTT_LOGGING_GUIDE.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/guides/STREAMING_GUIDE.md b/management-dashboard-web-app/API Documentations/docs/guides/STREAMING_GUIDE.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/legacy/01README.md b/management-dashboard-web-app/API Documentations/docs/legacy/01README.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/legacy/IMPLEMENTATION_SUMMARY.md b/management-dashboard-web-app/API Documentations/docs/legacy/IMPLEMENTATION_SUMMARY.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/legacy/README.md b/management-dashboard-web-app/API Documentations/docs/legacy/README.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/legacy/README_SYSTEM.md b/management-dashboard-web-app/API Documentations/docs/legacy/README_SYSTEM.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/legacy/TIMEZONE_SETUP_SUMMARY.md b/management-dashboard-web-app/API Documentations/docs/legacy/TIMEZONE_SETUP_SUMMARY.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/API Documentations/docs/legacy/VIDEO_RECORDER_README.md b/management-dashboard-web-app/API Documentations/docs/legacy/VIDEO_RECORDER_README.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/CAMERA_ROUTE_IMPLEMENTATION.md b/management-dashboard-web-app/CAMERA_ROUTE_IMPLEMENTATION.md new file mode 100755 index 0000000..4859e11 --- /dev/null +++ b/management-dashboard-web-app/CAMERA_ROUTE_IMPLEMENTATION.md @@ -0,0 +1,210 @@ +# ๐ฅ Camera Route Implementation Guide + +This document explains the implementation of the new public camera live view routes (`/camera#/live`) that don't require authentication. + +## ๐ What Was Implemented + +### 1. **LiveCameraView Component** (`src/components/LiveCameraView.tsx`) +- Displays live camera feed without authentication requirements +- Handles streaming start/stop automatically +- Provides error handling and loading states +- Full-screen live view with camera label and status indicator + +### 2. **CameraRoute Component** (`src/components/CameraRoute.tsx`) +- Validates camera route parameters +- Ensures only valid camera numbers (camera1, camera2, etc.) are accepted +- Renders the LiveCameraView for valid routes + +### 3. **Updated App.tsx** +- Added route pattern matching for `/camera#/live` +- Integrated camera routes into existing authentication flow +- Maintains backward compatibility with existing functionality + +### 4. **Test Page** (`public/camera-test.html`) +- Simple HTML page to test camera routes +- Provides links to test different camera numbers +- Explains expected behavior + +## ๐ Required Dependencies + +The following packages need to be installed to complete the implementation: + +```bash +# Install React Router +npm install react-router-dom + +# Install TypeScript types +npm install --save-dev @types/react-router-dom +``` + +**Note:** Due to permission issues, these packages couldn't be installed automatically. You'll need to resolve the permissions or install them manually. + +## ๐ง How to Complete the Setup + +### Option 1: Fix Permissions and Install +```bash +# Fix node_modules permissions +sudo chown -R $USER:$USER node_modules +sudo chmod -R 755 node_modules + +# Install dependencies +npm install +``` + +### Option 2: Manual Installation +```bash +# Remove problematic node_modules +rm -rf node_modules + +# Reinstall everything +npm install +``` + +### Option 3: Use Yarn Instead +```bash +# Install yarn if not available +npm install -g yarn + +# Install dependencies with yarn +yarn install +``` + +## ๐งช Testing the Implementation + +### 1. **Start the Development Server** +```bash +npm run dev +``` + +### 2. **Test Camera Routes** +Open these URLs in your browser: +- `http://localhost:5173/camera1/live` - Live view of camera1 +- `http://localhost:5173/camera2/live` - Live view of camera2 +- `http://localhost:5173/camera3/live` - Live view of camera3 + +### 3. **Use the Test Page** +Open `http://localhost:5173/camera-test.html` to access the test interface. + +### 4. **Expected Behavior** +- โ **Valid routes** should show live camera feed +- โ **Invalid routes** should show error message +- ๐ **Protected routes** should redirect to login + +## ๐๏ธ Architecture Details + +### Route Pattern +``` +/camera{number}/live +``` +- `{number}` must be a positive integer +- Examples: `/camera1/live`, `/camera2/live`, `/camera10/live` +- Invalid: `/camera/live`, `/camera0/live`, `/camera-1/live` + +### Component Flow +``` +App.tsx โ Route Detection โ CameraRoute โ LiveCameraView +``` + +### API Integration +The LiveCameraView component integrates with existing camera API endpoints: +- `POST /cameras/{camera_name}/start-stream` - Start streaming +- `GET /cameras/{camera_name}/stream` - Get MJPEG stream +- `POST /cameras/{camera_name}/stop-stream` - Stop streaming + +## ๐ฏ Key Features + +### โ **Public Access** +- No authentication required +- Anyone can view live camera feeds +- Perfect for monitoring displays + +### โ **Non-Blocking Streaming** +- Uses existing CameraStreamer infrastructure +- Separate camera connections for streaming vs. recording +- Doesn't interfere with recording operations + +### โ **Real-time Video** +- MJPEG format for low latency +- Automatic stream management +- Error handling and retry functionality + +### โ **Responsive Design** +- Full-screen live view +- Camera identification labels +- Live status indicators + +## ๐ Troubleshooting + +### Common Issues + +#### 1. **Permission Errors During Installation** +```bash +# Fix ownership +sudo chown -R $USER:$USER . + +# Fix permissions +sudo chmod -R 755 . +``` + +#### 2. **Camera Stream Not Loading** +- Check if camera API is running (`http://localhost:8000`) +- Verify camera configuration in `config.compose.json` +- Check browser console for errors + +#### 3. **Route Not Working** +- Ensure React app is running +- Check browser console for routing errors +- Verify component imports are correct + +#### 4. **TypeScript Errors** +- Install missing type definitions +- Check import paths +- Verify component interfaces + +### Debug Steps +1. Check browser console for errors +2. Verify API endpoints are accessible +3. Test camera streaming directly via API +4. Check component rendering in React DevTools + +## ๐ Next Steps + +### Immediate +1. Install required dependencies +2. Test basic functionality +3. Verify camera streaming works + +### Future Enhancements +1. **Add React Router** for better routing +2. **Implement URL-based navigation** between cameras +3. **Add camera selection interface** +4. **Implement stream quality controls** +5. **Add recording controls** (if needed) + +### Production Considerations +1. **Security**: Consider adding rate limiting +2. **Performance**: Optimize for multiple concurrent viewers +3. **Monitoring**: Add analytics and usage tracking +4. **Access Control**: Implement optional authentication if needed + +## ๐ Related Documentation + +- [Camera API Documentation](../camera-management-api/docs/API_DOCUMENTATION.md) +- [Streaming Guide](../camera-management-api/docs/guides/STREAMING_GUIDE.md) +- [Vision System README](VISION_SYSTEM_README.md) + +## ๐ค Support + +If you encounter issues: +1. Check the troubleshooting section above +2. Review browser console for error messages +3. Verify camera API is running and accessible +4. Test API endpoints directly with curl or Postman + +--- + +**Implementation Status**: โ Components Created | โ ๏ธ Dependencies Pending | ๏ฟฝ๏ฟฝ Ready for Testing + + + + diff --git a/management-dashboard-web-app/README.md b/management-dashboard-web-app/README.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/VISION_SYSTEM_README.md b/management-dashboard-web-app/VISION_SYSTEM_README.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/api-endpoints.http b/management-dashboard-web-app/api-endpoints.http old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/docs/AUTO_RECORDING_SETUP.md b/management-dashboard-web-app/docs/AUTO_RECORDING_SETUP.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/docs/MODULAR_ARCHITECTURE_GUIDE.md b/management-dashboard-web-app/docs/MODULAR_ARCHITECTURE_GUIDE.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/docs/MP4_FRONTEND_IMPLEMENTATION_STATUS.md b/management-dashboard-web-app/docs/MP4_FRONTEND_IMPLEMENTATION_STATUS.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/docs/VIDEO_STREAMING_INTEGRATION.md b/management-dashboard-web-app/docs/VIDEO_STREAMING_INTEGRATION.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/docs/VIDEO_STREAMING_INTEGRATION_COMPLETE.md b/management-dashboard-web-app/docs/VIDEO_STREAMING_INTEGRATION_COMPLETE.md old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/eslint.config.js b/management-dashboard-web-app/eslint.config.js old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/index.html b/management-dashboard-web-app/index.html old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/package-lock.json b/management-dashboard-web-app/package-lock.json old mode 100644 new mode 100755 index b41d8d3..d20e905 --- a/management-dashboard-web-app/package-lock.json +++ b/management-dashboard-web-app/package-lock.json @@ -13,19 +13,21 @@ "@tailwindcss/vite": "^4.1.11", "react": "^19.1.0", "react-dom": "^19.1.0", + "react-router-dom": "^6.28.0", "tailwindcss": "^4.1.11" }, "devDependencies": { "@eslint/js": "^9.30.1", "@types/react": "^19.1.8", "@types/react-dom": "^19.1.6", + "@types/react-router-dom": "^5.3.3", "@vitejs/plugin-react": "^4.6.0", "eslint": "^9.30.1", "eslint-plugin-react-hooks": "^5.2.0", "eslint-plugin-react-refresh": "^0.4.20", "globals": "^16.3.0", "typescript": "~5.8.3", - "typescript-eslint": "^8.35.1", + "typescript-eslint": "^8.28.1", "vite": "^7.0.4" } }, @@ -1054,6 +1056,15 @@ "node": ">= 8" } }, + "node_modules/@remix-run/router": { + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.23.0.tgz", + "integrity": "sha512-O3rHJzAQKamUz1fvE0Qaw0xSFqsA/yafi2iqeE0pvdFtCO1viYx8QL6f3Ln/aCCTLxs68SLf0KPM9eSeM8yBnA==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@rolldown/pluginutils": { "version": "1.0.0-beta.19", "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.19.tgz", @@ -1709,6 +1720,13 @@ "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", "license": "MIT" }, + "node_modules/@types/history": { + "version": "4.7.11", + "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", + "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -1751,6 +1769,29 @@ "@types/react": "^19.0.0" } }, + "node_modules/@types/react-router": { + "version": "5.1.20", + "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", + "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/history": "^4.7.11", + "@types/react": "*" + } + }, + "node_modules/@types/react-router-dom": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", + "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/history": "^4.7.11", + "@types/react": "*", + "@types/react-router": "*" + } + }, "node_modules/@types/ws": { "version": "8.18.1", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", @@ -3562,6 +3603,38 @@ "node": ">=0.10.0" } }, + "node_modules/react-router": { + "version": "6.30.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.30.1.tgz", + "integrity": "sha512-X1m21aEmxGXqENEPG3T6u0Th7g0aS4ZmoNynhbs+Cn+q+QGTLt+d5IQ2bHAXKzKcxGJjxACpVbnYQSCRcfxHlQ==", + "license": "MIT", + "dependencies": { + "@remix-run/router": "1.23.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "react": ">=16.8" + } + }, + "node_modules/react-router-dom": { + "version": "6.30.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.30.1.tgz", + "integrity": "sha512-llKsgOkZdbPU1Eg3zK8lCn+sjD9wMRZZPuzmdWWX5SUs8OFkN5HnFVC0u5KMeMaC9aoancFI/KoLuKPqN+hxHw==", + "license": "MIT", + "dependencies": { + "@remix-run/router": "1.23.0", + "react-router": "6.30.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "react": ">=16.8", + "react-dom": ">=16.8" + } + }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", diff --git a/management-dashboard-web-app/package.json b/management-dashboard-web-app/package.json old mode 100644 new mode 100755 index 2110d3d..fb0ccb7 --- a/management-dashboard-web-app/package.json +++ b/management-dashboard-web-app/package.json @@ -6,7 +6,7 @@ "scripts": { "dev": "vite", "build": "tsc -b && vite build", - "lint": "eslint .", + "lint": "eslint", "preview": "vite preview" }, "dependencies": { @@ -15,19 +15,21 @@ "@tailwindcss/vite": "^4.1.11", "react": "^19.1.0", "react-dom": "^19.1.0", + "react-router-dom": "^6.28.0", "tailwindcss": "^4.1.11" }, "devDependencies": { "@eslint/js": "^9.30.1", "@types/react": "^19.1.8", "@types/react-dom": "^19.1.6", + "@types/react-router-dom": "^5.3.3", "@vitejs/plugin-react": "^4.6.0", "eslint": "^9.30.1", "eslint-plugin-react-hooks": "^5.2.0", "eslint-plugin-react-refresh": "^0.4.20", "globals": "^16.3.0", "typescript": "~5.8.3", - "typescript-eslint": "^8.35.1", + "typescript-eslint": "^8.28.1", "vite": "^7.0.4" } -} +} \ No newline at end of file diff --git a/management-dashboard-web-app/phase_2_experimental_run_sheet.csv b/management-dashboard-web-app/phase_2_experimental_run_sheet.csv old mode 100644 new mode 100755 diff --git a/management-dashboard-web-app/public/camera-test.html b/management-dashboard-web-app/public/camera-test.html new file mode 100755 index 0000000..faaf55a --- /dev/null +++ b/management-dashboard-web-app/public/camera-test.html @@ -0,0 +1,119 @@ + + + +
+ + +This page helps you test the new camera live view routes that don't require authentication.
+Note: Make sure the React app is running and the camera API is accessible.
+Click the links below to test different camera routes:
+ + Camera 1 Live View + Camera 2 Live View + Camera 3 Live View + Camera 10 Live View +The camera routes use these backend API endpoints:
+POST /cameras/{camera_name}/start-stream - Start streamingGET /cameras/{camera_name}/stream - Get MJPEG streamPOST /cameras/{camera_name}/stop-stream - Stop streamingCamera number must be in format: camera1, camera2, etc.
+Starting camera stream...
+{error}
+ +