Browse Source

more minor frontend tweaks

fix-133-memory-crash
Dan Janosik 7 years ago
parent
commit
edb741ac22
  1. 49
      views/includes/block-content.pug
  2. 14
      views/includes/blocks-list.pug

49
views/includes/block-content.pug

@ -81,9 +81,14 @@ div(class="tab-content")
th(class="table-active properties-header") Size th(class="table-active properties-header") Size
td(class="monospace") td(class="monospace")
span #{result.getblock.size.toLocaleString()} bytes span #{result.getblock.size.toLocaleString()} bytes
if (result.getblock.weight)
if (result.getblock.weight)
tr
th(class="table-active properties-header") Weight
td(class="monospace")
span #{result.getblock.weight.toLocaleString()} wu
br br
span(class="text-muted") (weight: #{result.getblock.weight.toLocaleString()}) span(class="text-muted") (#{new Decimal(100 * result.getblock.weight / coinConfig.maxBlockWeight).toDecimalPlaces(2)}% full)
tr tr
th(class="table-active properties-header") Confirmations th(class="table-active properties-header") Confirmations
@ -92,18 +97,7 @@ div(class="tab-content")
strong(class="text-warning") #{result.getblock.confirmations} strong(class="text-warning") #{result.getblock.confirmations}
else else
strong(class="text-success") #{result.getblock.confirmations.toLocaleString()} strong(class="text-success") #{result.getblock.confirmations.toLocaleString()}
tr(class="border-bottom")
th(class="table-active text-right") Miner
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")
div(class="col-md-6") div(class="col-md-6")
table(class="table") table(class="table")
@ -124,14 +118,12 @@ div(class="tab-content")
- var scaleDone = false; - var scaleDone = false;
th(class="table-active properties-header") Difficulty th(class="table-active properties-header") Difficulty
td(class="monospace") td(class="monospace")
span #{parseFloat(result.getblock.difficulty).toLocaleString()} - var difficultyData = utils.formatDifficulty(result.getblock.difficulty, 3);
each item in scales
if (!scaleDone) span(title=parseFloat(result.getblock.difficulty).toLocaleString(), data-toggle="tooltip")
- var fraction = Math.floor(result.getblock.difficulty / item.val); span #{difficultyData[0]}
if (fraction >= 1) span x 10
- scaleDone = true; sup #{difficultyData[1].exponent}
br
span(class="text-muted") (#{fraction} #{item.name})
tr tr
@ -155,6 +147,19 @@ div(class="tab-content")
th(class="table-active text-right") Chainwork th(class="table-active text-right") Chainwork
td(class="monospace word-wrap") #{result.getblock.chainwork} td(class="monospace word-wrap") #{result.getblock.chainwork}
tr(class="border-bottom")
th(class="table-active text-right") Miner
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")
div(class="card mb-3") div(class="card mb-3")
div(class="card-header") div(class="card-header")
div(class="row") div(class="row")

14
views/includes/blocks-list.pug

@ -11,9 +11,11 @@ table(class="table table-striped table-responsive-sm")
th(class="data-header text-right") Transactions th(class="data-header text-right") Transactions
th(class="data-header text-right") Average Fee th(class="data-header text-right") Average Fee
th(class="data-header text-right") Size (bytes) th(class="data-header text-right") Size (bytes)
th(class="data-header text-right") Weight (wu)
a(data-toggle="tooltip", title=("Hover text below for % full")) if (blocks && blocks.length > 0 && blocks[0].weight)
i(class="fas fa-info-circle") th(class="data-header text-right") Weight (wu)
a(data-toggle="tooltip", title=("Hover text below for % full"))
i(class="fas fa-info-circle")
tbody tbody
each block, blockIndex in blocks each block, blockIndex in blocks
if (block) if (block)
@ -39,5 +41,7 @@ table(class="table table-striped table-responsive-sm")
include ./value-display.pug include ./value-display.pug
td(class="data-cell monospace text-right") #{block.size.toLocaleString()} td(class="data-cell monospace text-right") #{block.size.toLocaleString()}
td(class="data-cell monospace text-right")
span(title=(new Decimal(100 * block.weight / coinConfig.maxBlockWeight).toDecimalPlaces(2) + "% full"), data-toggle="tooltip") #{block.weight.toLocaleString()} if (blocks && blocks.length > 0 && blocks[0].weight)
td(class="data-cell monospace text-right")
span(title=(new Decimal(100 * block.weight / coinConfig.maxBlockWeight).toDecimalPlaces(2) + "% full"), data-toggle="tooltip") #{block.weight.toLocaleString()}
Loading…
Cancel
Save