Skip to content

Commit

Permalink
Node details page improvements
Browse files Browse the repository at this point in the history
- Corrected empty "HOST" field
- Added a link from "PEERS" field to Peers page
- Redefine forksUrls page as a multiline variable (more readable)
- Added tooltips
  • Loading branch information
Thierry61 committed May 27, 2023
1 parent 0669713 commit c3d3255
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions views/node-details.pug
Original file line number Diff line number Diff line change
Expand Up @@ -35,45 +35,45 @@ block content

+contentSection("Node Summary")
+summaryRow(4)
+summaryItem("Version")
+summaryItem("Version", "Node version number and subversion string")
| #{getnetworkinfo.version} (#{getnetworkinfo.subversion})

+summaryItem("Protocol Version")
+summaryItem("Protocol Version", "Protocol version number")
| #{getnetworkinfo.protocolversion}

+summaryItem("Status")
+summaryItem("Status", "Block download progress or synchronized state")
if (getblockchaininfo.initialblockdownload || getblockchaininfo.headers > getblockchaininfo.blocks)
span Initial block download progress #{(100 * getblockchaininfo.verificationprogress).toLocaleString()}%
else
span.text-success Synchronized

+summaryItem("Uptime")
+summaryItem("Uptime", "How long this node has been running")
- var startTimeAgo = moment.duration(uptimeSeconds * 1000);
span #{startTimeAgo.format()}

+contentSection("Blockchain")
+summaryRow(4 + (getblockchaininfo.size_on_disk ? 1 : 0) + (getblockchaininfo.pruned ? 1 : 0))
+summaryItem("Chain")
+summaryItem("Chain", "Network name (main, test, signet, regtest)")
if (getblockchaininfo.chain == "main")
span.text-success #{getblockchaininfo.chain}
else
span.text-warning #{getblockchaininfo.chain}

+summaryItem("Block Count")
+summaryItem("Block Count", "Current height of the most-work fully-validated chain. Also number of headers this node has validated")
| #{getblockchaininfo.blocks.toLocaleString()}
if (getblockchaininfo.headers != getblockchaininfo.blocks)
br
small.text-muted (headers: #{getblockchaininfo.headers.toLocaleString()})

+summaryItem("Difficulty")
+summaryItem("Difficulty", "Mining difficulty (adjusted every 2016 blocks to maintain the time it takes to process one block at around 10 minutes)")
- var difficultyData = utils.formatLargeNumber(getblockchaininfo.difficulty, 3);
span.border-dotted(title=parseFloat(getblockchaininfo.difficulty).toLocaleString(), data-bs-toggle="tooltip")
span #{difficultyData[0]}
span x 10
sup #{difficultyData[1].exponent}

if (getblockchaininfo.size_on_disk)
+summaryItem("Data Size")
+summaryItem("Data Size", "Estimated size of the block and undo files on disk")
- var sizeData = utils.formatLargeNumber(getblockchaininfo.size_on_disk, 1);
| #{sizeData[0]} #{sizeData[1].abbreviation}B

Expand All @@ -96,7 +96,7 @@ block content

span #{pruneTargetSize[0]} #{pruneTargetSize[1].abbreviation}B

+summaryItem("Data Indexes")
+summaryItem("Data Indexes", "Status of available indices currently running in this node")
ul.list-unstyled.mb-0
li
span.me-2 txindex
Expand All @@ -122,13 +122,21 @@ block content


if (getdeploymentinfo && getdeploymentinfo.deployments)
- var forkUrls = {"bip34":"https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki", "bip65":"https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki", "bip66":"https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki", "csv":"https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki", "segwit":"https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki", "taproot":"https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki"};
-
var forkUrls = {
"bip34": { "link": "https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki", "title": "Block v2, Height in Coinbase" },
"bip65": { "link": "https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki", "title": "OP_CHECKLOCKTIMEVERIFY" },
"bip66": { "link": "https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki", "title": "Strict DER signatures" },
"csv": { "link": "https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki", "title": "OP_CHECKSEQUENCEVERIFY" },
"segwit": { "link": "https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki", "title": "Segregated Witness (Consensus layer)" },
"taproot":{ "link": "https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki", "title": "Taproot: SegWit version 1 spending rules" }
};
+contentSection("Deployments")
+summaryRow(utils.objectProperties(getdeploymentinfo.deployments).length)
each item, itemName in getdeploymentinfo.deployments
// (title, titleDesc, subtitle, subtitleDesc, linkText, linkUrl)
+summaryItem(itemName)
+summaryItem(itemName, forkUrls[itemName] ? forkUrls[itemName].title : null)
if (item.active)
span.me-2
span.text-success active
Expand Down Expand Up @@ -166,7 +174,7 @@ block content

if (forkUrls[itemName])
small
a(href=forkUrls[itemName], title=`More info about ${itemName}`, data-bs-toggle="tooltip", target="_blank")
a(href=forkUrls[itemName].link, title=`More info about ${itemName}`, data-bs-toggle="tooltip", target="_blank")
i.bi-box-arrow-up-right.small


Expand Down Expand Up @@ -247,26 +255,26 @@ block content

+contentSection("Network")
+summaryRow(4)
+summaryItem("Host")
| #{global.rpcClient.host}
span.text-muted :#{global.rpcClient.port}
+summaryItem("Host", "IP address and port number of RPC node")
| #{global.rpcClient.options.host}
span.text-muted :#{global.rpcClient.options.port}

+summaryItem("Peers")
+summaryItem("Peers", "Number of peers connected to this node.", null, null, "icon:bi-diagram-3", "./peers", "Details about the peers connected to this node")
| #{getnetworkinfo.connections.toLocaleString()}

if (getnetworkinfo.connections_in)
br
span.text-muted (#{getnetworkinfo.connections_in.toLocaleString()} in; #{getnetworkinfo.connections_out.toLocaleString()} out)

+summaryItem("Upload")
+summaryItem("Upload", "Total bytes sent since this node started")
- var upData = utils.formatLargeNumber(getnettotals.totalbytessent, 1);
- var upRateData = utils.formatLargeNumber(getnettotals.totalbytessent / uptimeSeconds, 1);

i.bi-arrow-up.me-2
span.me-2 #{upData[0]} #{upData[1].abbreviation}B
small.text-muted (#{upRateData[0]} #{upRateData[1].abbreviation}B/s)

+summaryItem("Download")
+summaryItem("Download", "Total bytes received since this node started")
- var downData = utils.formatLargeNumber(getnettotals.totalbytesrecv, 1);
- var downRateData = utils.formatLargeNumber(getnettotals.totalbytesrecv / uptimeSeconds, 1);

Expand Down Expand Up @@ -347,4 +355,4 @@ block content
pre
code.json(data-lang="json") #{JSON.stringify(global.getindexinfo, null, 4)}



0 comments on commit c3d3255

Please sign in to comment.