mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-08 23:21:58 +02:00
feat(printers): per-printer Maintenance Mode toggle (#1476)
Operator-flipped out-of-service state per printer for three scenarios: parallel Bambuddy installs (dev + prod where the printer rejects all but one MQTT client), printers under repair, and temporary suspension. The backend Printer.is_active gate has shipped since day one and is already honoured by every consumer — MQTT (printer_manager), queue dispatch (print_scheduler, print_queue), metrics, scheduler, picker, backup, maintenance dashboard. The missing piece was UI exposure. Three entry points to flip is_active: - Three-dot overflow menu (Enter / Exit maintenance mode, wrench icon) - Exit button inside the in-card amber panel - Checkbox in EditPrinterModal Card UI: expanded mode shows an amber panel (Wrench + "In Maintenance" + subtitle + Exit) where the cover/progress container would normally render — same height, no layout shift. Compact mode shows an amber pill in place of the progress bar. Header pill swaps Connected/Offline for "Maintenance" and the diagnostic CTA is suppressed (deliberate state, not involuntary offline). HMS / Queue / Firmware pills fall away naturally via the existing status?.connected gates. Mid-print entry (RUNNING / PAUSE) triggers a confirmation dialog — disconnecting MQTT mid-print stops progress tracking and completion notifications for the in-flight job. Idle / FINISH / FAILED skip the dialog and toggle directly. Scope: no backend change, no new permission, no behaviour change for any other consumer. PrinterCreate.is_active?: boolean added to the TypeScript surface so the field flows through api.updatePrinter.
This commit is contained in:
@@ -522,6 +522,10 @@ export interface PrinterCreate {
|
||||
model?: string;
|
||||
location?: string;
|
||||
auto_archive?: boolean;
|
||||
// Maintenance Mode flag (#1476). Backend already gates MQTT, queue dispatch,
|
||||
// scheduler, metrics and the print picker on this; toggling via PATCH
|
||||
// /printers/{id} disconnects or reconnects MQTT accordingly.
|
||||
is_active?: boolean;
|
||||
external_camera_url?: string | null;
|
||||
external_camera_type?: string | null;
|
||||
external_camera_enabled?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user