feat(dashboard): threshold colors on Hosts-Overview ping + 24h uptime
CI / lint (push) Successful in 3s
CI / unit (push) Successful in 8s
CI / integration (push) Successful in 2m18s
CI / publish (push) Successful in 55s

Add an inverted uptime_style macro (low-is-bad mirror of metric_style) and
color the inline ping latency (warn 100ms / crit 250ms) and 24h uptime values
in the Hosts-Overview widget, which were the remaining uncolored metrics.
(Uptime/SLA + Ping widgets already colored degraded values.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-17 20:41:44 -04:00
parent ae03f09234
commit e446b7099e
2 changed files with 12 additions and 3 deletions
+9
View File
@@ -29,3 +29,12 @@
{%- elif value is not none and value >= warn -%}color:var(--yellow);font-weight:600;
{%- endif -%}
{%- endmacro %}
{# Inverted emphasis for "higher is better" metrics like uptime %: amber below
`warn`, red below `crit`. The mirror of metric_style — same one-place-for-
thresholds discipline, opposite direction. Defaults suit SLA percentages. #}
{% macro uptime_style(value, warn=99.0, crit=95.0) -%}
{%- if value is not none and value < crit -%}color:var(--red);font-weight:700;
{%- elif value is not none and value < warn -%}color:var(--yellow);font-weight:600;
{%- endif -%}
{%- endmacro %}