{% extends "base.html" %}
{% block title %}Health{% endblock %}
{% block head %}{% endblock %}
{% block style %}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-top: 14px; }
.grid .card { display: flex; flex-direction: column; gap: 8px; }
.grid h2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.state { font-size: .78rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap;
border: 1px solid var(--line); background: var(--band); color: var(--ok); }
.state.down { color: var(--bad); background: var(--bad-soft); border-color: var(--bad-line); }
.big { font-size: 1.5rem; font-weight: 700; }
.meter { height: 10px; border-radius: 5px; background: var(--line-soft); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }
.meter i.high { background: var(--bad); }
{% endblock %}
{% macro state(up, yes='OK', no='DOWN') %}{{ yes if up else no }}{% endmacro %}
{% block content %}
{% set proxy = h.services.proxy %}{% set rec = h.services.recorder %}{% set worker = h.services.worker %}
Health
Printing {{ state(proxy.alive) }}
| Jobs today | {{ proxy.jobs_today if proxy.alive else '—' }} |
| Not printed today | {{ proxy.jobs_failed_today or 0 }} |
| Last job | {{ proxy.last_job_at|dt or '—' }} |
| Running since | {{ proxy.started_at|dt or '—' }} |
Printer {{ state(proxy.printer_reachable, 'REACHABLE', 'NOT ANSWERING' if proxy.printer_reachable is sameas false else 'UNKNOWN') }}
| Address | {{ h.printer_host }} |
| Last checked | {{ proxy.printer_checked_at|dt or '—' }} |
Camera {{ state(rec.alive and rec.status == 'recording', 'RECORDING', 'NOT RECORDING') }}
| Live picture | {{ 'On' if rec.live_picture else 'Off' }} |
| Mode | {{ rec.resolution or '—' }} @ {{ rec.fps or '—' }} fps · {{ {'h264_v4l2m2m': 'light (the Pi\'s video chip)', 'copy': 'light (the camera\'s own video)', 'libx264': 'standard'}.get(rec.encoder, rec.encoder or '—') }} |
| Timestamp in picture | {{ 'yes' if rec.overlay else 'no' }} |
| Buffer | {{ ((rec.buffer_seconds or 0) / 60)|round(1) }} min |
| Restarts | {{ rec.restarts or 0 }} |
Clips {{ state(worker.alive) }}
| Saved today | {{ h.today.clips_done or 0 }} |
| Waiting | {{ h.today.clips_pending or 0 }} |
| Failed today | {{ h.today.clips_failed or 0 }} |
| Delivery orders | {{ h.today.third_party or 0 }} of {{ h.today.jobs or 0 }} print jobs |
Storage {{ state(h.disk.percent is not none and h.disk.percent <= h.disk_limit, 'OK', 'NEARLY FULL') }}
{% if h.disk.percent is not none %}
{{ h.disk.percent }}% used
{{ h.disk.free_gb }} GB free of {{ h.disk.total_gb }} GB
{% else %}Not readable{% endif %}
{% if h.cloud_enabled %}
{% set up = h.services.uploader %}
Website {{ state(up.alive and up.linked, 'LINKED', 'NOT LINKED' if up.alive else 'DOWN') }}
| Store | {{ (up.store or {}).nickname or '—' }} |
| Last check-in | {{ up.last_poll_at|dt or '—' }} |
| Tickets waiting | {{ up.backlog or 0 }} |
| Last clip sent | {{ up.last_upload_at|dt or '—' }} |
{% endif %}
This BagCam
| BagCam address | {{ device.address or 'Not connected' }} |
| Device | {{ device.model or 'Not a Raspberry Pi' }} |
| Memory | {% if device.memory_gb %}{{ device.memory_gb|num }} GB{% else %}—{% endif %} |
| Software | {{ version }} |
Last errors
{% if h.errors %}
{% for e in h.errors %}
{{ e.service }} {{ e.at|dt }} | {{ e.message }} |
{% endfor %}
{% else %}None{% endif %}
{% endblock %}