Files
FabledSteward/steward/templates/_macros.html
T
bvandeusen 591706bd39
CI / lint (push) Successful in 2s
CI / unit (push) Successful in 8s
CI / integration (push) Successful in 2m19s
CI / publish (push) Successful in 1m3s
feat(settings): configurable monitoring thresholds
Move the hardcoded warn/crit cutoffs into Settings -> Thresholds (DB-backed,
live, no restart). New thresholds.* keys + to_thresholds_cfg() + a
threshold_style(value, kind) jinja global that reads them; latency reuses the
existing ping good/warn keys, uptime is direction-aware (floors).

Replace the _macros metric_style/uptime_style macros (now removed) with the
global across Hosts-Overview, host_agent fleet + panel, Uptime/SLA widget, and
the ping page uptime column — all now honor the configured cutoffs. Uptime keeps
its green 'good' look when not degraded.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 20:52:58 -04:00

23 lines
1015 B
HTML
Raw 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.
{# Shared template macros. Import with: {% from "_macros.html" import crumbs %} #}
{# Breadcrumb trail. `items` is a list of (label, href) pairs, ordered root→current.
Intermediate items with a truthy href render as links; the last item (or any
item with an empty href) renders as plain current text. #}
{% macro crumbs(items) -%}
<nav class="breadcrumb" aria-label="Breadcrumb">
{%- for label, href in items -%}
{%- if loop.last -%}
<span class="breadcrumb-cur" aria-current="page">{{ label }}</span>
{%- elif href -%}
<a href="{{ href }}">{{ label }}</a><span class="breadcrumb-sep"></span>
{%- else -%}
<span>{{ label }}</span><span class="breadcrumb-sep"></span>
{%- endif -%}
{%- endfor -%}
</nav>
{%- endmacro %}
{# Metric threshold coloring moved to the `threshold_style(value, kind)` jinja
global (steward/core/settings.py + app.py), which reads operator-configurable
cutoffs from Settings → Thresholds. Call it as threshold_style(v, 'cpu'). #}