Enhance camera management features: add debug endpoint for camera manager state, implement live camera routes without authentication, and improve logging for camera initialization and status checks. Update Docker configuration to include environment variables for the web app.
This commit is contained in:
119
management-dashboard-web-app/public/camera-test.html
Executable file
119
management-dashboard-web-app/public/camera-test.html
Executable file
@@ -0,0 +1,119 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Camera Route Test</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.test-links {
|
||||
background: white;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.test-links h2 {
|
||||
color: #333;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.test-links a {
|
||||
display: inline-block;
|
||||
margin: 10px 10px 10px 0;
|
||||
padding: 10px 20px;
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
border-radius: 5px;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
.test-links a:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
|
||||
.info {
|
||||
background: #e7f3ff;
|
||||
border: 1px solid #b3d9ff;
|
||||
border-radius: 5px;
|
||||
padding: 15px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.info h3 {
|
||||
margin-top: 0;
|
||||
color: #0066cc;
|
||||
}
|
||||
|
||||
.note {
|
||||
background: #fff3cd;
|
||||
border: 1px solid #ffeaa7;
|
||||
border-radius: 5px;
|
||||
padding: 15px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>🎥 Camera Route Test</h1>
|
||||
|
||||
<div class="info">
|
||||
<h3>Test the New Camera Routes</h3>
|
||||
<p>This page helps you test the new camera live view routes that don't require authentication.</p>
|
||||
<p><strong>Note:</strong> Make sure the React app is running and the camera API is accessible.</p>
|
||||
</div>
|
||||
|
||||
<div class="test-links">
|
||||
<h2>Test Camera Routes</h2>
|
||||
<p>Click the links below to test different camera routes:</p>
|
||||
|
||||
<a href="/camera1/live" target="_blank">Camera 1 Live View</a>
|
||||
<a href="/camera2/live" target="_blank">Camera 2 Live View</a>
|
||||
<a href="/camera3/live" target="_blank">Camera 3 Live View</a>
|
||||
<a href="/camera10/live" target="_blank">Camera 10 Live View</a>
|
||||
</div>
|
||||
|
||||
<div class="note">
|
||||
<h3>Expected Behavior</h3>
|
||||
<ul>
|
||||
<li>✅ <strong>Valid routes</strong> (like /camera1/live) should show the live camera feed</li>
|
||||
<li>❌ <strong>Invalid routes</strong> (like /camera/live) should show an error message</li>
|
||||
<li>🔒 <strong>Protected routes</strong> (like /) should redirect to login if not authenticated</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="info">
|
||||
<h3>API Endpoints</h3>
|
||||
<p>The camera routes use these backend API endpoints:</p>
|
||||
<ul>
|
||||
<li><code>POST /cameras/{camera_name}/start-stream</code> - Start streaming</li>
|
||||
<li><code>GET /cameras/{camera_name}/stream</code> - Get MJPEG stream</li>
|
||||
<li><code>POST /cameras/{camera_name}/stop-stream</code> - Stop streaming</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Add click tracking for analytics
|
||||
document.querySelectorAll('.test-links a').forEach(link => {
|
||||
link.addEventListener('click', function () {
|
||||
console.log('Testing camera route:', this.href);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
0
management-dashboard-web-app/public/vite.svg
Normal file → Executable file
0
management-dashboard-web-app/public/vite.svg
Normal file → Executable file
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Reference in New Issue
Block a user