{# Self panel rows (#105). Every row carries its number and limit as text: the meter is redundant reinforcement, never the only carrier of the reading (UI-09). An absent value says so rather than rendering as zero, because a metric nobody has published is not a measurement of nothing. #} {% macro bytes_mb(value) -%} {%- if value is none %}—{% else %}{{ '%.1f'|format(value / 1048576) }} MB{% endif -%} {%- endmacro %} {% macro age(seconds) -%} {%- if seconds is none %}never{% elif seconds < 90 %}{{ '%.0f'|format(seconds) }}s ago {%- elif seconds < 5400 %}{{ '%.0f'|format(seconds / 60) }}m ago {%- else %}{{ '%.1f'|format(seconds / 3600) }}h ago{% endif -%} {%- endmacro %} {% macro budget_row(row, formatted, limit_text) -%} {{ row.label }} {% if row.value is none %}not available yet {% else %}{{ formatted }} {% if row.limit %}of {{ limit_text }}{% else %}no threshold configured{% endif %} {% if row.pct is not none %}({{ '%.0f'|format(row.pct) }}%){% endif %} {% if row.tone == 'error' %}over {% elif row.tone == 'warn' %}near{% endif %} {% endif %} {% if row.fill_pct is not none %} {% endif %} {%- endmacro %}