From eefa38cc757e1e680d15fd2bdd36f237652749ca Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 17 Jun 2026 20:44:56 -0400 Subject: [PATCH] feat(host_agent): in-widget 1h/6h/24h time-range toggle on history graph Add a live range switch to the history widget that re-requests the fragment without entering edit mode. It rewrites the parent cell's hx-get so the choice survives polling (htmx re-reads the attribute each poll), then fetches at once. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../host_agent/templates/widget_history.html | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/plugins/host_agent/templates/widget_history.html b/plugins/host_agent/templates/widget_history.html index 1bd73a8..1c13783 100644 --- a/plugins/host_agent/templates/widget_history.html +++ b/plugins/host_agent/templates/widget_history.html @@ -12,20 +12,38 @@ {% else %}
- {# Name the host the graph represents — the panel title is generic. #} -
+ {# Name the host the graph represents (panel title is generic) + a live range + toggle that re-requests this widget without entering edit mode. #} +
{% if session.user_id %} {{ host.name }} {% else %} {{ host.name }} {% endif %} - · last {{ hours }}h + + {% for opt in [1, 6, 24] %} + + {% endfor %} +