DataHoarder
55661a12da
All checks were successful
continuous-integration/drone/push Build is passing
41 lines
1.1 KiB
Plaintext
41 lines
1.1 KiB
Plaintext
{% import "git.gammaspectra.live/P2Pool/p2pool-observer/cmd/index" %}
|
|
{% import "git.gammaspectra.live/P2Pool/p2pool-observer/monero/address" %}
|
|
|
|
{% code
|
|
type BlocksPage struct {
|
|
// inherit from base page, so its' title is used in error page.
|
|
BasePage
|
|
Refresh int
|
|
FoundBlocks []*index.FoundBlock
|
|
Miner *address.Address
|
|
}
|
|
|
|
func (p *BlocksPage) IsRefresh() (ok, isRefresh bool, interval int, uriRefresh, uriStatic string) {
|
|
return p.Miner == nil, p.Refresh > 0, p.Refresh, "/blocks?refresh", "/blocks"
|
|
}
|
|
|
|
|
|
func (p *BlocksPage) Name() string {
|
|
return "blocks"
|
|
}
|
|
%}
|
|
|
|
{% func (p *BlocksPage) Title() %}
|
|
{% if p.Miner == nil %}
|
|
{%= p.BasePage.Title() %} - Recent Found Monero blocks
|
|
{% else %}
|
|
{%= p.BasePage.Title() %} - Found Monero blocks by {%z= p.Miner.ToBase58() %}
|
|
{% endif %}
|
|
{% endfunc %}
|
|
|
|
{% func (p *BlocksPage) Content() %}
|
|
<div style="text-align: center">
|
|
{% if p.Miner == nil %}
|
|
<h2>Recent Found Monero blocks</h2>
|
|
{% else %}
|
|
<h2>{%= p.BasePage.Title() %} - Found Monero blocks by {%z= p.Miner.ToBase58() %}</h2>
|
|
{% endif %}
|
|
{%= TemplateFoundBlocks(p.Context(), p.FoundBlocks, p.Miner != nil) %}
|
|
</div>
|
|
|
|
{% endfunc %} |