Skip to content

Commit a1f40e1

Browse files
committed
fix(NetworkWidget): tpm
1 parent a4c613c commit a1f40e1

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

components/widgets/NetworkWidget.vue

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import Tooltip from "@/components/ui/Tooltip.vue"
55
/** API */
66
import { fetchTPS } from "@/services/api/stats"
77
8-
const displayTps = ref(0)
9-
const tps = ref(0)
8+
const displayTpm = ref(0)
9+
const tpm = ref(0)
1010
1111
const diff = ref(0)
1212
@@ -19,23 +19,23 @@ const pos = ref(0)
1919
onMounted(async () => {
2020
const data = await fetchTPS()
2121
22-
tps.value = data.current
22+
tpm.value = data.current * 60
2323
24-
const tpsInterval = setInterval(() => {
25-
if (displayTps.value >= data.current) {
26-
clearInterval(tpsInterval)
24+
const tpmInterval = setInterval(() => {
25+
if (displayTpm.value >= tpm.value) {
26+
clearInterval(tpmInterval)
2727
return
2828
}
2929
30-
displayTps.value += 0.001
31-
}, 5)
30+
displayTpm.value += 0.1
31+
}, 10)
3232
3333
diff.value = data.change_last_hour_pct
3434
35-
high.value = data.high
36-
low.value = data.low
35+
high.value = data.high * 60
36+
low.value = data.low * 60
3737
38-
pos.value = (100 * (tps.value - low.value)) / (high.value - low.value) + 40
38+
pos.value = (100 * (tpm.value - low.value)) / (high.value - low.value)
3939
const posInterval = setInterval(() => {
4040
if (displayPos.value >= pos.value) {
4141
clearInterval(posInterval)
@@ -56,10 +56,10 @@ onMounted(async () => {
5656
<Tooltip position="start" text-align="left">
5757
<Flex align="start" gap="16">
5858
<Flex direction="column" gap="6">
59-
<Text size="40" weight="600" color="primary" :class="[$style.ds_font, $style.tps_num]">
60-
{{ displayTps.toFixed(3) }}
59+
<Text size="40" weight="600" color="primary" :class="[$style.ds_font, $style.tpm_num]">
60+
{{ displayTpm.toFixed(1) }}
6161
</Text>
62-
<Text size="16" weight="700" color="tertiary" :class="$style.ds_font">TXS/S</Text>
62+
<Text size="16" weight="700" color="tertiary" :class="$style.ds_font">TXS/M</Text>
6363
</Flex>
6464

6565
<Text size="20" weight="600" :class="$style.ds_font" :color="diff > 0 ? 'green' : 'red'">
@@ -69,7 +69,7 @@ onMounted(async () => {
6969

7070
<template #content>
7171
<Flex direction="column" gap="6">
72-
<Text>Transactions per second</Text>
72+
<Text>Transactions per minute</Text>
7373
<Text color="tertiary">Calculated based on the last 24 hours</Text>
7474
</Flex>
7575
</template>
@@ -80,7 +80,7 @@ onMounted(async () => {
8080
<Flex direction="column" justify="between" gap="16" :class="$style.bottom">
8181
<Flex align="center" gap="6">
8282
<Icon name="level" size="12" color="secondary" />
83-
<Text size="13" weight="600" height="110" color="secondary">TPS Level</Text>
83+
<Text size="13" weight="600" height="110" color="secondary">TPM Level</Text>
8484
</Flex>
8585

8686
<Flex direction="column" gap="8">
@@ -92,15 +92,15 @@ onMounted(async () => {
9292
<template #content>
9393
<Flex align="start" direction="column" gap="6">
9494
<Text color="secondary">
95-
High: <Text color="primary">{{ high.toFixed(4) }} <Text color="secondary">TPS</Text></Text>
95+
High: <Text color="primary">{{ high.toFixed(4) }} <Text color="secondary">TPM</Text></Text>
9696
</Text>
9797

9898
<Text color="secondary">
99-
Current: <Text color="primary">{{ tps.toFixed(4) }} <Text color="secondary">TPS</Text></Text>
99+
Current: <Text color="primary">{{ tpm.toFixed(4) }} <Text color="secondary">TPM</Text></Text>
100100
</Text>
101101

102102
<Text color="secondary">
103-
Low: <Text color="primary">{{ low.toFixed(4) }} <Text color="secondary">TPS</Text></Text>
103+
Low: <Text color="primary">{{ low.toFixed(4) }} <Text color="secondary">TPM</Text></Text>
104104
</Text>
105105

106106
<Text color="tertiary"> Based on the last 7 days </Text>
@@ -130,7 +130,7 @@ onMounted(async () => {
130130
padding: 16px 16px 20px 16px;
131131
}
132132
133-
.tps_num {
133+
.tpm_num {
134134
background: -webkit-linear-gradient(var(--txt-primary), var(--txt-tertiary));
135135
background-clip: text;
136136
-webkit-background-clip: text;

0 commit comments

Comments
 (0)