Browse Source

styling tweaks and cleanup

fix-133-memory-crash
Dan Janosik 7 years ago
parent
commit
48c921d0f2
  1. 11
      public/css/styling.css
  2. 4
      views/block-height.pug
  3. 4
      views/block.pug
  4. 30
      views/includes/block-content.pug
  5. 10
      views/includes/blocks-list.pug
  6. 36
      views/includes/getinfo-table.pug
  7. 39
      views/includes/getmempoolinfo-table.pug
  8. 2
      views/layout.pug
  9. 27
      views/mempool.pug
  10. 37
      views/node-info.pug
  11. 20
      views/transaction.pug

11
public/css/styling.css

@ -14,8 +14,8 @@ img.header-image {
margin-right: 10px;
}
.monospace {
font-family: monospace;
code, .monospace {
font-family: "Cousine", monospace;
}
.properties-header {
@ -40,11 +40,6 @@ img.header-image {
margin-right: 20px;
}
.data-header {
.data-cell, .data-header {
text-align: right;
}
.data-cell {
text-align: right;
font-family: monospace;
}

4
views/block-height.pug

@ -10,10 +10,10 @@ block content
strong #{host}
span :#{port}
li(class="breadcrumb-item active")
a(href=("/block-height/" + blockHeight)) Block #{blockHeight}
a(href=("/block-height/" + blockHeight)) Block #{blockHeight.toLocaleString()}
h1(class="h2") Block
small ##{blockHeight}
small(class="monospace") ##{blockHeight.toLocaleString()}
hr
include includes/block-content.pug

4
views/block.pug

@ -10,10 +10,10 @@ block content
strong #{host}
span :#{port}
li(class="breadcrumb-item active")
a(href=("/block/" + blockHash)) Block #{result.getblock.height}
a(href=("/block/" + blockHash)) Block #{result.getblock.height.toLocaleString()}
h1(class="h2") Block
small(style="width: 100%;") ##{result.getblock.height}
small(style="width: 100%;", class="monospace") ##{result.getblock.height.toLocaleString()}
hr
include includes/block-content.pug

30
views/includes/block-content.pug

@ -17,12 +17,12 @@ div(class="tab-content")
table(class="table")
tr
th(class="table-active properties-header") Block Hash
td
td(class="monospace")
a(href=("/block/" + result.getblock.hash)) #{result.getblock.hash}
tr
th(class="table-active properties-header") Previous Block Hash
td
td(class="monospace")
if (result.getblock.previousblockhash)
a(href=("/block/" + result.getblock.previousblockhash)) #{result.getblock.previousblockhash}
@ -32,7 +32,7 @@ div(class="tab-content")
tr
th(class="table-active properties-header") Next Block Hash
td
td(class="monospace")
if (result.getblock.nextblockhash)
a(href=("/block/" + result.getblock.nextblockhash)) #{result.getblock.nextblockhash}
else
@ -41,27 +41,27 @@ div(class="tab-content")
tr
th(class="table-active properties-header") Block Height
td
a(href=("/block-height/" + result.getblock.height)) #{result.getblock.height}
td(class="monospace")
a(href=("/block-height/" + result.getblock.height)) #{result.getblock.height.toLocaleString()}
tr
th(class="table-active properties-header") Timestamp
td #{moment.utc(new Date(result.getblock.time * 1000)).format("Y-MM-DD HH:mm:ss")} (utc)
td(class="monospace") #{moment.utc(new Date(result.getblock.time * 1000)).format("Y-MM-DD HH:mm:ss")} (utc)
tr
th(class="table-active properties-header") Transaction Count
td #{result.getblock.tx.length.toLocaleString()}
td(class="monospace") #{result.getblock.tx.length.toLocaleString()}
tr
th(class="table-active properties-header") Size
td
td(class="monospace")
span #{result.getblock.size.toLocaleString()} bytes
br
span(class="text-muted") (weight: #{result.getblock.weight.toLocaleString()})
tr
th(class="table-active properties-header") Confirmations
td
td(class="monospace")
if (result.getblock.confirmations < 6)
strong(class="text-warning") #{result.getblock.confirmations}
else
@ -71,7 +71,7 @@ div(class="tab-content")
- var scales = [ {val:1000000000000000, name:"quadrillion"}, {val:1000000000000, name:"trillion"}, {val:1000000000, name:"billion"}, {val:1000000, name:"million"} ];
- var scaleDone = false;
th(class="table-active properties-header") Difficulty
td
td(class="monospace")
span #{result.getblock.difficulty.toLocaleString()}
each item in scales
if (!scaleDone)
@ -83,24 +83,24 @@ div(class="tab-content")
tr
th(class="table-active text-right") Version
td 0x#{result.getblock.versionHex}
td(class="monospace") 0x#{result.getblock.versionHex}
span(class="text-muted") (decimal: #{result.getblock.version})
tr
th(class="table-active text-right") Nonce
td #{result.getblock.nonce}
td(class="monospace") #{result.getblock.nonce}
tr
th(class="table-active text-right") Bits
td #{result.getblock.bits}
td(class="monospace") #{result.getblock.bits}
tr
th(class="table-active text-right") Merkle Root
td #{result.getblock.merkleroot}
td(class="monospace") #{result.getblock.merkleroot}
tr
th(class="table-active text-right") Chainwork
td #{result.getblock.chainwork}
td(class="monospace") #{result.getblock.chainwork}
hr
h2(class="h4") Transactions (#{txCount.toLocaleString()})

10
views/includes/blocks-list.pug

@ -12,11 +12,11 @@ table(class="table table-striped")
if (block)
tr
th #{(blockIndex + blockOffset + 1).toLocaleString()}
td(class="data-cell")
td(class="data-cell monospace")
a(href=("/block-height/" + block.height)) #{block.height.toLocaleString()}
td(class="data-cell") #{moment.utc(new Date(parseInt(block.time) * 1000)).format("Y-MM-DD HH:mm:ss")}
td(class="data-cell monospace") #{moment.utc(new Date(parseInt(block.time) * 1000)).format("Y-MM-DD HH:mm:ss")}
- var timeAgo = moment.duration(moment.utc(new Date()).diff(moment.utc(new Date(parseInt(block.time) * 1000))));
td(class="data-cell") #{timeAgo.format()}
td(class="data-cell") #{block.tx.length.toLocaleString()}
td(class="data-cell") #{block.size.toLocaleString()}
td(class="data-cell monospace") #{timeAgo.format()}
td(class="data-cell monospace") #{block.tx.length.toLocaleString()}
td(class="data-cell monospace") #{block.size.toLocaleString()}

36
views/includes/getinfo-table.pug

@ -1,36 +0,0 @@
if (false)
pre
code #{JSON.stringify(getinfo, null, 4)}
if (true)
table(class="table")
tr
th(class="table-active properties-header") Version
td #{getinfo.version}
tr
th(class="table-active properties-header") Protocol Version
td #{getinfo.protocolversion}
tr
th(class="table-active properties-header") Connections
td #{getinfo.connections.toLocaleString()}
tr
th(class="table-active properties-header") Block Count
td #{getinfo.blocks.toLocaleString()}
tr
th(class="table-active properties-header") Testnet?
td #{getinfo.testnet}
tr
th(class="table-active properties-header") Errors
td #{getinfo.errors}
tr
- var scales = [ {val:1000000000000000, name:"quadrillion"}, {val:1000000000000, name:"trillion"}, {val:1000000000, name:"billion"}, {val:1000000, name:"million"} ];
- var scaleDone = false;
th(class="table-active properties-header") Difficulty
td
span #{getinfo.difficulty.toLocaleString()}
each item in scales
if (!scaleDone)
- var fraction = Math.floor(getinfo.difficulty / item.val);
if (fraction >= 1)
- scaleDone = true;
span(class="text-muted") (#{fraction} #{item.name})

39
views/includes/getmempoolinfo-table.pug

@ -1,39 +0,0 @@
if (false)
pre
code #{JSON.stringify(getmempoolinfo, null, 4)}
if (true)
table(class="table")
tr
th(class="table-active properties-header") Transaction Count
td #{getmempoolinfo.size.toLocaleString()}
tr
- var scales = [ {val:1000000000, name:"GB"}, {val:1000000, name:"MB"}, {val:1000, name:"kB"} ];
- var scaleDone = false;
th(class="table-active properties-header") Size
td
span #{getmempoolinfo.bytes.toLocaleString()} bytes
each item in scales
if (!scaleDone)
- var fraction = Math.floor(getmempoolinfo.bytes / item.val);
if (fraction >= 1)
- scaleDone = true;
span(class="text-muted") (#{fraction} #{item.name})
tr
- var scales = [ {val:1000000000, name:"GB"}, {val:1000000, name:"MB"}, {val:1000, name:"kB"} ];
- var scaleDone = false;
th(class="table-active properties-header") Size
td
span #{getmempoolinfo.usage.toLocaleString()} bytes
each item in scales
if (!scaleDone)
- var fraction = Math.floor(getmempoolinfo.usage / item.val);
if (fraction >= 1)
- scaleDone = true;
span(class="text-muted") (#{fraction} #{item.name})
tr
th(class="table-active properties-header") Max Size
td #{getmempoolinfo.maxmempool.toLocaleString()}
tr
th(class="table-active properties-header") Min Fee
td #{getmempoolinfo.mempoolminfee.toLocaleString()}

2
views/layout.pug

@ -6,7 +6,7 @@ html
link(rel="stylesheet", href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css", integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb", crossorigin="anonymous")
link(rel="stylesheet", href="https://netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css")
link(rel="stylesheet", href="https://fonts.googleapis.com/css?family=Lato|Open+Sans")
link(rel="stylesheet", href="https://fonts.googleapis.com/css?family=Lato|Open+Sans|Cousine")
link(rel="stylesheet", href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css")
link(rel='stylesheet', href='/css/styling.css')

27
views/mempool.pug

@ -23,7 +23,7 @@ block content
- var scales = [ {val:1000000000, name:"GB"}, {val:1000000, name:"MB"}, {val:1000, name:"kB"} ];
- var scaleDone = false;
th(class="table-active properties-header") Size
td
td(class="monospace")
span #{getmempoolinfo.bytes.toLocaleString()} bytes
each item in scales
if (!scaleDone)
@ -35,7 +35,7 @@ block content
- var scales = [ {val:1000000000, name:"GB"}, {val:1000000, name:"MB"}, {val:1000, name:"kB"} ];
- var scaleDone = false;
th(class="table-active properties-header") Size
td
td(class="monospace")
span #{getmempoolinfo.usage.toLocaleString()} bytes
each item in scales
if (!scaleDone)
@ -45,13 +45,13 @@ block content
span(class="text-muted") (#{fraction} #{item.name})
tr
th(class="table-active properties-header") Max Size
td #{getmempoolinfo.maxmempool.toLocaleString()}
td(class="monospace") #{getmempoolinfo.maxmempool.toLocaleString()}
tr
th(class="table-active properties-header") Min Fee
td #{getmempoolinfo.mempoolminfee.toLocaleString()}
td(class="monospace") #{getmempoolinfo.mempoolminfee.toLocaleString()}
tr
th(class="table-active properties-header") Total Fees
td #{mempoolstats.totalFee.toLocaleString()}
td(class="monospace") #{mempoolstats.totalFee.toLocaleString()}
h4 Transaction count by fee level
@ -63,25 +63,26 @@ block content
table(class="table")
tr
th(class="table-active properties-header") 0 - 5 sat/B
td #{mempoolstats.fee_0_5.toLocaleString()}
td(class="monospace") #{mempoolstats.fee_0_5.toLocaleString()}
tr
th(class="table-active properties-header") 6 - 10 sat/B
td #{mempoolstats.fee_6_10.toLocaleString()}
td(class="monospace") #{mempoolstats.fee_6_10.toLocaleString()}
tr
th(class="table-active properties-header") 11 - 25 sat/B
td #{mempoolstats.fee_11_25.toLocaleString()}
td(class="monospace") #{mempoolstats.fee_11_25.toLocaleString()}
tr
th(class="table-active properties-header") 26 - 50 sat/B
td #{mempoolstats.fee_26_50.toLocaleString()}
td(class="monospace") #{mempoolstats.fee_26_50.toLocaleString()}
tr
th(class="table-active properties-header") 51 - 75 sat/B
td #{mempoolstats.fee_51_75.toLocaleString()}
td(class="monospace") #{mempoolstats.fee_51_75.toLocaleString()}
tr
th(class="table-active properties-header") 76 - 100 sat/B
td #{mempoolstats.fee_76_100.toLocaleString()}
td(class="monospace") #{mempoolstats.fee_76_100.toLocaleString()}
tr
th(class="table-active properties-header") 101 - 150 sat/B
td #{mempoolstats.fee_101_150.toLocaleString()}
td(class="monospace") #{mempoolstats.fee_101_150.toLocaleString()}
tr
th(class="table-active properties-header") 151+ sat/B
td #{mempoolstats.fee_151_max.toLocaleString()}
td(class="monospace") #{mempoolstats.fee_151_max.toLocaleString()}

37
views/node-info.pug

@ -15,4 +15,39 @@ block content
h1 Node Info
hr
include includes/getinfo-table.pug
if (false)
pre
code #{JSON.stringify(getinfo, null, 4)}
if (true)
table(class="table")
tr
th(class="table-active properties-header") Version
td(class="monospace") #{getinfo.version}
tr
th(class="table-active properties-header") Protocol Version
td(class="monospace") #{getinfo.protocolversion}
tr
th(class="table-active properties-header") Connections
td(class="monospace") #{getinfo.connections.toLocaleString()}
tr
th(class="table-active properties-header") Block Count
td(class="monospace") #{getinfo.blocks.toLocaleString()}
tr
th(class="table-active properties-header") Testnet?
td(class="monospace") #{getinfo.testnet}
tr
th(class="table-active properties-header") Errors
td(class="monospace") #{getinfo.errors}
tr
- var scales = [ {val:1000000000000000, name:"quadrillion"}, {val:1000000000000, name:"trillion"}, {val:1000000000, name:"billion"}, {val:1000000, name:"million"} ];
- var scaleDone = false;
th(class="table-active properties-header") Difficulty
td(class="monospace")
span #{getinfo.difficulty.toLocaleString()}
each item in scales
if (!scaleDone)
- var fraction = Math.floor(getinfo.difficulty / item.val);
if (fraction >= 1)
- scaleDone = true;
span(class="text-muted") (#{fraction} #{item.name})

20
views/transaction.pug

@ -22,7 +22,7 @@ block content
h1(class="h2") Transaction
br
small #{txid}
small(class="monospace") #{txid}
hr
ul(class='nav nav-tabs mb-3')
@ -59,7 +59,7 @@ block content
table(class="table")
tr
th(class="table-active properties-header") Included in Block
td
td(class="monospace")
if (result.getblock)
a(href=("/block/" + result.getrawtransaction.blockhash)) #{result.getrawtransaction.blockhash}
if (result.getblock.height)
@ -71,9 +71,9 @@ block content
tr
th(class="table-active properties-header") Timestamp
if (result.getrawtransaction.time)
td #{moment.utc(new Date(result.getrawtransaction["time"] * 1000)).format("Y-MM-DD HH:mm:ss")} (utc)
td(class="monospace") #{moment.utc(new Date(result.getrawtransaction["time"] * 1000)).format("Y-MM-DD HH:mm:ss")} (utc)
else
td N/A
td(class="monospace") N/A
span(class="text-muted") (unconfirmed)
//tr
@ -82,11 +82,11 @@ block content
tr
th(class="table-active properties-header") Version
td #{result.getrawtransaction.version}
td(class="monospace") #{result.getrawtransaction.version}
tr
th(class="table-active properties-header") Size
td
td(class="monospace")
span #{result.getrawtransaction.size.toLocaleString()} bytes
if (result.getrawtransaction.vsize != result.getrawtransaction.size)
span (
@ -97,7 +97,7 @@ block content
tr
th(class="table-active properties-header")
span Locktime
td
td(class="monospace")
if (result.getrawtransaction.locktime < 500000000)
span Spendable in block
a(href=("/block-height/" + result.getrawtransaction.locktime)) #{result.getrawtransaction.locktime}
@ -115,7 +115,7 @@ block content
tr
th(class="table-active properties-header") Confirmations
td
td(class="monospace")
if (!result.getrawtransaction.confirmations || result.getrawtransaction.confirmations == 0)
strong(class="text-danger") 0 (unconfirmed)
else if (result.getrawtransaction.confirmations < 6)
@ -126,11 +126,11 @@ block content
if (result.getrawtransaction.vin[0].coinbase)
tr
th(class="table-active properties-header") Total Network Fees
td #{new Decimal(totalOutputValue).minus(totalInputValue)}
td(class="monospace") #{new Decimal(totalOutputValue).minus(totalInputValue)}
else
tr
th(class="table-active properties-header") Network Fee Paid
td
td(class="monospace")
strong #{new Decimal(totalInputValue).minus(totalOutputValue)}
span(class="text-muted") (#{totalInputValue} - #{totalOutputValue})
br

Loading…
Cancel
Save