Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Update stats percentage when units change (#193) #286

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/Utility/Stat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export default {
title: String,
value: Number,
suffix: String,
rawValue: Number,
abbreviateValue: {
type: Boolean,
default: false
Expand Down Expand Up @@ -128,7 +129,7 @@ export default {
},
methods: {},
watch: {
value(newValue, oldValue) {
rawValue(newValue, oldValue) {
if (this.showNumericChange) {
if (oldValue <= 0) {
this.change = {
Expand Down
4 changes: 4 additions & 0 deletions src/views/Bitcoin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@
title="Connections"
:value="stats.peers"
suffix="Peers"
:raw-value="stats.peers"
showNumericChange
></stat>
</b-col>
Expand All @@ -272,6 +273,7 @@
title="Mempool"
:value="abbreviateSize(stats.mempool)[0]"
:suffix="abbreviateSize(stats.mempool)[1]"
:raw-value="stats.mempool"
showPercentChange
></stat>
</b-col>
Expand All @@ -280,6 +282,7 @@
title="Hashrate"
:value="abbreviateHashRate(stats.hashrate)[0]"
:suffix="abbreviateHashRate(stats.hashrate)[1]"
:raw-value="stats.hashrate"
showPercentChange
></stat>
</b-col>
Expand All @@ -288,6 +291,7 @@
title="Blockchain Size"
:value="abbreviateSize(stats.blockchainSize)[0]"
:suffix="abbreviateSize(stats.blockchainSize)[1]"
:raw-value="stats.blockchainSize"
showPercentChange
></stat>
</b-col>
Expand Down
4 changes: 4 additions & 0 deletions src/views/Lightning.vue
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
<stat
title="Connections"
:value="numPeers"
:raw-value="numPeers"
suffix="Peers"
showNumericChange
></stat>
Expand All @@ -212,6 +213,7 @@
<stat
title="Active Channels"
:value="numActiveChannels"
:raw-value="numActiveChannels"
suffix="Channels"
showNumericChange
></stat>
Expand All @@ -220,6 +222,7 @@
<stat
title="Max Send"
:value="maxSend | unit"
:raw-value="maxSend | unit"
:suffix="unit | formatUnit"
:hasDecimals="unit === 'btc'"
abbreviateValue
Expand All @@ -229,6 +232,7 @@
<stat
title="Max Receive"
:value="maxReceive | unit"
:raw-value="maxReceive | unit"
:suffix="unit | formatUnit"
:hasDecimals="unit === 'btc'"
abbreviateValue
Expand Down