diff --git a/steward/static/steward.css b/steward/static/steward.css index df3e360..93dff41 100644 --- a/steward/static/steward.css +++ b/steward/static/steward.css @@ -330,6 +330,7 @@ a.stat-tile:hover { border-color: var(--border-mid); background: var(--bg-elevat .ping-meta.mon-col-name { width:14rem; min-width:0; max-width:none; flex-shrink:0; } .mon-latest { width:7.5rem; flex-shrink:0; text-align:right; font-size:0.8rem; font-variant-numeric:tabular-nums; white-space:nowrap; } .mon-spark { color:var(--text-dim); margin-right:0.35rem; } +.mon-pills .pill { flex:1 1 0; min-width:4px; max-width:14px; } /* the strip fills its column */ .mon-up { width:4.2rem; flex-shrink:0; text-align:right; font-size:0.8rem; font-variant-numeric:tabular-nums; } .mon-tls { width:3.5rem; flex-shrink:0; text-align:right; font-size:0.78rem; font-variant-numeric:tabular-nums; } .mon-act { width:6.6rem; justify-content:flex-end; } diff --git a/steward/templates/monitors/rows.html b/steward/templates/monitors/rows.html index fa5bdca..f6b301d 100644 --- a/steward/templates/monitors/rows.html +++ b/steward/templates/monitors/rows.html @@ -14,13 +14,15 @@ {% if monitor_data %} {% set can_edit = session.user_role in ['operator', 'admin'] %} +{# TLS only when some monitor has a certificate: a column of dashes says nothing. #} +{% set any_tls = monitor_data | selectattr("tls_days", "ne", none) | list | length > 0 %}
{% for d in monitor_data %} @@ -40,7 +42,7 @@ {% endif %}
-
+
{% for _ in range([30 - d.heartbeat|length, 0]|max) %}{% endfor %} {% for h in d.heartbeat %}{% endfor %}
@@ -58,11 +60,13 @@
{% if u is none %}—{% else %}{{ "%.2f"|format(u) }}%{% endif %}
{% endfor %} + {% if any_tls %}
{% if d.tls_days is none %}— {% elif d.tls_days < 0 %}expired {% else %}{{ d.tls_days|round|int }}d{% endif %}
+ {% endif %} {% if can_edit %}
@@ -78,7 +82,7 @@
{% endfor %}
-

Last 30 checks: newest on the right; hover one for its result. Uptime is over the rolling window. TLS is days until the certificate expires (HTTPS monitors).

+

Last 30 checks: newest on the right; hover one for its result. Uptime is over the rolling window.{% if any_tls %} TLS is days until the certificate expires (HTTPS monitors).{% endif %}

{% else %}
{{ empty_state("No monitors yet. Add one, or attach checks to a host from its page.", "Add monitor" if session.user_role in ['operator', 'admin'] else none, "/monitors/new") }}
diff --git a/tests/core/test_monitors_page.py b/tests/core/test_monitors_page.py index 8ad92de..87995cc 100644 --- a/tests/core/test_monitors_page.py +++ b/tests/core/test_monitors_page.py @@ -87,6 +87,7 @@ async def test_a_viewer_gets_no_row_actions_and_an_empty_board_says_so(app): empty = await render_template("monitors/rows.html", monitor_data=[], counts=dict.fromkeys(("up", "degraded", "down", "pending", "paused"), 0)) assert "row-actions" not in page + assert ">TLS<" not in page # no monitor has a certificate: no column of dashes assert "No monitors yet" in empty and "/monitors/new" not in empty