feat(dashboard): threshold colors on Hosts-Overview ping + 24h uptime
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:
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user