Files
FabledSteward/steward/templates/timeline/_rows.html
T
bvandeusenandClaude Opus 5.5 4ea735d87c
CI / lint (push) Successful in 2s
CI / unit (push) Failing after 1m31s
CI / integration (push) Successful in 1m41s
CI / publish (push) Skipped
feat(timeline): one record of what happened to the infrastructure, newest first (#6348)
A stored log, timeline_entries, with one row per thing that happened. Each
source writes its row in the same transaction as its own record, so the
history outlives the 30/90/365-day retention of the tables it points to:

- alert events (core/alerts._add_event): fired, resolved, acknowledged,
  went silent, readings back;
- finished Ansible runs (executor, and the startup sweep of interrupted
  runs): changed something, changed nothing, failed, dry run;
- audit rows (core/audit.log_audit): Steward's settings, users and access,
  sign-ins, backups. Actions another writer records are left to it.

Entries carry a kind (fixed) and an area (Service, Host OS, Hardware,
Storage, Network, Security, Monitoring). Settings → Timeline edits the
areas and each type's area and visibility; both are applied when the
timeline is read, so a change re-sorts past entries and a hidden type
comes back when shown. Kept forever unless a retention is set.

The first start fills the timeline from the last 90 days of records once,
skipping any already covered. A host rename carries its entries.

UI: Timeline in the sidebar (filter by host, area, kind; scrolls on), a
History card on each host page. MCP: get_timeline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 17:03:05 -04:00

22 lines
1.0 KiB
HTML

{# timeline/_rows.html — one page of the timeline's rows, then the sentinel
that loads the next page as the reader nears it (core.paging). A divider
row opens each recency group: Today, Yesterday, Last 7 days, Older. #}
{% from "_macros.html" import scroll_more, scroll_end %}
{% from "timeline/_entry.html" import entry_what, entry_where %}
{% for item in items %}
{% set e = item.entry %}
{% if item.opens_group %}<tr class="table-divider"><th colspan="5" scope="rowgroup">{{ item.group }}</th></tr>{% endif %}
<tr>
<td class="nowrap">{{ e.at|when }}</td>
<td>{{ entry_what(item) }}</td>
<td>{{ entry_where(e) }}</td>
<td class="nowrap">{{ e.actor }}</td>
<td class="nowrap"><span class="chip">{{ item.area_label }}</span></td>
</tr>
{% endfor %}
{% if after %}
{{ scroll_more("/timeline/?before=" ~ (after|urlencode) ~ "&" ~ (keep|urlencode) ~ "&group=" ~ (last_group|urlencode), cols=5) }}
{% else %}
{{ scroll_end(cols=5) }}
{% endif %}