@extends('layouts.app') @section('title', 'Print farm') @section('content') @php $display = app(\App\Services\Display::class); @endphp

Production

BamBuddy printers

Live state, progress and temperatures from the workshop.

Open BamBuddy ↗
@if($integrationError)@endif
@forelse($printers as $printer) @php $live = $printer['live'] ?? []; $progress = min(100, max(0, (float) ($live['progress'] ?? 0))); $printerErrors = is_array($live['hms_errors'] ?? null) ? $live['hms_errors'] : []; @endphp

{{ $printer['name'] ?? 'Printer' }}

{{ $printer['model'] ?? 'Bambu printer' }}

($live['connected'] ?? false), 'bg-amber-500/10 text-amber-200' => ! ($live['connected'] ?? false)])>{{ $live['state'] ?? $printer['status'] ?? 'Unavailable' }}

Current job

{{ $live['current_print'] ?? $live['subtask_name'] ?? 'No active job' }}

{{ number_format($progress, 0) }}%
@if(! empty($live['total_layers']))

Layer {{ $live['layer_num'] ?? 0 }} of {{ $live['total_layers'] }}

@endif
Nozzle
{{ isset($live['temperatures']['nozzle']) ? $live['temperatures']['nozzle'].'°C' : '—' }}
Bed
{{ isset($live['temperatures']['bed']) ? $live['temperatures']['bed'].'°C' : '—' }}
Remaining
{{ isset($live['remaining_time']) ? $display->duration($live['remaining_time'] * 60) : '—' }}
@foreach(($live['ams'] ?? []) as $unit)
{{ ($unit['is_ams_ht'] ?? false) ? 'AMS HT' : 'AMS' }} {{ ($unit['id'] ?? 0) + 1 }}@if(isset($unit['humidity']))Humidity {{ $unit['humidity'] }}%@endif @if(isset($unit['temp'])) · {{ $unit['temp'] }}°C @endif
@foreach(($unit['tray'] ?? []) as $tray)@php $loaded = ($tray['exists'] ?? false) && filled($tray['tray_type'] ?? null); $colour = preg_match('/^[0-9A-Fa-f]{6}/', (string) ($tray['tray_color'] ?? '')) ? '#'.substr($tray['tray_color'], 0, 6) : '#1e293b'; $remain = (int) ($tray['remain'] ?? 0); @endphp
@if($loaded)

{{ $tray['tray_type'] }}

{{ $remain > 0 ? $remain.'%' : '—' }}

@else

Empty

@endif
@endforeach
@endforeach @if(count($printerErrors))

{{ count($printerErrors) }} printer alert{{ count($printerErrors) === 1 ? '' : 's' }} · {{ $printerErrors[0]['description'] ?? 'Open BamBuddy for details' }}

@endif
@empty
No printers returned by BamBuddy.
@endforelse
@if(! $integrationError)

Print queue

Jobs waiting for a printer.

{{ count($queue) }} queued
@forelse($queue as $job)

{{ $job['archive_name'] ?? $job['library_file_name'] ?? 'Print job' }}

{{ $job['printer_name'] ?? $job['target_model'] ?? 'Any printer' }}@if(! empty($job['filament_type'])) · {{ $job['filament_type'] }}@endif @if(! empty($job['print_time_seconds'])) · {{ $display->duration($job['print_time_seconds']) }}@endif

{{ $job['waiting_reason'] ?? ucfirst((string) ($job['status'] ?? 'pending')) }}
@empty

The queue is empty.

@endforelse
@if($stats)
@foreach([['Total prints', $stats['total_prints'] ?? 0], ['Successful', $stats['successful_prints'] ?? 0], ['Failed', $stats['failed_prints'] ?? 0], ['Print time', number_format((float) ($stats['total_print_time_hours'] ?? 0), 1).' h'], ['Filament used', number_format((float) ($stats['total_filament_grams'] ?? 0) / 1000, 2).' kg']] as [$label, $value])

{{ $label }}

{{ $value }}

@endforeach
@endif

Recent prints

Latest archived jobs from BamBuddy.

@forelse($recentPrints as $archive)@php $status = (string) ($archive['status'] ?? 'unknown'); @endphp @empty@endforelse
PrintPrinterStatusFilamentDurationCompleted
{{ $archive['print_name'] ?? $archive['filename'] ?? 'Print' }}{{ collect($printers)->firstWhere('id', $archive['printer_id'] ?? null)['name'] ?? '—' }} $status === 'completed', 'bg-rose-500/10 text-rose-300' => $status === 'failed', 'bg-amber-500/10 text-amber-200' => ! in_array($status, ['completed', 'failed'], true)])>{{ ucfirst($status) }}{{ $archive['filament_type'] ?? '—' }}@if(! empty($archive['filament_used_grams'])) · {{ number_format((float) $archive['filament_used_grams'], 0) }} g @endif{{ $display->duration($archive['actual_time_seconds'] ?? $archive['print_time_seconds'] ?? null) }}{{ $display->dateTime($archive['completed_at'] ?? $archive['started_at'] ?? null) }}
No archived prints yet.
@endif @endsection