DataHoarder
55661a12da
All checks were successful
continuous-integration/drone/push Build is passing
92 lines
5.1 KiB
Plaintext
92 lines
5.1 KiB
Plaintext
{% import "git.gammaspectra.live/P2Pool/p2pool-observer/cmd/index" %}
|
|
{% import cmdutils "git.gammaspectra.live/P2Pool/p2pool-observer/cmd/utils" %}
|
|
{% import "git.gammaspectra.live/P2Pool/p2pool-observer/types" %}
|
|
{% import "slices" %}
|
|
|
|
{% func TemplateFoundBlocks(ctx *GlobalRequestContext, foundBlocks []*index.FoundBlock, isMiner bool) %}
|
|
{% code foundBlocks = slice_modulo(foundBlocks, 12) %}
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="row row-cols-1 row-cols-sm-2 row-cols-lg-3 row-cols-xl-4 row-cols-xxl-6 gx-0 gy-2">
|
|
|
|
{% for i, b := range foundBlocks %}
|
|
<div class="col">
|
|
<div class="card h-100 rounded-0">
|
|
<div class="card-header p-1 container text-center">
|
|
<div class="row row-cols-2 g-0">
|
|
<div class="col" title="{%= hex(ctx, b.MainBlock.Id) %}">
|
|
<a href="/b/{%s benc(b.MainBlock.Height) %}">
|
|
<img src="/assets/monero-symbol.svg" alt="Monero" width="24" height="24" class="d-inline-block align-text-top"/>
|
|
<span class="d-inline-block align-text-top">{%dul b.MainBlock.Height %}</span>
|
|
</a>
|
|
</div>
|
|
{% if b.UncleOf != types.ZeroHash %}
|
|
<div class="col" title="{%= hex(ctx, b.MainBlock.SideTemplateId) %} is an uncle of height {%dul b.EffectiveHeight %}, {%= hex(ctx, b.UncleOf) %}">
|
|
<small class="text-body-secondary"><a href="/share/{%= hex(ctx, b.MainBlock.SideTemplateId) %}">#{%dul b.SideHeight %}*</a></small>
|
|
</div>
|
|
{% else %}
|
|
<div class="col" title="{%= hex(ctx, b.MainBlock.SideTemplateId) %}">
|
|
<small class="text-body-secondary"><a href="/share/{%= hex(ctx, b.MainBlock.SideTemplateId) %}">#{%dul b.SideHeight %}</a></small>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<div class="card-body p-1 container text-center">
|
|
<div class="row gy-1 gx-0">
|
|
{%= TemplateGridMinerWithClass(ctx, b.MinerAddress, b.MinerAlias, "col col-12 found-by", 4, "Found by ") %}
|
|
|
|
<div class="col col-12">
|
|
{%dul uint64(b.WindowOutputs) %} miners paid
|
|
</div>
|
|
<div class="col col-12">
|
|
{%dul uint64(b.TransactionCount) %} txs. included
|
|
</div>
|
|
<div class="col col-12">
|
|
{%s monero_to_xmr(b.MainBlock.Reward) %} XMR
|
|
</div>
|
|
<div class="col col-12 btn-group btn-group-sm">
|
|
<a class="btn btn-outline-secondary" href="/t/{%= henc(b.MainBlock.CoinbaseId) %}" title="{%= hex(ctx, b.MainBlock.CoinbaseId) %}">Coinbase</a>
|
|
<a class="btn btn-outline-secondary" href="/share/{%= hex(ctx, b.MainBlock.SideTemplateId) %}">Details</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card-footer p-0 container text-center">
|
|
|
|
{% if isMiner %}
|
|
<div class="row row-cols-1 g-0">
|
|
{% else %}
|
|
<div class="row row-cols-2 g-0">
|
|
{% endif %}
|
|
|
|
<div class="col" title="{%s utc_date(b.MainBlock.Timestamp) %}">
|
|
<small class="text-body-secondary">{%s time_elapsed_short(b.MainBlock.Timestamp) %}</small>
|
|
</div>
|
|
|
|
{% if !isMiner %}
|
|
{% code var effortNumber float64 %}
|
|
{% if len(foundBlocks) > (i+1) %}
|
|
{% code effortNumber = found_block_effort(b, foundBlocks[i+1]) %}
|
|
{% elseif effortIndex := slices.IndexFunc(ctx.Pool.SideChain.Effort.Last, func(e cmdutils.PoolInfoResultSideChainEffortLastEntry) bool { return e.Id == b.MainBlock.Id }); effortIndex != -1 %}
|
|
{% code effortNumber = ctx.Pool.SideChain.Effort.Last[effortIndex].Effort %}
|
|
{% endif %}
|
|
{% if effortNumber == 0.0 %}
|
|
<div class="col">
|
|
<strong>-</strong>
|
|
</div>
|
|
{% else %}
|
|
<div class="col" style="font-weight: bolder; color: {%s effort_color(effortNumber) %}">
|
|
<small>{%f.1 effortNumber %}%</small>
|
|
</div>
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfunc %} |