Files
bvandeusenandClaude Opus 5.5 e98dd10556
CI / lint (push) Successful in 2s
CI / integration (push) Successful in 1m8s
CI / unit (push) Successful in 1m27s
CI / publish (push) Successful in 1m2s
fix(ui): a reading's age no longer puts a <time> element inside a title attribute (#5467)
The `when` filter returns a <time> element, so title="{{ at|when }}" wrote raw
markup into the attribute. That broke the hover text, and in the rule form's
metric preview (#5475) it leaked a stray `">` into the page. `ago` already
carries the exact time as its own tooltip, so both places drop the title.
Also fixes #5467's page test, which needed the escaped apostrophe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 14:06:58 -04:00

21 lines
990 B
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{# alerts/_metric_preview.html — what the chosen metric reads (#5475), so a
threshold is set against real numbers: now, and the last day's hourly
averages with the lowest and highest reading. A rule covering hosts
previews on the host picked above it, or none. #}
{% if preview %}
<div class="metric-preview">
<span>Now <strong>{{ metric_value(metric, preview.now) }}</strong>
<span class="tone-dim">{{ preview.at|ago }}</span></span>
{% if preview.series|length > 1 %}
<span class="metric-preview-day">
<span class="tone-dim">last 24 h</span> {{ metric_value(metric, preview.low) }} – {{ metric_value(metric, preview.high) }}
<span class="metric-preview-spark" aria-hidden="true">{{ preview.spark|safe }}</span>
</span>
{% endif %}
</div>
{% elif metric and resource and not preview_read %}
<p class="field-hint">Reading the last day…</p>
{% elif metric and resource %}
<p class="field-hint">No reading of this yet from {{ resource }}.</p>
{% endif %}