mirror of
https://github.com/mempool/mempool.git
synced 2025-03-03 17:47:01 +01:00
Show getnetworkhashps core result in dashboard + update unit formatting
This commit is contained in:
parent
b6fcf40565
commit
1f4cf1710a
3 changed files with 3 additions and 3 deletions
|
@ -630,6 +630,7 @@ class Routes {
|
||||||
res.json({
|
res.json({
|
||||||
hashrates: hashrates,
|
hashrates: hashrates,
|
||||||
difficulty: difficulty,
|
difficulty: difficulty,
|
||||||
|
currentHashrate: await bitcoinClient.getNetworkHashPs()
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
res.status(500).send(e instanceof Error ? e.message : e);
|
res.status(500).send(e instanceof Error ? e.message : e);
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<h5 class="card-title" i18n="mining.hashrate">Hashrate</h5>
|
<h5 class="card-title" i18n="mining.hashrate">Hashrate</h5>
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
{{ hashrates.currentHashrate | amountShortener }}
|
{{ hashrates.currentHashrate | amountShortener: 1 : 'H/s' }}
|
||||||
<span class="symbol">hashes/sec</span>
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
|
|
|
@ -125,7 +125,7 @@ export class HashrateChartComponent implements OnInit {
|
||||||
return {
|
return {
|
||||||
blockCount: parseInt(response.headers.get('x-total-count'), 10),
|
blockCount: parseInt(response.headers.get('x-total-count'), 10),
|
||||||
currentDifficulty: Math.round(data.difficulty[data.difficulty.length - 1].difficulty * 100) / 100,
|
currentDifficulty: Math.round(data.difficulty[data.difficulty.length - 1].difficulty * 100) / 100,
|
||||||
currentHashrate: data.hashrates[data.hashrates.length - 1].avgHashrate,
|
currentHashrate: data.currentHashrate
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
retryWhen((errors) => errors.pipe(
|
retryWhen((errors) => errors.pipe(
|
||||||
|
|
Loading…
Add table
Reference in a new issue