Просмотр исходного кода

Add missing endpoints to nginx proxy and improve connection indicator

- Add list_serial_ports, serial_status, cache-progress, rebuild_cache
  to nginx legacy endpoint proxy
- Improve header connection indicator with gray color for backend disconnected

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
tuanchris 3 недель назад
Родитель
Сommit
849494879b
2 измененных файлов с 15 добавлено и 3 удалено
  1. 14 2
      frontend/src/components/layout/Layout.tsx
  2. 1 1
      nginx.conf

+ 14 - 2
frontend/src/components/layout/Layout.tsx

@@ -797,8 +797,20 @@ export function Layout() {
             />
             <span className="font-semibold text-lg">{appName}</span>
             <span
-              className={`w-2 h-2 rounded-full ${isConnected ? 'bg-green-500 animate-pulse' : 'bg-red-500'}`}
-              title={isConnected ? 'Connected to table' : 'Disconnected from table'}
+              className={`w-2 h-2 rounded-full ${
+                !isBackendConnected
+                  ? 'bg-gray-400'
+                  : isConnected
+                    ? 'bg-green-500 animate-pulse'
+                    : 'bg-red-500'
+              }`}
+              title={
+                !isBackendConnected
+                  ? 'Backend not connected'
+                  : isConnected
+                    ? 'Table connected'
+                    : 'Table disconnected'
+              }
             />
           </Link>
           <div className="flex items-center gap-1">

+ 1 - 1
nginx.conf

@@ -42,7 +42,7 @@ server {
     }
 
     # All backend API endpoints (legacy non-/api/ routes)
-    location ~ ^/(list_theta_rho_files|preview_thr_batch|get_theta_rho_coordinates|upload_theta_rho|pause_execution|resume_execution|stop_execution|skip_pattern|set_speed|restart|shutdown|run_pattern|run_playlist|connect_device|disconnect_device|home_device|clear_sand|move_to_position|get_playlists|save_playlist|delete_playlist|rename_playlist|get_status) {
+    location ~ ^/(list_theta_rho_files|preview_thr_batch|get_theta_rho_coordinates|upload_theta_rho|pause_execution|resume_execution|stop_execution|skip_pattern|set_speed|restart|shutdown|run_pattern|run_playlist|connect_device|disconnect_device|home_device|clear_sand|move_to_position|get_playlists|save_playlist|delete_playlist|rename_playlist|get_status|list_serial_ports|serial_status|cache-progress|rebuild_cache) {
         proxy_pass http://backend:8080;
         proxy_set_header Host $host;
         proxy_set_header X-Real-IP $remote_addr;