{%- macro smart_cell(smart) -%}
{%- if smart.state == 'running' -%}
{{ smart.percent or 0 }}%
{%- if smart.eta_seconds %}
{{ smart.eta_seconds | format_eta }}
{%- endif %} {%- elif smart.state == 'passed' -%} Passed {%- elif smart.state == 'failed' -%} Failed {%- elif smart.state == 'aborted' -%} Aborted {%- else -%} {%- endif -%}
{%- endmacro -%} {%- macro burnin_cell(bi) -%}
{%- if bi is none -%} {%- elif bi.state == 'queued' -%} Queued {%- elif bi.state == 'running' -%}
{{ bi.percent or 0 }}%
{%- if bi.stage_name %} {{ bi.stage_name | replace('_', ' ') | title }} {%- endif %} {%- if bi.started_at %} {{ bi.started_at | format_elapsed }} {%- endif %}
{%- elif bi.state == 'passed' -%} Passed {%- elif bi.state == 'failed' -%} {# Suppress the stage suffix for SMART + surface_validate stages. SMART has its own columns, and surface_validate is the dominant case so a redundant suffix just adds visual noise. The drawer shows the per-stage Reason for any digging. Keep the suffix for precheck / final_check since those are rare enough that the hint is helpful. #} Failed{% if bi.stage_name and bi.stage_name not in ('short_smart', 'long_smart', 'surface_validate') %} ({{ bi.stage_name | replace('_',' ') }}){% endif %} {%- elif bi.state == 'cancelled' -%} Cancelled {%- elif bi.state == 'unknown' -%} Unknown {%- else -%} {%- endif -%}
{%- endmacro -%} {%- if drives %} {%- for drive in drives %} {%- set bi_active = drive.burnin and drive.burnin.state in ('queued', 'running') %} {%- set short_busy = drive.smart_short and drive.smart_short.state == 'running' %} {%- set long_busy = drive.smart_long and drive.smart_long.state == 'running' %} {%- set pool_locked = drive.pool_name and not drive.pool_unlocked_until %} {%- set is_boot_pool = drive.pool_name == 'boot-pool' %} {%- set is_exported = drive.pool_role == 'exported' %} {%- set is_mounted = drive.pool_role == 'mounted' %} {%- set selectable = not bi_active and not short_busy and not long_busy and not pool_locked %} {%- set bi_done = drive.burnin and drive.burnin.state in ('passed', 'failed', 'cancelled', 'unknown') %} {%- set smart_done = (drive.smart_short and drive.smart_short.state in ('passed','failed','aborted')) or (drive.smart_long and drive.smart_long.state in ('passed','failed','aborted')) %} {%- set can_reset = (bi_done or smart_done) and not bi_active and not short_busy and not long_busy and not pool_locked %} {%- set short_state = drive.smart_short.state if drive.smart_short else 'idle' %} {%- set long_state = drive.smart_long.state if drive.smart_long else 'idle' %} {%- set burnin_state = drive.burnin.state if drive.burnin else '' %} {%- endfor %} {%- else %} {%- endif %}
Drive Serial Size Temp Health Short SMART Long SMART Burn-In Actions
{%- if selectable %} {%- endif %} {%- if drive.pool_name -%} 🔒 {%- endif -%} {{ drive.devname }} {{ drive.model or "Unknown" }} {%- if drive.pool_name %} {% if is_exported %}exported ZFS{% elif is_mounted %}mounted FS{% else %}{{ drive.pool_name }} · {{ drive.pool_role or 'data' }}{% endif %} {%- endif %} {%- if drive.location %} {{ drive.location }} {%- else %} + location {%- endif %} {{ drive.serial or "—" }} {{ drive.size_bytes | format_bytes }} {%- if drive.temperature_c is not none %} {{ drive.temperature_c }}°C {%- else %} {%- endif %} {{ drive.smart_health }} {{ smart_cell(drive.smart_short) }} {{ smart_cell(drive.smart_long) }} {{ burnin_cell(drive.burnin) }}
{%- if bi_active %} {%- else %} {%- if short_busy %} {%- else %} {%- endif %} {%- if long_busy %} {%- else %} {%- endif %} {%- if pool_locked %} {%- else %} {%- if can_reset %} {%- endif %} {%- endif %} {%- endif %}
No drives found. Waiting for first poll…