5f92340c0c
Milestone 72 phase A (clarity wins, no schema change): - Add shared metric_style() macro in _macros.html: colours a numeric metric amber (>=warn) / red (>=crit) on the value ITSELF, not just the status dot. Defaults 80/90 for percentage gauges; load /core uses warn 80 / crit 100. Applied to CPU/mem/disk across host_agent panel + fleet widget + the unified hosts-overview widget. - Link every host reference to the host hub (/hosts/<id>) in ping, dns, hosts-overview, host_agent fleet, and uptime widgets; status widget entries link to their own detail_url. All guarded on session.user_id so the public share view degrades to plain text (the bare href carries no share token). - Fix truncation: title= tooltips on all names that ellipsis, plus a hover underline affordance on the now-clickable ping-name links. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
36 lines
1.4 KiB
HTML
36 lines
1.4 KiB
HTML
{% if hosts %}
|
|
{% for host in hosts %}
|
|
{% set d = latest.get(host.id) %}
|
|
<div class="ping-row">
|
|
<div class="ping-meta">
|
|
{# Link to the host hub for logged-in users; plain text on the public share view (no auth, no token on the href). #}
|
|
{% if session.user_id %}
|
|
<a class="ping-name" href="/hosts/{{ host.id }}" title="{{ host.name }}"
|
|
style="color:inherit;text-decoration:none;">{{ host.name }}</a>
|
|
{% else %}
|
|
<span class="ping-name" title="{{ host.name }}">{{ host.name }}</span>
|
|
{% endif %}
|
|
<span class="ping-addr">{{ host.address }}</span>
|
|
</div>
|
|
<div style="flex:1;">
|
|
{% if d is none %}
|
|
<span style="color:var(--text-dim);font-size:0.85rem;">—</span>
|
|
{% elif d.status.value == 'resolved' %}
|
|
<span class="dot dot-up" style="margin-right:0.5rem;"></span>
|
|
<span style="font-size:0.85rem;color:var(--green);">{{ d.resolved_ip or 'resolved' }}</span>
|
|
{% else %}
|
|
<span class="dot dot-down" style="margin-right:0.5rem;"></span>
|
|
<span style="font-size:0.85rem;color:var(--red);">Failed</span>
|
|
{% endif %}
|
|
</div>
|
|
<div class="ping-cur">
|
|
{% if d %}
|
|
<span style="color:var(--text-muted);font-size:0.75rem;">{{ d.resolved_at.strftime('%H:%M:%S') }} UTC</span>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
{% else %}
|
|
<p class="empty" style="padding:0.5rem 0;">No DNS checks yet. <a href="/hosts/">Enable DNS on a host →</a></p>
|
|
{% endif %}
|