consensus/cmd/web/views/payouts.qtpl
DataHoarder 0b8823cdf3
All checks were successful
continuous-integration/drone/push Build is passing
Web/api streaming optimizations
2023-07-23 19:07:32 +02:00

40 lines
1.2 KiB
Plaintext

{% import "git.gammaspectra.live/P2Pool/p2pool-observer/cmd/index" %}
{% import "git.gammaspectra.live/P2Pool/p2pool-observer/monero/address" %}
{% code
type PayoutsPage struct {
// inherit from base page, so its' title is used in error page.
BasePage
Refresh int
Miner *address.Address
Payouts <-chan *index.Payout
}
%}
{% func (p *PayoutsPage) Title() %}
{%= p.BasePage.Title() %} - Historical miner payouts {%z= p.Miner.ToBase58() %}
{% endfunc %}
{% func (p *PayoutsPage) Content() %}
<div style="text-align: center; font-weight: bold;">
{% if p.Refresh > 0 %}
<a href="/payouts/{%z= p.Miner.ToBase58() %}">Autorefresh is ON ({%d p.Refresh %} s)</a>
{% else %}
<a href="/payouts/{%z= p.Miner.ToBase58() %}?refresh">Autorefresh is OFF</a>
{% endif %}
</div>
<div style="text-align: center">
<h2>Historical miner payouts</h2>
<p><strong>Payout Address:</strong> <a href="/miner/{%z= p.Miner.ToBase58() %}"><span class="mono small">{%z= p.Miner.ToBase58() %}</span></a></p>
{% code var total uint64 %}
{%= TemplatePayouts(p.Context(), p.Payouts, &total) %}
<p><strong>Estimated total:</strong> {%s monero_to_xmr(total) %} XMR</p>
</div>
{% endfunc %}