{% extends "base.html" %} {% import '_ui.html' as ui %} {% block title %}{{ session.serial }} - Imaging Session{% endblock %} {% set st = session.status or 'in_progress' %} {% set st_chip = {'succeeded': ('Succeeded', 'ok'), 'failed': ('Failed', 'fail')}.get(st, ('In progress', 'run')) %} {% set st_kind = {'succeeded': 'ok', 'failed': 'fail'}.get(st, 'run') %} {% set stage_idx = (session.stage_index or 0) | int(0) %} {% set stage_total = (session.stage_total or 0) | int(0) %} {% set history = session.stage_history or [] %} {# Support summary: built here so the copy button carries it (static/app.js handles .copy-btn[data-copy-text]). Same fields as the metadata list. #} {% set summary_lines = [ 'Serial: ' ~ session.serial, 'Status: ' ~ st, 'Hostname: ' ~ (session.hostname_target or '-'), 'IP: ' ~ (session.ip or '-'), 'MAC: ' ~ (session.mac or '-'), 'PC type: ' ~ (session.pctype or '-'), 'Machine #: ' ~ (session.machinenumber or '-'), 'Intune ID: ' ~ (session.intune_device_id or '-'), 'Started: ' ~ (session.started_at | local_dt(true)), 'Last update: ' ~ (session.last_updated | local_dt(true)), 'Stage: ' ~ stage_idx ~ '/' ~ (session.stage_total or '?') ~ ((' - ' ~ session.current_stage) if session.current_stage else ''), ] %} {% if session.previous_run_at %}{% set _ = summary_lines.append('Prior run: ' ~ (session.previous_run_at | local_dt(true))) %}{% endif %} {% if session.error %}{% set _ = summary_lines.append('Error: ' ~ session.error) %}{% endif %} {% if history %} {% set _ = summary_lines.append('') %}{% set _ = summary_lines.append('Stage timeline:') %} {% for h in history %}{% set _ = summary_lines.append(' - ' ~ (h.ts | local_dt(true)) ~ ' stage ' ~ h.stage_index ~ ' ' ~ h.status ~ ' ' ~ (h.current_stage or '')) %}{% endfor %} {% endif %} {% block extra_head %} {% endblock %} {% block content %}
Imaging

{{ session.serial }} {{ ui.chip(st_chip[0], st_chip[1]) }}

Stage {{ stage_idx }} of {{ session.stage_total or '?' }}{% if session.current_stage %}: {{ session.current_stage }}{% endif %} | updated {{ session.last_updated | local_dt(true) }}
{% if stage_total %}
{{ ui.track(stage_total, stage_idx, st_kind) }}
{% endif %}
Back to imaging
{% if session.error %} {% endif %}
Machine number
{{ session.machinenumber or '-' }}
Hostname
{{ session.hostname_target or '-' }}
IP
{{ session.ip or '-' }}
{% if session.mac %}
{{ session.mac }}
{% endif %}
PC type
{{ session.pctype or '-' }}
Intune ID
{% if session.intune_device_id %}
{{ session.intune_device_id }}
{% else %}
-
Not enrolled yet
{% endif %}

Stage history

{% if history %}
    {% for h in history %} {% set hk = {'succeeded': 'ok', 'failed': 'fail'}.get(h.status, 'run' if loop.last else '') %}
  1. {{ h.current_stage or ('Stage ' ~ h.stage_index) }} {{ h.ts | local_dt(true) }} Stage {{ h.stage_index }}{% if stage_total %} of {{ stage_total }}{% endif %} {% if h.status == 'failed' %}{{ ui.chip('Failed', 'fail') }}{% elif h.status == 'succeeded' %}{{ ui.chip('Succeeded', 'ok') }}{% endif %}
  2. {% endfor %}
{% else %}

No stage transitions recorded yet. The client only logs a row when stage_index advances or status flips to succeeded or failed.

{% endif %}

Session

Serial
{{ session.serial }}
MAC
{{ session.mac or '-' }}
Started
{{ session.started_at | local_dt(true) }}
Last update
{{ session.last_updated | local_dt(true) }}
{% if session.previous_run_at %}
Prior run
{{ session.previous_run_at | local_dt(true) }}
{% endif %} {% if session.source %}
Source
{{ session.source }}
{% endif %}

Full log

{% if full_log_truncated %}{{ ui.chip('Truncated: last 1 MB', 'warn') }}{% endif %}
{% if full_log %}{% endif %}
{% if full_log %}
{{ full_log }}
{% else %}
No log content. The client has not pushed any log_lines entries yet, or the sidecar file was cleared.
{% endif %}
{% if session.log_tail %}

Recent tail

{{ session.log_tail | length }} line{{ 's' if session.log_tail | length != 1 }}
{% for line in session.log_tail %}{{ line }}
{% endfor %}
{% endif %}
{% endblock %} {% block extra_scripts %} {% endblock %}