Update API endpoints for camera2 and enhance logging options in USDA Vision System

- Changed camera1 references to camera2 in API endpoint documentation for start and stop recording.
- Added debug and verbose logging options in the USDA Vision System to improve debugging capabilities.
- Updated TopNavbar component for improved user experience with cursor pointer styling.
This commit is contained in:
salirezav
2025-09-11 14:25:20 -04:00
parent 8e7b5b054f
commit f8d720964e
6 changed files with 21 additions and 6 deletions

View File

@@ -226,7 +226,7 @@ GET http://localhost:8000/cameras/camera2/status
############################################################################### ###############################################################################
### Start recording (with all optional parameters) ### Start recording (with all optional parameters)
POST http://localhost:8000/cameras/camera1/start-recording POST http://localhost:8000/cameras/camera2/start-recording
Content-Type: application/json Content-Type: application/json
{ {
@@ -273,7 +273,7 @@ Content-Type: application/json
### ###
### Start recording (empty body - all defaults) ### Start recording (empty body - all defaults)
POST http://localhost:8000/cameras/camera1/start-recording POST http://localhost:8000/cameras/camera2/start-recording
Content-Type: application/json Content-Type: application/json
{} {}
@@ -282,6 +282,7 @@ Content-Type: application/json
### Stop recording ### Stop recording
POST http://localhost:8000/cameras/camera1/stop-recording POST http://localhost:8000/cameras/camera1/stop-recording
### Stop recording
POST http://localhost:8000/cameras/camera2/stop-recording POST http://localhost:8000/cameras/camera2/stop-recording
# No request body required # No request body required
# Response: StopRecordingResponse # Response: StopRecordingResponse
@@ -533,7 +534,7 @@ Content-Type: application/json
### Start streaming for camera1 ### Start streaming for camera1
curl -X POST http://localhost:8000/cameras/camera1/start-stream curl -X POST http://exp-dash:8000/cameras/camera2/start-stream
# View live stream (open in browser) # View live stream (open in browser)
# http://localhost:8000/cameras/camera1/stream # http://localhost:8000/cameras/camera1/stream

View File

@@ -245,6 +245,8 @@ def main():
parser = argparse.ArgumentParser(description="USDA Vision Camera System") parser = argparse.ArgumentParser(description="USDA Vision Camera System")
parser.add_argument("--config", type=str, help="Path to configuration file", default="config.json") parser.add_argument("--config", type=str, help="Path to configuration file", default="config.json")
parser.add_argument("--log-level", type=str, choices=["DEBUG", "INFO", "WARNING", "ERROR"], help="Override log level", default=None) parser.add_argument("--log-level", type=str, choices=["DEBUG", "INFO", "WARNING", "ERROR"], help="Override log level", default=None)
parser.add_argument("--debug", action="store_true", help="Enable debug mode (sets log level to DEBUG)")
parser.add_argument("--verbose", action="store_true", help="Enable verbose logging (sets log level to DEBUG and enables additional debug output)")
args = parser.parse_args() args = parser.parse_args()
@@ -252,7 +254,13 @@ def main():
system = USDAVisionSystem(args.config) system = USDAVisionSystem(args.config)
# Override log level if specified # Override log level if specified
if args.log_level: if args.debug or args.verbose:
logging.getLogger().setLevel(logging.DEBUG)
# Enable debug mode in the system
if hasattr(system.config.system, 'debug_mode'):
system.config.system.debug_mode = True
print("🐛 Debug mode enabled - verbose logging active")
elif args.log_level:
logging.getLogger().setLevel(getattr(logging, args.log_level)) logging.getLogger().setLevel(getattr(logging, args.log_level))
try: try:

View File

@@ -208,3 +208,5 @@ If you encounter issues:

View File

@@ -23,3 +23,5 @@ export function CameraRoute({ cameraNumber }: CameraRouteProps) {

View File

@@ -132,3 +132,5 @@ export function LiveCameraView({ cameraName }: LiveCameraViewProps) {

View File

@@ -171,7 +171,7 @@ export function TopNavbar({
{/* Dropdown menu */} {/* Dropdown menu */}
{isUserMenuOpen && ( {isUserMenuOpen && (
<div className="absolute right-0 mt-[17px] flex w-[260px] flex-col rounded-2xl border border-gray-200 bg-white p-3 shadow-theme-lg dark:border-gray-800 dark:bg-gray-dark"> <div className="absolute right-0 mt-[17px] flex w-[260px] flex-col rounded-2xl border border-gray-200 bg-white p-3 shadow-theme-lg dark:border-gray-800 dark:bg-gray-dark z-50">
<div> <div>
<span className="block font-medium text-gray-700 text-theme-sm dark:text-gray-400"> <span className="block font-medium text-gray-700 text-theme-sm dark:text-gray-400">
{user.email.split('@')[0]} {user.email.split('@')[0]}
@@ -232,7 +232,7 @@ export function TopNavbar({
setIsUserMenuOpen(false) setIsUserMenuOpen(false)
onLogout() onLogout()
}} }}
className="flex items-center gap-3 px-3 py-2 mt-3 font-medium text-gray-700 rounded-lg group text-theme-sm hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-gray-300" className="flex items-center gap-3 px-3 py-2 mt-3 font-medium text-gray-700 rounded-lg group text-theme-sm hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-gray-300 cursor-pointer"
> >
<svg <svg
className="fill-gray-500 group-hover:fill-gray-700 dark:group-hover:fill-gray-300" className="fill-gray-500 group-hover:fill-gray-700 dark:group-hover:fill-gray-300"