You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

244 lines
8.8 KiB

8 years ago
ul(class='nav nav-tabs mb-3')
8 years ago
li(class="nav-item")
a(data-toggle="tab", href="#tab-details", class="nav-link active", role="tab") Details
8 years ago
li(class="nav-item")
a(data-toggle="tab", href="#tab-raw", class="nav-link", role="tab") Raw
- var txCount = result.getblock.tx.length;
div(class="tab-content")
div(id="tab-details", class="tab-pane active", role="tabpanel")
7 years ago
if (global.specialBlocks && global.specialBlocks[result.getblock.hash])
div(class="alert alert-primary", style="padding-bottom: 0;")
div(class="float-left", style="width: 50px; height: 50px; font-size: 18px;")
i(class="fas fa-certificate fa-2x", style="margin-top: 10px;")
7 years ago
h4(class="alert-heading h5") #{coinConfig.name} Fun
// special transaction info
- var sbInfo = global.specialBlocks[result.getblock.hash];
if (sbInfo.alertBodyHtml)
p
span !{sbInfo.alertBodyHtml}
if (sbInfo.referenceUrl && sbInfo.referenceUrl.trim().length > 0 && sbInfo.alertBodyHtml.indexOf(sbInfo.referenceUrl) == -1)
span
a(href=sbInfo.referenceUrl) Read more
else
p
span #{sbInfo.summary}
if (sbInfo.referenceUrl && sbInfo.referenceUrl.trim().length > 0)
span
a(href=sbInfo.referenceUrl) Read more
div(class="card mb-3")
div(class="card-header")
span(class="h6") Summary
div(class="card-body")
div(class="row")
div(class="col-md-6")
table(class="table details-table mb-0")
tr
td(class="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 (##{(result.getblock.height - 1).toLocaleString()})
else if (result.getblock.hash == genesisBlockHash)
span None
span (genesis block)
if (false)
tr
td(class="properties-header") Block Height
td(class="monospace")
a(href=("/block-height/" + result.getblock.height)) #{result.getblock.height.toLocaleString()}
tr
td(class="properties-header") Timestamp
- 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")} utc
br
span(class="text-muted") (age #{timeAgo.format()})
tr
td(class="properties-header") Transaction Count
td(class="monospace") #{result.getblock.tx.length.toLocaleString()}
tr
td(class="properties-header") Total Fees
td(class="monospace")
- var currencyValue = new Decimal(result.getblock.totalFees);
include ./value-display.pug
tr
td(class="properties-header") Average Fee
td(class="monospace")
- var currencyValue = new Decimal(result.getblock.totalFees).dividedBy(result.getblock.tx.length);
include ./value-display.pug
if (result.getblock.weight)
tr
td(class="properties-header") Weight
td(class="monospace")
span #{result.getblock.weight.toLocaleString()} wu
span(class="text-muted") (#{new Decimal(100 * result.getblock.weight / coinConfig.maxBlockWeight).toDecimalPlaces(2)}% full)
tr
td(class="properties-header") Size
td(class="monospace")
span #{result.getblock.size.toLocaleString()} bytes
tr
td(class="properties-header") Confirmations
td(class="monospace")
if (result.getblock.confirmations < 6)
strong(class="text-warning") #{result.getblock.confirmations}
else
strong(class="text-success font-weight-bold") #{result.getblock.confirmations.toLocaleString()}
div(class="col-md-6")
table(class="table details-table mb-0")
tr
td(class="properties-header") Next Block
td(class="monospace word-wrap")
if (result.getblock.nextblockhash)
a(href=("/block/" + result.getblock.nextblockhash)) #{result.getblock.nextblockhash}
br
span (##{(result.getblock.height + 1).toLocaleString()})
else
span None
span(class="text-muted") (latest block)
tr
- var scales = [ {val:1000000000000000, name:"quadrillion"}, {val:1000000000000, name:"trillion"}, {val:1000000000, name:"billion"}, {val:1000000, name:"million"} ];
- var scaleDone = false;
td(class="properties-header") Difficulty
td(class="monospace")
- var difficultyData = utils.formatLargeNumber(result.getblock.difficulty, 3);
span(title=parseFloat(result.getblock.difficulty).toLocaleString(), data-toggle="tooltip")
span #{difficultyData[0]}
span x 10
sup #{difficultyData[1].exponent}
tr
td(class="properties-header") Version
td(class="monospace") 0x#{result.getblock.versionHex}
span(class="text-muted") (decimal: #{result.getblock.version})
tr
td(class="properties-header") Nonce
td(class="monospace") #{result.getblock.nonce}
tr
td(class="properties-header") Bits
td(class="monospace") #{result.getblock.bits}
tr
td(class="properties-header") Merkle Root
td(class="monospace word-wrap") #{result.getblock.merkleroot}
tr
- var chainworkData = utils.formatLargeNumber(parseInt("0x" + result.getblock.chainwork), 2);
td(class="properties-header") Chainwork
td(class="monospace word-wrap") #{chainworkData[0]}
span x 10
sup #{chainworkData[1].exponent}
span hashes
span(class="text-muted") (#{result.getblock.chainwork.replace(/^0+/, '')})
tr
td(class="properties-header") Miner
td(class="monospace word-wrap")
if (result.getblock.miner)
span #{result.getblock.miner.name}
if (result.getblock.miner.identifiedBy)
span(data-toggle="tooltip", title=("Identified by: " + result.getblock.miner.identifiedBy))
i(class="fas fa-info-circle")
else
span ?
span(data-toggle="tooltip", title="Unable to identify miner")
i(class="fas fa-info-circle")
div(class="card mb-3")
div(class="card-header")
div(class="row")
div(class="col-md-4")
h2(class="h6 mb-0") #{txCount.toLocaleString()}
if (txCount == 1)
span Transaction
else
span Transactions
7 years ago
if (!config.demoSite && !crawlerBot && txCount > 20)
div(class="col-md-8 text-right")
span(class="mr-2") Show
div(class="btn-group", role="group")
a(href=(paginationBaseUrl + "?limit=20"), class="btn btn-sm btn-primary px-2", class=((limit == 20 && txCount > limit) ? "active" : false)) 20
7 years ago
if (txCount > 50)
a(href=(paginationBaseUrl + "?limit=50"), class="btn btn-sm btn-primary px-2", class=(limit == 50 ? "active" : false)) 50
if (txCount > 100)
a(href=(paginationBaseUrl + "?limit=100"), class="btn btn-sm btn-primary px-2", class=(limit == 100 ? "active" : false)) 100
a(href=(paginationBaseUrl + "?limit=3000"), class="btn btn-sm btn-primary px-2", class=(limit >= txCount ? "active" : false)) all
- var fontawesomeInputName = "sign-in-alt";
- var fontawesomeOutputName = "sign-out-alt";
div(class="card-body")
each tx, txIndex in result.transactions
//pre
// code #{JSON.stringify(tx, null, 4)}
div(class="xcard mb-3")
div(class="card-header")
if (tx && tx.txid)
strong ##{(txIndex + offset).toLocaleString()}
span &ndash;
a(href=("/tx/" + tx.txid), class="monospace") #{tx.txid}
if (global.specialTransactions && global.specialTransactions[tx.txid])
span
i(class="fas fa-certificate text-primary")
div(class="card-body")
//pre
// code #{JSON.stringify(result.txInputsByTransaction[tx.txid], null, 4)}
if (true)
- var txInputs = result.txInputsByTransaction[tx.txid];
- var blockHeight = result.getblock.height;
include ./transaction-io-details.pug
//pre
// code #{JSON.stringify(tx, null, 4)}
if (!crawlerBot && txCount > limit)
- var pageNumber = offset / limit + 1;
- var pageCount = Math.floor(txCount / limit);
- if (pageCount * limit < txCount) {
- pageCount++;
- }
- var paginationUrlFunction = function(x) {
- return paginationBaseUrl + "?limit=" + limit + "&offset=" + ((x - 1) * limit);
- }
hr
include ./pagination.pug
8 years ago
div(id="tab-raw", class="tab-pane", role="tabpanel")
pre
code #{JSON.stringify(result.getblock, null, 4)}