Browse Source

tweak block-details content:

- button-links for previous/next blocks instead of showing the hashes in the table
- don't show block-hash or height in the summary table (since it's in the H1 title already)
- add "age" description for the age below the timestamp for clarity
- include "Total Fees" and "Average Fee" in the summary table
- include "Miner" entry even if unidentified, for consistency
fix-133-memory-crash
Dan Janosik 7 years ago
parent
commit
5d78d1f770
  1. 11
      views/block.pug
  2. 34
      views/includes/block-content.pug

11
views/block.pug

@ -4,10 +4,21 @@ block headContent
title Block #{blockHash}
block content
div(class="row")
div(class="col-md-8")
h1(class="h2") Block
small(style="width: 100%;", class="monospace") ##{result.getblock.height.toLocaleString()}
br
small(style="width: 100%;", class="monospace word-wrap") #{result.getblock.hash}
div(class="col-md-4")
div(class="text-md-right mb-2")
if (result.getblock.height > 0)
a(href=("/block/" + result.getblock.previousblockhash), class="btn btn-primary", data-toggle="tooltip", title=("Block " + result.getblock.previousblockhash)) ◀ ##{(result.getblock.height - 1).toLocaleString()}
if (result.getblock.nextblockhash)
a(href=("/block/" + result.getblock.nextblockhash), class="btn btn-primary", data-toggle="tooltip", title=("Block " + result.getblock.nextblockhash)) ##{(result.getblock.height + 1).toLocaleString()} ▶
hr
include includes/block-content.pug

34
views/includes/block-content.pug

@ -32,28 +32,27 @@ div(class="tab-content")
table(class="table")
if (false)
tr
th(class="table-active properties-header") Previous Block
td(class="monospace word-wrap")
if (result.getblock.previousblockhash)
a(class="word-wrap", href=("/block/" + result.getblock.previousblockhash)) #{result.getblock.previousblockhash}
br
span(class="text-muted") (#{(result.getblock.height - 1).toLocaleString()})
a(class="word-wrap", href=("/block/" + result.getblock.previousblockhash)) #{(result.getblock.height - 1).toLocaleString()}
else if (result.getblock.hash == genesisBlockHash)
span None
if (false)
tr
th(class="table-active properties-header") Next Block
td(class="monospace word-wrap")
if (result.getblock.nextblockhash)
a(href=("/block/" + result.getblock.nextblockhash)) #{result.getblock.nextblockhash}
br
span(class="text-muted") (#{(result.getblock.height + 1).toLocaleString()})
a(href=("/block/" + result.getblock.nextblockhash)) #{(result.getblock.height + 1).toLocaleString()}
else
span None
span(class="text-muted") (latest block)
if (false)
tr
th(class="table-active properties-header") Block Height
td(class="monospace")
@ -65,12 +64,24 @@ div(class="tab-content")
- var timeAgo = moment.duration(moment.utc(new Date()).diff(moment.utc(new Date(parseInt(result.getblock.time) * 1000))));
td(class="monospace") #{moment.utc(new Date(result.getblock.time * 1000)).format("Y-MM-DD HH:mm:ss")}
br
span(class="text-muted") (#{timeAgo.format()})
span(class="text-muted") (age #{timeAgo.format()})
tr
th(class="table-active properties-header") Transaction Count
td(class="monospace") #{result.getblock.tx.length.toLocaleString()}
tr
th(class="table-active properties-header") Total Fees
td(class="monospace")
- var currencyValue = new Decimal(result.getblock.totalFees);
include ./value-display.pug
tr
th(class="table-active properties-header") Average Fee
td(class="monospace")
- var currencyValue = new Decimal(result.getblock.totalFees).dividedBy(result.getblock.tx.length);
include ./value-display.pug
tr
th(class="table-active properties-header") Size
td(class="monospace")
@ -123,13 +134,18 @@ div(class="tab-content")
th(class="table-active text-right") Chainwork
td(class="monospace word-wrap") #{result.getblock.chainwork}
if (result.getblock.miner)
tr
th(class="table-active text-right") Miner
td(class="monospace word-wrap") #{result.getblock.miner.name}
td(class="monospace word-wrap")
if (result.getblock.miner)
span #{result.getblock.miner.name}
if (result.getblock.miner.identifiedBy)
a(href=coinConfig.miningPoolsConfigUrl, data-toggle="tooltip", title=("Identified by: " + result.getblock.miner.identifiedBy), target="_blank")
i(class="fas fa-info-circle")
else
span ?
a(href=coinConfig.miningPoolsConfigUrl, data-toggle="tooltip", title=("Unable to identify (click to see config)"), target="_blank")
i(class="fas fa-info-circle")
hr

Loading…
Cancel
Save