42 lines
1.2 KiB
Plaintext
42 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 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) 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() %}
|
|
{% if p.Miner == nil %}
|
|
<div style="text-align: center; font-weight: bold;">
|
|
{% if p.Refresh > 0 %}
|
|
<a href="/blocks">Autorefresh is ON ({%d p.Refresh %} s)</a>
|
|
{% else %}
|
|
<a href="/blocks?refresh">Autorefresh is OFF</a>
|
|
{% endif %}
|
|
</div>
|
|
{%endif %}
|
|
|
|
<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 %} |