diff --git a/webapp/templates/_imaging_tiles.html b/webapp/templates/_imaging_tiles.html index 9f1a8e6..d9410d9 100644 --- a/webapp/templates/_imaging_tiles.html +++ b/webapp/templates/_imaging_tiles.html @@ -13,6 +13,18 @@ '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.'), @@ -25,9 +37,20 @@ {% 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 %} @@ -37,6 +60,12 @@ {% 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 %} @@ -75,7 +104,7 @@ {% else %}