{% import "macros.html.j2" as macros %}
<h2>Webcams</h2>
{% with printers = ctx.db.list_printers() %}
<div class="webcams row">
  {% for printer in printers if printer.stream_url %}
    <div class="u-flex1 webcam" style="max-width: calc(100% / {{printers|length}})">
      <label>{{ printer.name }}</label>
      <img id="printer_{{printer.id}}_stream" src="{{ printer.stream_url }}" style="max-width: 100%;" />
      <span><label>Status</label>{{printer.status}}, {% if printer.enabled %}accepting jobs{%else%}not scheduling{%endif%}</span>
      <span><label>Loaded material</label>{{printer.filament_name}}</span>
      <span><label>Machine</label>{{printer.machine_name}}</span>
      <span><label>Nozzle</label>{{ "%.2f"|format(printer.nozzle_diameter) }}mm</span>
      <span><label>Limits</label>{{printer.limit_x}}mm x{{printer.limit_y}}mm x{{printer.limit_z}}mm, bed {{printer.limit_bed}}c, end {{printer.limit_hotend}}c</span>
    </div>
  {% endfor %}
</div>
{% endwith %}
