mirror of
https://github.com/lux-tel/session-observer.git
synced 2026-11-07 18:32:01 +00:00
Signatures were always showing the x marks on the end, rather than at the proper position. Drawing logic should be based on `.voter_index`, not loop index.
38 lines
1.5 KiB
HTML
38 lines
1.5 KiB
HTML
<div class="Wrapper">
|
|
<h2 style="margin-bottom: 0px">Last {{checkpoints.checkpoints | length}} checkpoints</h2>
|
|
|
|
<div class="TitleDivider"></div>
|
|
|
|
<table style="width:100%">
|
|
<thead>
|
|
<tr class="TableHeader">
|
|
<td>Height</td>
|
|
<td>Block hash</td>
|
|
<td>Checkpoint Quorum</td>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
{%for cp in checkpoints.checkpoints%}
|
|
<tr>
|
|
<td><a href="/block/{{cp.height}}">{{cp.height}}</a></td>
|
|
<td><a href="/block/{{cp.block_hash}}">{{cp.block_hash}}</a></td>
|
|
<td>
|
|
<a href="/checkpoint_quorum/{{cp.height}}">{{cp.signatures|length}}/20 signatures</a>:
|
|
{%for sig in cp.signatures%}
|
|
{%set prev_ind = 0 if loop.index0 == 0 else cp.signatures[loop.index0 - 1].voter_index%}
|
|
{%for missing in range(prev_ind + 1, sig.voter_index)%}
|
|
<span title="Missing signature from checkpoint quorum voter {{missing}}" class="checkpoint-not-signed">✕</span>
|
|
{%endfor%}
|
|
<span title="Signed by checkpoint quorum voter {{sig.voter_index}}" class="checkpoint-signed">✓</span>
|
|
{%endfor%}
|
|
{%for missing in range(cp.signatures[-1].voter_index + 1, 20)%}
|
|
<span title="Missing signature from checkpoint quorum voter {{missing}}" class="checkpoint-not-signed">✕</span>
|
|
{%endfor%}
|
|
{%endfor%}
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|