Browse Source

minor ui tweaks and cleanup

fix-133-memory-crash
Dan Janosik 6 years ago
parent
commit
78d17c90b4
  1. 8
      views/blocks.pug
  2. 25
      views/includes/block-content.pug
  3. 2
      views/includes/blocks-list.pug
  4. 1
      views/index.pug
  5. 4
      views/transaction.pug

8
views/blocks.pug

@ -10,13 +10,15 @@ block content
if (blocks)
nav(aria-label="Page navigation")
ul(class="pagination justify-content-center")
li(class="page-item", class=(sort == "asc" ? "active" : false))
a(class="page-link", href=(sort == "asc" ? "javascript:void(0)" : "/blocks?limit=" + limit + "&offset=0" + "&sort=asc"))
span(aria-hidden="true") Oldest blocks first
li(class="page-item", class=(sort == "desc" ? "active" : false))
a(class="page-link", href=(sort == "desc" ? "javascript:void(0)" : "/blocks?limit=" + limit + "&offset=0" + "&sort=desc"))
span(aria-hidden="true") Newest blocks first
li(class="page-item", class=(sort == "asc" ? "active" : false))
a(class="page-link", href=(sort == "asc" ? "javascript:void(0)" : "/blocks?limit=" + limit + "&offset=0" + "&sort=asc"))
span(aria-hidden="true") Oldest blocks first
include includes/blocks-list.pug
if (blockCount > limit)

25
views/includes/block-content.pug

@ -59,10 +59,10 @@ div(class="tab-content")
a(href=("/block-height/" + result.getblock.height)) #{result.getblock.height.toLocaleString()}
tr
td(class="properties-header") Timestamp (utc)
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")}
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()})
@ -92,7 +92,6 @@ div(class="tab-content")
td(class="properties-header") Weight
td(class="monospace")
span #{result.getblock.weight.toLocaleString()} wu
br
span(class="text-muted") (#{new Decimal(100 * result.getblock.weight / coinConfig.maxBlockWeight).toDecimalPlaces(2)}% full)
tr
@ -115,7 +114,6 @@ div(class="tab-content")
span(class="text-muted") ##{(result.getblock.height + 1).toLocaleString()}
else
span None
br
span(class="text-muted") (latest block)
tr
@ -149,16 +147,15 @@ div(class="tab-content")
td(class="monospace word-wrap") #{result.getblock.merkleroot}
tr
td(class="properties-header") Chainwork
td(class="monospace word-wrap") #{result.getblock.chainwork.replace(/^0+/, '')}
br
- var chainworkData = utils.formatLargeNumber(parseInt("0x" + result.getblock.chainwork), 2);
span(class="text-muted")
span (~
span #{chainworkData[0]}
td(class="properties-header") Chainwork
td(class="monospace word-wrap") #{chainworkData[0]}
span x 10
sup #{chainworkData[1].exponent}
span hashes)
span hashes
span(class="text-muted") (#{result.getblock.chainwork.replace(/^0+/, '')})
tr
td(class="properties-header") Miner
@ -207,10 +204,10 @@ div(class="tab-content")
strong ##{(txIndex + offset).toLocaleString()}
span –
a(href=("/tx/" + tx.txid), class="monospace") #{tx.txid}
div(class="row")
div(class="col-md-10")
div(class="col-md-2 text-right")
if (global.specialTransactions && global.specialTransactions[tx.txid])
span
i(class="fas fa-certificate text-primary")
div(class="card-body")
//pre

2
views/includes/blocks-list.pug

@ -18,7 +18,9 @@ table(class="table table-striped table-responsive-sm")
tr
td(class="data-cell monospace")
a(href=("/block-height/" + block.height)) #{block.height.toLocaleString()}
if (global.specialBlocks && global.specialBlocks[block.hash])
span
i(class="fas fa-certificate text-primary")
td(class="data-cell monospace") #{moment.utc(new Date(parseInt(block.time) * 1000)).format("Y-MM-DD HH:mm:ss")}

1
views/index.pug

@ -111,7 +111,6 @@ block content
p(class="lead")
span(data-toggle="tooltip", title=getblockchaininfo.chainwork.replace(/^0+/, ''))
span ~
span #{chainworkData[0]}
span x 10
sup #{chainworkData[1].exponent}

4
views/transaction.pug

@ -82,10 +82,10 @@ block content
span(class="text-muted") (unconfirmed)
tr
td(class="properties-header") Timestamp (utc)
td(class="properties-header") Timestamp
if (result.getrawtransaction.time)
td(class="monospace") #{moment.utc(new Date(result.getrawtransaction["time"] * 1000)).format("Y-MM-DD HH:mm:ss")}
td(class="monospace") #{moment.utc(new Date(result.getrawtransaction["time"] * 1000)).format("Y-MM-DD HH:mm:ss")} utc
- var timeAgo = moment.duration(moment.utc(new Date()).diff(moment.utc(new Date(parseInt(result.getrawtransaction["time"]) * 1000))));
br
span(class="text-muted") (#{timeAgo.format()})

Loading…
Cancel
Save