Wiring up AMS module

This commit is contained in:
Martin Ziegler
2025-12-05 13:09:27 +01:00
parent 720e1c459a
commit f5e0395375
5 changed files with 12 additions and 10 deletions
@@ -1170,13 +1170,14 @@ export function AMSSectionDual({ printerId, printerModel, status, nozzleCount }:
<div className="flex-1" />
<div className="flex items-center gap-2">
{/* Unload button: disabled if not connected, printing, mutation pending, or no filament loaded */}
<button
onClick={handleUnload}
disabled={!isConnected || isPrinting || isLoading || trayNow === 255}
className={`px-7 py-2.5 rounded-lg text-sm transition-colors border ${
!isConnected || isPrinting || isLoading || trayNow === 255
? 'bg-white dark:bg-bambu-dark text-gray-400 dark:text-gray-500 border-gray-200 dark:border-bambu-dark-tertiary cursor-not-allowed'
: 'bg-bambu-green text-white border-bambu-green hover:bg-bambu-green-dark hover:border-bambu-green-dark'
? 'bg-bambu-gray-dark text-gray-500 border-bambu-gray-dark cursor-not-allowed'
: 'bg-bambu-dark-secondary text-white border-bambu-dark-tertiary hover:bg-bambu-dark'
}`}
>
{unloadMutation.isPending ? (
@@ -1185,13 +1186,14 @@ export function AMSSectionDual({ printerId, printerModel, status, nozzleCount }:
'Unload'
)}
</button>
{/* Load button: disabled if not connected, printing, mutation pending, no tray selected, or selected tray is already loaded */}
<button
onClick={handleLoad}
disabled={!isConnected || isPrinting || selectedTray === null || isLoading}
disabled={!isConnected || isPrinting || selectedTray === null || isLoading || selectedTray === trayNow}
className={`px-7 py-2.5 rounded-lg text-sm transition-colors border ${
!isConnected || isPrinting || selectedTray === null || isLoading
? 'bg-white dark:bg-bambu-dark text-gray-400 dark:text-gray-500 border-gray-200 dark:border-bambu-dark-tertiary cursor-not-allowed'
: 'bg-bambu-green text-white border-bambu-green hover:bg-bambu-green-dark hover:border-bambu-green-dark'
!isConnected || isPrinting || selectedTray === null || isLoading || selectedTray === trayNow
? 'bg-bambu-gray-dark text-gray-500 border-bambu-gray-dark cursor-not-allowed'
: 'bg-bambu-dark-secondary text-white border-bambu-dark-tertiary hover:bg-bambu-dark'
}`}
>
{loadMutation.isPending ? (
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -7,8 +7,8 @@
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png" />
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png" />
<script type="module" crossorigin src="/assets/index-Bt0Dm_0_.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BREH29lW.css">
<script type="module" crossorigin src="/assets/index-1a-urQlt.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-gD5e-c1O.css">
</head>
<body>
<div id="root"></div>