mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-18 21:47:39 +02:00
fix: queue stuck on "Busy" for "Any Model" jobs (#435)
When a print was queued with "Any [Model]", the queue widget only queried items with printer_id=X after dispatch, missing the next pending model-based item (printer_id IS NULL, target_model="P1S"). The "Clear Plate & Start Next" button never appeared, leaving the scheduler stuck reporting "Busy". Add optional target_model query parameter to GET /queue/. When combined with printer_id, uses OR logic to also return unassigned items whose target_model matches. The frontend now passes the printer's model through PrinterQueueWidget to this query.
This commit is contained in:
@@ -9,18 +9,19 @@ import { formatRelativeTime } from '../utils/date';
|
||||
|
||||
interface PrinterQueueWidgetProps {
|
||||
printerId: number;
|
||||
printerModel?: string | null;
|
||||
printerState?: string | null;
|
||||
plateCleared?: boolean;
|
||||
}
|
||||
|
||||
export function PrinterQueueWidget({ printerId, printerState, plateCleared }: PrinterQueueWidgetProps) {
|
||||
export function PrinterQueueWidget({ printerId, printerModel, printerState, plateCleared }: PrinterQueueWidgetProps) {
|
||||
const { t } = useTranslation();
|
||||
const queryClient = useQueryClient();
|
||||
const { showToast } = useToast();
|
||||
const { hasPermission } = useAuth();
|
||||
const { data: queue } = useQuery({
|
||||
queryKey: ['queue', printerId, 'pending'],
|
||||
queryFn: () => api.getQueue(printerId, 'pending'),
|
||||
queryKey: ['queue', printerId, 'pending', printerModel],
|
||||
queryFn: () => api.getQueue(printerId, 'pending', printerModel || undefined),
|
||||
refetchInterval: 30000,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user