{% extends "ui/_layout.html" %} {% block title %}{{ m.mac }} - bty-web{% endblock %} {% block subnav %} {# In-page jump links to this machine's cards, separated by vertical rules. The Inventory link only shows once the box has reported. #} {% endblock %} {% block content %}
{{ m.mac }}{% if m.hostname %} {{ m.hostname }}{% endif %}
{% set bound = (images | selectattr('bty_image_ref', 'equalto', m.bty_image_ref) | first) if m.bty_image_ref else none %}
Image
{% if bound %} {{ bound.name }} ({{ bound.format or "?" }}{% if bound.size_bytes %}, {{ bound.size_bytes | filesizeformat(true) }}{% endif %}) {% elif m.bty_image_ref %} ref {{ m.bty_image_ref[:12] }}... (no catalog entry) {% else %} none (boots from the local disk) {% endif %}
Discovered
{{ m.discovered_at | fmt_ts if m.discovered_at else "-" }}
Last seen
{{ m.last_seen_at | fmt_ts if m.last_seen_at else "-" }}{% if m.last_seen_ip %} from {{ m.last_seen_ip }}{% endif %}
Last flashed
{{ m.last_flashed_at | fmt_ts if m.last_flashed_at else "-" }}
Created
{{ m.created_at | fmt_ts }}
Updated
{{ m.updated_at | fmt_ts }}
{# Machine Inventory: what the box reported about itself on its last live-env boot -- hardware highlights (lshw) + the drive list (lsblk), each with a raw JSON download for other tools. Shown once an inventory exists (auto-discovered boxes report on their bty-inventory boot). #} {% if m.hw_lshw or m.known_disks %}
Machine Inventory {% if m.hw_lshw %} lshw.json {% endif %} {% if m.known_disks %} disks.json {% endif %}
{% if hw and hw.cpu %}
CPU
{{ hw.cpu }}{% if hw.cpu_cores %} ({{ hw.cpu_cores }} core{{ "s" if hw.cpu_cores != 1 else "" }}){% endif %}
{% endif %} {% if hw and hw.memory %}
Memory
{{ hw.memory }}{% if hw.mem_modules %} ({{ hw.mem_modules }} module{{ "s" if hw.mem_modules != 1 else "" }}){% endif %}
{% endif %} {% if hw and hw.nics %}
Network
    {% for nic in hw.nics %} {% set is_identifying = nic.mac and m.mac and nic.mac|lower == m.mac|lower %}
  • {% if nic.mac %}{{ nic.mac }}{% endif %} {% if nic.name %} {{ nic.name }}{% endif %} {% if nic.product %} - {{ nic.product }}{% endif %} {% if is_identifying %} this machine{% endif %}
  • {% endfor %}
{% endif %} {% if m.known_disks %}
Drives
    {% for d in m.known_disks %}
  • {{ d.path }} {% if d.size %} {{ d.size }}{% endif %} {% if d.model %} {{ d.model }}{% endif %} {% if d.serial %} serial {{ d.serial }}{% endif %} {%- if d.tran %} ({{ d.tran }}){% endif %}{% if d.removable %} [removable]{% endif %}
  • {% endfor %}
{% endif %}
{% if m.hw_lshw %}Hardware via lshw -json{% endif %}{% if m.hw_lshw and m.known_disks %}; {% endif %}{% if m.known_disks %}drives via lsblk{% endif %}, reported {{ (m.hw_lshw_at or m.known_disks_at) | fmt_ts if (m.hw_lshw_at or m.known_disks_at) else "-" }} on the box's last live-env boot. Full trees in the downloads above.
{% endif %}
Assignment
{# Two tiers of config (see docs/concepts "general vs per-mode"): the boot mode is the MODE selector; the "Machine configuration" section below holds the machine's GENERAL properties (image, target disk, sanboot drive, hostname). Each policy READS a subset of those. The inline script DIMS + annotates the fields the selected policy ignores rather than hiding them, so the general/consumed-by split stays visible to the operator. #}
{% set _state = m | boot_state %} {% if _state %}
Current state: {{ _state }} - derived from the mode + whether the box has booted the flasher; the mode is your intent, this is where it is in the cycle.
{% endif %}
ipxe-exit: boot the local disk. On UEFI, hand control back to the firmware boot order (which boots the disk's EFI loader); on legacy BIOS, iPXE sanboots the drive below (defaults to the first disk). The default for an assigned box. bty-flash-always: PXE boots chain into the live env so the box re-flashes the assigned image every cycle, then boots the just-flashed disk before the next reflash (per-job CI cadence). bty-flash-once: flashes on the next PXE boot only, then boots the disk on every boot after that - the mode stays bty-flash-once (re-save the machine to flash again). bty-tui: PXE boots chain into the live env and bty on tty1 drops the operator into the wizard to pick an image by hand. bty-inventory: each boot chains the live env just to re-report this box's disks, then boots the disk - so swapped hardware is picked up. The auto-discovery default for unknown MACs; it's how the Target disk dropdown below gets populated.

Machine configuration

Properties of this machine, independent of policy. The selected boot mode reads the subset it needs; fields it ignores are dimmed and marked not used. Values persist across policy changes (e.g. a sanboot drive you calibrated under sanboot still applies once you switch to a flash policy).

Image bound for flashing. Read by bty-flash-always and bty-flash-once.
{% if m.known_disks %}
Last inventory reported {{ m.known_disks_at | fmt_ts }}. The live env's flash service matches the picked SERIAL against current disks; a swapped or renumbered drive refuses to flash rather than risking the wrong target.
{% else %}
No disk inventory yet for this machine. Set boot_mode=bty-tui above and power-cycle the machine; bty will report its disks to bty-web on startup and this dropdown will populate.
{% endif %}
Which local disk iPXE boots whenever bty sanboots this machine: 0x80 is the first disk, 0x81 the second, and so on. Leave blank for the default (0x80). iPXE selects by BIOS drive number, not by the Linux serial used for flashing. Read by the sanboot policy, the one-shot disk boot after each bty-flash-always reflash, and a bty-flash-once machine that settles to sanboot.
Cosmetic label; not consumed by the boot chain.
{# Per-MAC event slice. Filtered to ``subject_kind=machine`` + ``subject_id=this MAC`` server-side; the link forwards the same filter to /ui/events for drill-down. #} {% with events=machine_events, title="Recent Events", card_id="machine-activity", link_to_full="/ui/events?subject_kind=machine&subject_id=" + m.mac %} {% include "ui/_events_card.html" %} {% endwith %} {% endblock %}