consensus/cmd/web/views/payouts.qtpl
DataHoarder 55661a12da
All checks were successful
continuous-integration/drone/push Build is passing
WIP: Bootstrap-based responsive interface, CSS only
2024-03-20 13:37:26 +01:00

42 lines
1.2 KiB
Plaintext

{% import "git.gammaspectra.live/P2Pool/p2pool-observer/cmd/index" %}
{% import "git.gammaspectra.live/P2Pool/p2pool-observer/monero/address" %}
{% import "fmt" %}
{% 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) Name() string {
return "payouts"
}
func (p *PayoutsPage) IsRefresh() (ok, isRefresh bool, interval int, uriRefresh, uriStatic string) {
baseAddress := string(p.Miner.ToBase58())
return true, p.Refresh > 0, p.Refresh, fmt.Sprintf("/payouts/%s?refresh", baseAddress), fmt.Sprintf("/payouts/%s", baseAddress)
}
%}
{% func (p *PayoutsPage) Title() %}
{%= p.BasePage.Title() %} - Historical miner payouts {%z= p.Miner.ToBase58() %}
{% endfunc %}
{% func (p *PayoutsPage) Content() %}
<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 %}