{% extends "ui/_layout.html" %} {% from "ui/_table_macros.html" import pagination_inline with context %} {% block title %}Event log - bty-web{% endblock %} {% block subnav %} {% endblock %} {% block intro %} {% from "ui/_intro_box.html" import render as intro_box %} {% call intro_box() %} Append-only audit trail of operator + machine activity: PXE check-ins, image uploads, catalog edits, settings changes, auth attempts. Type a substring in the search box to filter by kind, subject, actor, source IP, or summary text. Newest first. {% endcall %} {% endblock %} {% block content %}
{# Card header: "Events | Filter: " flexes to fill the left side; pagination + bulk actions sit on the right. The search does substring match across kind, subject_kind, subject_id, actor, source_ip, and summary so every previously-dropdown pivot is reachable by typing the value. #}
{% if page.per_page != per_page_choices[0] %}{% endif %} Events {% if q %} Clear {% endif %}
{{ pagination_inline(page, preserved, label='events') }}
{# Bulk-action row: lives in its own thin band below the filter/pagination card header so the checkbox actions (Ack / Clear) on the table's left column have a clear home. Anchored to the right so it visually pairs with the per-row Ack toggle column. #}
Selected rows:
{% for e in events %} {% endfor %}
When Kind Summary Subject Actor Source IP Ack
{{ e.ts | fmt_ts }} {# Badge colour: failure kinds (anything ending ``.failed`` or ``_failed``) override to danger so they pop in the log. Otherwise a per-family map; unknown families fall back to the neutral light badge. #} {% set family = e.kind.split('.')[0] %} {% set badge_map = { 'machine': 'bg-info text-dark', 'image': 'bg-primary', 'catalog': 'bg-secondary', 'boot': 'bg-warning text-dark', 'settings': 'bg-dark', 'auth': 'bg-success', } %} {% if e.kind.endswith('.failed') or e.kind.endswith('_failed') %} {% set badge = 'bg-danger' %} {% else %} {% set badge = badge_map.get(family, 'bg-light text-dark border') %} {% endif %} {{ e.kind }} {{ e.summary | linkify }} {% if e.subject_kind == "machine" and e.subject_id %} {# Machine subjects link directly to the per-machine detail page (the per-machine events card is already there). #} {{ e.subject_id }} {% elif e.subject_id %} {# Non-machine subjects (image, catalog, boot, settings) don't have a detail page; pivot to the timeline filtered by this subject so the operator can see everything that touched it. #} {{ e.subject_id }} {% else %} - {% endif %} {% if e.actor %} {# Click to pivot: filter the timeline down to rows with this actor (operator / system / pxe-client). #} {{ e.actor }} {% else %} - {% endif %} {% if e.source_ip %} {# Click to pivot: same /ui/events page filtered down to this IP. Useful for "what else did this workstation / target do?". #} {{ e.source_ip }} {% else %} - {% endif %} {# Per-row toggle: Acknowledge when unacked, Clear when acked. Acknowledging a failure clears it from the dashboard Health Monitoring tripwire; clearing puts it back. Works on any event. #} {% if e.acknowledged %} {% else %} {% endif %}
{% endblock %}