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:
maziggy
2026-06-21 11:08:06 +02:00
parent 6b517ddc63
commit 36a16b8ae4
19 changed files with 468 additions and 62 deletions
+4
View File
@@ -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;