Browse Source

include JSON on /node-status

fix-133-memory-crash
Dan Janosik 6 years ago
parent
commit
1edf9e0703
No known key found for this signature in database GPG Key ID: C6F8CE9FFDB2CED2
  1. 193
      views/node-status.pug

193
views/node-status.pug

@ -20,90 +20,117 @@ block content
pre
code(class="json") #{JSON.stringify(getblockchaininfo, null, 4)}
if (global.client)
div(class="card mb-3 shadow-sm")
div(class="card-header")
span(class="h6") Summary
div(class="card-body")
table(class="table details-table mb-0")
tr
td(class="properties-header") Host : Port
td(class="monospace") #{global.client.host + " : " + global.client.port}
tr
td(class="properties-header") Chain
td(class="monospace") #{getblockchaininfo.chain}
tr
td(class="properties-header") Version
td(class="monospace") #{getnetworkinfo.version}
span(class="monospace") (#{getnetworkinfo.subversion})
tr
td(class="properties-header") Protocol Version
td(class="monospace") #{getnetworkinfo.protocolversion}
if (getblockchaininfo.size_on_disk)
- var sizeData = utils.formatLargeNumber(getblockchaininfo.size_on_disk, 2);
ul(class='nav nav-tabs mb-3')
li(class="nav-item")
a(data-toggle="tab", href="#tab-details", class="nav-link active", role="tab") Details
li(class="nav-item")
a(data-toggle="tab", href="#tab-json", class="nav-link", role="tab") JSON
div(class="tab-content")
div(id="tab-details", class="tab-pane active", role="tabpanel")
div(class="card mb-3 shadow-sm")
div(class="card-header")
span(class="h6") Summary
div(class="card-body")
table(class="table details-table mb-0")
tr
td(class="properties-header") Host : Port
td(class="monospace") #{global.client.host + " : " + global.client.port}
tr
td(class="properties-header") Blockchain Size
td(class="monospace") #{sizeData[0]} #{sizeData[1].abbreviation}B
td(class="properties-header") Chain
td(class="monospace") #{getblockchaininfo.chain}
tr
td(class="properties-header") Version
td(class="monospace") #{getnetworkinfo.version}
span(class="monospace") (#{getnetworkinfo.subversion})
tr
td(class="properties-header") Protocol Version
td(class="monospace") #{getnetworkinfo.protocolversion}
if (getblockchaininfo.size_on_disk)
- var sizeData = utils.formatLargeNumber(getblockchaininfo.size_on_disk, 2);
tr
td(class="properties-header") Blockchain Size
td(class="monospace") #{sizeData[0]} #{sizeData[1].abbreviation}B
br
span(class="text-muted") (pruned: #{getblockchaininfo.pruned})
tr
td(class="properties-header") Connections
td(class="monospace") #{getnetworkinfo.connections.toLocaleString()}
tr
td(class="properties-header") Block Count
td(class="monospace") #{getblockchaininfo.blocks.toLocaleString()}
br
span(class="text-muted") (pruned: #{getblockchaininfo.pruned})
tr
td(class="properties-header") Connections
td(class="monospace") #{getnetworkinfo.connections.toLocaleString()}
tr
td(class="properties-header") Block Count
td(class="monospace") #{getblockchaininfo.blocks.toLocaleString()}
br
span(class="text-muted") (headers: #{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;
td(class="properties-header") Difficulty
td(class="monospace")
- var difficultyData = utils.formatLargeNumber(getblockchaininfo.difficulty, 3);
span(title=parseFloat(getblockchaininfo.difficulty).toLocaleString(), data-toggle="tooltip")
span #{difficultyData[0]}
span x 10
sup #{difficultyData[1].exponent}
tr
td(class="properties-header") Status
td(class="monospace")
if (getblockchaininfo.initialblockdownload || getblockchaininfo.headers > getblockchaininfo.blocks)
span Initial block download progress #{(100 * getblockchaininfo.verificationprogress).toLocaleString()}%
else
span Synchronized with network
- var startTimeAgo = moment.duration(uptimeSeconds * 1000);
tr
td(class="properties-header") Uptime
td(class="monospace") #{startTimeAgo.format()}
tr
td(class="properties-header") Network Traffic
td(class="monospace")
- var downData = utils.formatLargeNumber(getnettotals.totalbytesrecv, 2);
- var downRateData = utils.formatLargeNumber(getnettotals.totalbytesrecv / uptimeSeconds, 2);
- var upData = utils.formatLargeNumber(getnettotals.totalbytessent, 2);
- var upRateData = utils.formatLargeNumber(getnettotals.totalbytessent / uptimeSeconds, 2);
span Total Download: #{downData[0]} #{downData[1].abbreviation}B
span(class="text-muted") (avg #{downRateData[0]} #{downRateData[1].abbreviation}B/s)
br
span Total Upload: #{upData[0]} #{upData[1].abbreviation}B
span(class="text-muted") (avg #{upRateData[0]} #{upRateData[1].abbreviation}B/s)
tr
td(class="properties-header") Warnings
td(class="monospace")
if (getblockchaininfo.warnings && getblockchaininfo.warnings.trim().length > 0)
span #{getblockchaininfo.warnings}
else
span None
span(class="text-muted") (headers: #{getblockchaininfo.headers.toLocaleString()})
tr
td(class="properties-header") Difficulty
td(class="monospace")
- var difficultyData = utils.formatLargeNumber(getblockchaininfo.difficulty, 3);
span(title=parseFloat(getblockchaininfo.difficulty).toLocaleString(), data-toggle="tooltip")
span #{difficultyData[0]}
span x 10
sup #{difficultyData[1].exponent}
tr
td(class="properties-header") Status
td(class="monospace")
if (getblockchaininfo.initialblockdownload || getblockchaininfo.headers > getblockchaininfo.blocks)
span Initial block download progress #{(100 * getblockchaininfo.verificationprogress).toLocaleString()}%
else
span Synchronized with network
tr
- var startTimeAgo = moment.duration(uptimeSeconds * 1000);
td(class="properties-header") Uptime
td(class="monospace") #{startTimeAgo.format()}
tr
td(class="properties-header") Network Traffic
td(class="monospace")
- var downData = utils.formatLargeNumber(getnettotals.totalbytesrecv, 2);
- var downRateData = utils.formatLargeNumber(getnettotals.totalbytesrecv / uptimeSeconds, 2);
- var upData = utils.formatLargeNumber(getnettotals.totalbytessent, 2);
- var upRateData = utils.formatLargeNumber(getnettotals.totalbytessent / uptimeSeconds, 2);
span Total Download: #{downData[0]} #{downData[1].abbreviation}B
span(class="text-muted") (avg #{downRateData[0]} #{downRateData[1].abbreviation}B/s)
br
span Total Upload: #{upData[0]} #{upData[1].abbreviation}B
span(class="text-muted") (avg #{upRateData[0]} #{upRateData[1].abbreviation}B/s)
tr
td(class="properties-header") Warnings
td(class="monospace")
if (getblockchaininfo.warnings && getblockchaininfo.warnings.trim().length > 0)
span #{getblockchaininfo.warnings}
else
span None
div(id="tab-json", class="tab-pane", role="tabpanel")
ul(class='nav nav-pills mb-3')
li(class="nav-item")
a(data-toggle="tab", href="#tab-getblockchaininfo", class="nav-link active", role="tab") getblockchaininfo
li(class="nav-item")
a(data-toggle="tab", href="#tab-getnettotals", class="nav-link", role="tab") getnettotals
li(class="nav-item")
a(data-toggle="tab", href="#tab-getnetworkinfo", class="nav-link", role="tab") getnetworkinfo
div(class="tab-content")
div(id="tab-getblockchaininfo", class="tab-pane active", role="tabpanel")
pre
code(class="json", data-lang="json") #{JSON.stringify(getblockchaininfo, null, 4)}
div(id="tab-getnettotals", class="tab-pane", role="tabpanel")
pre
code(class="json", data-lang="json") #{JSON.stringify(getnettotals, null, 4)}
div(id="tab-getnetworkinfo", class="tab-pane", role="tabpanel")
pre
code(class="json", data-lang="json") #{JSON.stringify(getnetworkinfo, null, 4)}
else
div(class="alert alert-warning") No active RPC connection
Loading…
Cancel
Save