{% extends "ui/_layout.html" %} {% block title %}Event log - bty-web{% endblock %} {% block subnav %} {% set right_html %}{{ events|length }} on this page{% endset %} {% with sections=[{"key": "list", "label": "List", "icon": "list-ul", "href": "/ui/events"}], active="list", right_html=right_html %} {% include "ui/_subnav.html" %} {% endwith %} {% 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. Filter by kind / subject / actor / source IP via the form below. Newest first. {% endcall %} {% endblock %} {% block content %}
{# Filter form. GET so links stay shareable + back-button friendly. #}
{% if not events %}
{% if kind or subject_kind or subject_id or actor or source_ip or failed_only %} No events match the current filter. Clear filter to see all events. {% else %} The log is empty. Rows appear as machines check in, operators make changes, and async-managers complete. If you've just started bty-web, hit a few endpoints and refresh. {% endif %}
{% else %}
{% for e in events %} {% endfor %}
When Kind Summary Subject Actor Source IP
{{ 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 }} {% 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 %}
{% endif %} {% endblock %}