{# Per-bay tiles. Rendered standalone by /imaging/tiles for SSE refresh, and included by imaging.html for first paint. Receives `sessions`. #} {% set stage_labels = { 1: ('Booting from PXE', 'WinPE loaded - applying Windows image to disk.'), 2: ('Configuring Windows', 'First boot. Running shopfloor setup baseline scripts.'), 3: ('Installing apps', 'Type-specific app installs (eDNC, UDC, NTLARS, etc).'), 4: ('Apps installed', 'Type-specific scripts complete. Preparing for Intune enrollment.'), 5: ('Enrolling in Intune', 'PPKG installing - device joining Azure AD + Intune. ~5-10 min, reboot to follow.'), 6: ('Waiting on first Intune sync','Post-PPKG settle (~120s). Triggering Schedule #3 sync repeatedly.'), 7: ('Registered - assign category', 'Phase 1 (Intune Registration) complete. Click "set category" in the Intune portal to drop the bay into the right config-profile group.'), 8: ('Imaging complete', 'Lockdown applied. Bay rebooted into ShopFloor session. Ready for production.') } %} {# Blancco Drive Eraser sessions (source/pctype "blancco"), posted by blancco-init.sh and blancco-progress.py; stage_total 7. #} {% set blancco_stage_labels = { 1: ('Downloading Blancco', 'PXE boot: loading the Blancco image into RAM.'), 2: ('Starting Blancco', 'Blancco is starting up.'), 3: ('Licensing', 'Waiting for the Blancco cloud licence (WiFi INTERNETACCESS).'), 4: ('Erasing', 'Drive erasure in progress. Do not power off.'), 5: ('Erasure finished', 'Report saved on the PC.'), 6: ('Report sent', 'Report uploaded to the Blancco cloud; a copy goes to the share.'), 7: ('Wipe complete', 'Erasure succeeded. Report is on the Blancco reports share.') } %} {% set inferred_stage_labels = { 'stage_0_dhcp': ('DHCP lease issued', 'Client got a DHCP lease but has not fetched the bootloader yet.'), 'stage_0_tftp_bios': ('TFTP bootloader (BIOS)','Client fetched undionly.kpxe via TFTP. Booting iPXE.'), 'stage_0_tftp_uefi': ('TFTP bootloader (UEFI)','Client fetched ipxe.efi via TFTP. Booting iPXE.'), 'stage_0_menu': ('Boot menu loaded', 'Client loaded the iPXE menu. Waiting on selection or auto-boot.'), 'stage_0_boot_pre': ('Pre-boot fetch', 'Client downloading WinPE boot files from HTTP.'), 'stage_1_wim_get': ('Downloading boot.wim', 'Client pulling WinPE image. No /imaging/status push yet.'), 'stage_2_smb_winpe': ('WinPE running (no push)','Client has opened SMB shares - WinPE is up but startnet has not pushed status.'), } %} {% for s in sessions %} {% set is_inferred = (s.source == 'inferred') %} {% set is_blancco = (s.source == 'blancco' or s.pctype == 'blancco') %} {% set stage_idx = s.stage_index | int(0) %} {% set stage_total = s.stage_total | int(0) %} {% set pct = 100 if s.status == 'succeeded' else ((stage_idx / stage_total * 100) | round(0, 'floor')) if stage_total > 0 else 0 %} {# Blancco erasing: fold the drive % ("... [75%]") into the bar between the start of stage 4 and the start of stage 5. #} {% set drive_pct = None %} {% if is_blancco and stage_idx == 4 and s.current_stage and '%]' in s.current_stage %} {% set drive_pct = s.current_stage.split('[')[-1].split('%')[0] | int(0) %} {% if stage_total > 0 and s.status != 'succeeded' %} {% set pct = (((stage_idx - 1) + drive_pct / 100) / stage_total * 100) | round(0, 'floor') %} {% endif %} {% endif %} {% set pct = pct | int %} {% set is_failed = s.status == 'failed' %} {% set is_done = s.status == 'succeeded' %} {% if is_inferred %} {% set border = 'warning' %} {% else %} {% set border = 'danger' if is_failed else ('success' if is_done else 'primary') %} {% endif %} {% if is_inferred %} {% set friendly = inferred_stage_labels.get(s.current_stage, ('Inferred from logs', s.current_stage or '')) %} {% elif is_blancco %} {% if s.status == 'failed' %} {% set friendly = ('Erasure FAILED', 'Blancco reported a failed erasure step. Check the log tail and the report.') %} {% else %} {% set friendly = blancco_stage_labels.get(stage_idx, ('Stage ' ~ stage_idx, '')) %} {% endif %} {% else %} {% set friendly = stage_labels.get(stage_idx, ('Stage ' ~ stage_idx, '')) %} {% if stage_idx == 1 and s.current_stage and 'bios' in s.current_stage|lower %} {% set friendly = ('Updating BIOS firmware', 'WinPE detected a firmware update for this model. Do NOT power off until the next reboot. Imaging continues afterward.') %} {% endif %} {% if stage_idx == 7 and s.current_stage %} {% set _cs = s.current_stage|lower %} {% if 'ready for lockdown' in _cs or 'request lockdown' in _cs %} {% set friendly = ('Ready - request lockdown', 'Phase 1-4 all complete (Registration, Device Config, Software Deploy, Credentials). Click "ARTS request" to initiate the lockdown workflow.') %} {% elif 'credentials' in _cs or 'phase 4' in _cs %} {% set friendly = ('Phase 3 / 4 - DSC + credentials', 'SFLD policy delivered, DSC pulling device-config.yaml + running per-app wrappers. SFLD share creds populating.') %} {% elif 'sfld policy' in _cs or 'phase 2' in _cs or 'device configuration' in _cs %} {% set friendly = ('Phase 2 - device configuration', 'Category was assigned in Intune. SFLD ConfigurationProfile (Function + SasToken) has delivered. DSC kicking off next.') %} {% endif %} {% endif %} {% endif %} {% set card_key = s.serial or ('mac-' ~ (s.mac or 'unknown') ~ '-' ~ (s.ip or '')) %}
{% if s.intune_device_id %}
{% else %}
{% if is_inferred %}log-only{% elif is_blancco %}WIPE{% if drive_pct is not none %}
{{ drive_pct }}%{% endif %}{% else %}no DeviceId{% endif %}
{% endif %}
{% if s.serial %}{{ s.serial }} {% elif s.hostname_target %}{{ s.hostname_target }} {% elif s.mac %}{{ s.mac }} {% else %}{{ s.ip or '(unknown bay)' }}{% endif %} {% if s.hostname_target and s.serial %}{{ s.hostname_target }}{% endif %} {% if s.ip %}{{ s.ip }}{% endif %} {% if s.pctype %}{{ s.pctype }}{% endif %} {% if s.machinenumber %}#{{ s.machinenumber }}{% endif %} {% if is_inferred %}log-inferred{% endif %} {{ s.status or 'in_progress' }}
{{ friendly[0] }} {% if is_blancco and stage_idx == 4 and s.current_stage %}{{ s.current_stage | replace('Erasing: ', '') }}{% endif %} {% if not is_inferred %} {{ stage_idx }}/{{ stage_total or '?' }} {% endif %}
{% if not is_inferred %}{{ pct }}%{% endif %}
{% if not is_inferred %}
{% endif %}
{% if friendly[1] %}
{{ friendly[1] }}
{% endif %} {% if s.intune_device_id %}
Intune {{ s.intune_device_id }} set category ARTS request
{% endif %}
started {{ s.started_at or '-' }} last {{ s.last_updated or '-' }} MAC {{ s.mac or '-' }} {% if s.current_stage %}{{ s.current_stage }}{% endif %}
{% if s.error %}
Error: {{ s.error }}
{% endif %} {% if is_blancco %} {% endif %} {% if not is_inferred and not is_blancco %}
LAPS password QR (paste -> scan on bay - persists until cleared)
{% endif %} {% if s.log_tail %}
{% if is_inferred %}Evidence{% else %}Log tail{% endif %} ({{ s.log_tail | length }} line{{ 's' if s.log_tail | length != 1 }})
{% for line in s.log_tail %}{{ line }}
{% endfor %}
{% endif %} {% if not is_inferred and s.serial %} {% endif %}
{% endfor %}