{# prometheus/widget.html — the Prometheus dashboard widget (#5691): one target drawn by one template (template_view.render). A verdict naming the worst thing, then each block: its problems first with why, figures in their units beside a bar or the last day's bars, and the healthy rest packed after, past REST rows as "+N more healthy". #} {% from "_macros.html" import status_dot %} {% set REST = 6 %} {% set dot = {"crit": "crit", "warn": "warn", "ok": "ok", "dim": "paused"} %} {% set tone = {"crit": "tone-crit", "warn": "tone-warn", "ok": "tone-ok", "dim": "tone-dim"} %} {% macro shown(v) -%} {%- if v.moment %}{{ v.moment|ago }}{% elif v.text %}{{ v.text }}{% else %}—{% endif -%} {%- endmacro %} {% if problem %}
| {% for c in b.columns %} | {{ c }} | {% endfor %}
|---|---|
| {{ r.name }} | {% for c in r.cells %}{{ shown(c) }} | {% endfor %}
| Now | {% for c in b.columns %}{{ c }} | {% endfor %}|
|---|---|---|
| {{- status_dot(dot[r.tone]) -}} {{ r.name }} {%- if r.why %}{{ r.why }}{% endif %} |
{%- if r.history %}{% endif -%}
{{ shown(r) }}
{%- if r.bar is not none %} {% endif -%}
|
{% for c in r.cells %}{{ shown(c) }} | {% endfor %}