Browse Source

- consistent footer across site

- consistent url for /mempool-summary
- internal linking to /rpc-browser for RPC command references (which still links out to dev docs on bitcoin.org)
fix-133-memory-crash
Dan Janosik 7 years ago
parent
commit
d8219597db
  1. 6
      routes/baseActionsRouter.js
  2. 21
      views/index.pug
  3. 22
      views/layout.pug
  4. 29
      views/mempool-summary.pug
  5. 20
      views/node-info.pug

6
routes/baseActionsRouter.js

@ -90,7 +90,7 @@ router.get("/node-info", function(req, res) {
});
});
router.get("/mempool", function(req, res) {
router.get("/mempool-summary", function(req, res) {
var client = global.client;
rpcApi.getMempoolInfo().then(function(getmempoolinfo) {
@ -99,12 +99,12 @@ router.get("/mempool", function(req, res) {
rpcApi.getMempoolStats().then(function(mempoolstats) {
res.locals.mempoolstats = mempoolstats;
res.render("mempool");
res.render("mempool-summary");
});
}).catch(function(err) {
res.locals.userMessage = "Unable to connect to Bitcoin Node at " + env.bitcoind.host + ":" + env.bitcoind.port;
res.render("mempool");
res.render("mempool-summary");
});
});

21
views/index.pug

@ -24,24 +24,3 @@ block content
- var blockOffset = 0;
include includes/blocks-list.pug
hr
div(class="")
ul
li MIT-licensed source code available on github:
a(href="https://github.com/janoside/btc-rpc-explorer") janoside/btc-rpc-explorer
if (sourcecodeVersion)
span (@
a(href=("https://github.com/janoside/btc-rpc-explorer/commit/" + sourcecodeVersion)) #{sourcecodeVersion}
span )
li Public instance maintained at
a(href="https://btc-explorer.com") https://btc-explorer.com
li Donate:
a(href="bitcoin:3NPGpNyLLmVKCEcuipBs7G4KpQJoJXjDGe") BTC
span - 3NPGpNyLLmVKCEcuipBs7G4KpQJoJXjDGe
li © 2018
a(href="https://danjanosik.com") Dan Janosik

22
views/layout.pug

@ -49,7 +49,7 @@ html
li(class="nav-item")
a(href="/rpc-terminal", class="nav-link") RPC Terminal
li(class="nav-item")
a(href="/mempool", class="nav-link") Mempool Summary
a(href="/mempool-summary", class="nav-link") Mempool Summary
hr
@ -62,6 +62,26 @@ html
div(style="margin-bottom: 30px;")
footer(class="pt-4 my-md-5 pt-md-5 border-top")
ul
li MIT-licensed source code available on github:
a(href="https://github.com/janoside/btc-rpc-explorer") janoside/btc-rpc-explorer
if (sourcecodeVersion)
span (@
a(href=("https://github.com/janoside/btc-rpc-explorer/commit/" + sourcecodeVersion)) #{sourcecodeVersion}
span )
li Public instance maintained at
a(href="https://btc-explorer.com") https://btc-explorer.com
li Donate:
a(href="bitcoin:3NPGpNyLLmVKCEcuipBs7G4KpQJoJXjDGe") BTC
span - 3NPGpNyLLmVKCEcuipBs7G4KpQJoJXjDGe
li © 2018
a(href="https://danjanosik.com") Dan Janosik
div(class="d-none d-md-block")
a(href="https://github.com/janoside/btc-rpc-explorer")
img(style="position: absolute; top: 0; left: 0; border: 0;", src="https://camo.githubusercontent.com/82b228a3648bf44fc1163ef44c62fcc60081495e/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f7265645f6161303030302e706e67", alt="Fork me on GitHub", data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_red_aa0000.png")

29
views/mempool.pug → views/mempool-summary.pug

@ -9,39 +9,20 @@ block content
if (getmempoolinfo)
p Data from RPC command
a(href="https://bitcoin.org/en/developer-reference#getmempoolinfo") getmempoolinfo
a(href="/rpc-browser?method=getmempoolinfo") getmempoolinfo
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") Tx Size
th(class="table-active properties-header") Memory Usage
td(class="monospace")
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") Total Size
td(class="monospace")
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})
span #{utils.formatBytes(getmempoolinfo.usage)}
span(class="text-muted") (virtual size: #{utils.formatBytes(getmempoolinfo.bytes)})
tr
th(class="table-active properties-header") Max Size
td(class="monospace") #{getmempoolinfo.maxmempool.toLocaleString()}
td(class="monospace") #{utils.formatBytes(getmempoolinfo.maxmempool)}
tr
th(class="table-active properties-header") Min Fee
td(class="monospace") #{getmempoolinfo.mempoolminfee.toLocaleString()}

20
views/node-info.pug

@ -9,9 +9,11 @@ block content
if (getblockchaininfo)
p Data from RPC commands
a(href="https://bitcoin.org/en/developer-reference#getblockchaininfo") getblockchaininfo
span and
a(href="https://bitcoin.org/en/developer-reference#getnetworkinfo") getnetworkinfo
a(href="/rpc-browser?method=getblockchaininfo") getblockchaininfo
span ,
a(href="/rpc-browser?method=getnetworkinfo") getnetworkinfo
span , and
a(href="/rpc-browser?method=getnettotals") getnettotals
if (false)
pre
@ -32,16 +34,14 @@ block content
tr
th(class="table-active properties-header") Blockchain Size on Disk
td(class="monospace") #{getblockchaininfo.size_on_disk.toLocaleString()}
span (pruned: #{getblockchaininfo.pruned})
span(class="text-muted") (pruned: #{getblockchaininfo.pruned})
tr
th(class="table-active properties-header") Connections
td(class="monospace") #{getnetworkinfo.connections.toLocaleString()}
tr
th(class="table-active properties-header") Block Count
td(class="monospace") #{getblockchaininfo.blocks.toLocaleString()}
tr
th(class="table-active properties-header") Header Count
td(class="monospace") #{getblockchaininfo.headers.toLocaleString()}
span(class="text-muted") (header count: #{getblockchaininfo.headers.toLocaleString()})
tr
- var scales = [ {val:1000000000000000, name:"quadrillion"}, {val:1000000000000, name:"trillion"}, {val:1000000000, name:"billion"}, {val:1000000, name:"million"} ];
- var scaleDone = false;
@ -79,5 +79,9 @@ block content
tr
th(class="table-active properties-header") Warnings
td(class="monospace") #{getblockchaininfo.warnings}
td(class="monospace")
if (getblockchaininfo.warnings && getblockchaininfo.warnings.trim().length > 0)
span #{getblockchaininfo.warnings}
else
span None
Loading…
Cancel
Save