Răsfoiți Sursa

Change header Reset button to do table soft reset instead of Docker restart

The Reset button (restart_alt icon) in the header now:
- Calls /force_stop to clear any stuck state
- Calls /soft_reset to reset the DLC32/ESP32
- Shows "Reset sent. Homing required." toast

This matches the behavior of the Reset button in TableControlPage.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
tuanchris 2 săptămâni în urmă
părinte
comite
6c863793c6
1 a modificat fișierele cu 8 adăugiri și 8 ștergeri
  1. 8 8
      frontend/src/components/layout/Layout.tsx

+ 8 - 8
frontend/src/components/layout/Layout.tsx

@@ -500,13 +500,13 @@ export function Layout() {
   }
 
   const handleRestart = async () => {
-    if (!confirm('Are you sure you want to restart Docker containers?')) return
-
     try {
-      await apiClient.post('/api/system/restart')
-      toast.success('Docker containers are restarting...')
+      // Force stop first to clear any stuck state
+      await apiClient.post('/force_stop')
+      await apiClient.post('/soft_reset')
+      toast.success('Reset sent. Homing required.')
     } catch {
-      toast.error('Failed to restart Docker containers')
+      toast.error('Failed to send reset')
     }
   }
 
@@ -1219,8 +1219,8 @@ export function Layout() {
               size="icon"
               onClick={handleRestart}
               className="rounded-full text-amber-500 hover:text-amber-600"
-              aria-label="Restart Docker"
-              title="Restart Docker"
+              aria-label="Reset Table"
+              title="Reset Table (requires homing)"
             >
               <span className="material-icons-outlined">restart_alt</span>
             </Button>
@@ -1299,7 +1299,7 @@ export function Layout() {
                     className="flex items-center gap-3 w-full px-3 py-2 text-sm rounded-md hover:bg-accent transition-colors text-amber-500"
                   >
                     <span className="material-icons-outlined text-xl">restart_alt</span>
-                    Restart Docker
+                    Reset Table
                   </button>
                   <button
                     onClick={() => {