Skip to content

Commit 8a42845

Browse files
committed
Add TVS and rename stats tab
1 parent 19903e0 commit 8a42845

5 files changed

Lines changed: 23 additions & 15 deletions

File tree

components/Feed.vue

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { getRankCategory } from "@/services/constants/rollups"
1010
import Tooltip from "@/components/ui/Tooltip.vue"
1111
1212
/** API */
13-
import { fetchPriceSeries } from "@/services/api/stats"
13+
import { fetchPriceSeries, fetchTVS } from "@/services/api/stats"
1414
1515
/** Store */
1616
import { useAppStore } from "@/store/app.store"
@@ -38,13 +38,14 @@ const topRollup = computed(() => {
3838
}
3939
})
4040
41+
const isLoading = ref(true)
4142
const series = ref([])
4243
const price = reactive({
4344
value: 0,
4445
diff: 0,
4546
side: null,
4647
})
47-
48+
const tvs = ref(0)
4849
onMounted(async () => {
4950
const dataSeries = await fetchPriceSeries({ from: parseInt(DateTime.now().minus({ days: 3 }).ts / 1_000) })
5051
series.value = dataSeries
@@ -58,6 +59,13 @@ onMounted(async () => {
5859
side = price.value - prevDayClosePrice > 0 ? "rise" : "fall"
5960
}
6061
price.side = side
62+
63+
const _tvs = await fetchTVS({ period: null })
64+
if (_tvs.value) {
65+
tvs.value = _tvs.value
66+
}
67+
68+
isLoading.value = false
6169
})
6270
</script>
6371
@@ -132,19 +140,19 @@ onMounted(async () => {
132140
<Flex align="center" gap="6" :class="$style.stat">
133141
<Icon name="coins" size="12" color="secondary" :class="$style.icon" />
134142
<Flex align="center" gap="4">
135-
<Text size="12" weight="500" color="tertiary" noWrap :class="$style.key">Supply:</Text>
143+
<Text size="12" weight="500" color="tertiary" noWrap :class="$style.key">TVS:</Text>
136144
137-
<Text v-if="head.total_supply" size="12" weight="600" noWrap :class="$style.value">
138-
{{ abbreviate(totalSupply, 2) }} TIA
145+
<Text v-if="!isLoading" size="12" weight="600" noWrap :class="$style.value">
146+
{{ abbreviate(tvs, 2) }} USD
139147
</Text>
140148
<Skeleton v-else w="40" h="12" />
141149
</Flex>
142150
</Flex>
143151
144152
<template #content>
145153
<Flex align="center" justify="between" gap="8">
146-
<Text size="12" weight="500" color="tertiary">Total Supply:</Text>
147-
<Text size="12" weight="600" color="secondary"> {{ abbreviate(totalSupplyUSD, 2) }} USD </Text>
154+
<Text size="12" weight="500" color="tertiary">Total Value Secured:</Text>
155+
<Text size="12" weight="600" color="secondary"> {{ comma(tvs) }} USD </Text>
148156
</Flex>
149157
</template>
150158
</Tooltip>

components/LeftSidebar.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ const mainLinks = reactive([
9292
show: true,
9393
},
9494
{
95-
name: "Ecosystem",
96-
path: "/stats?tab=ecosystem",
97-
queryParam: { tab: "ecosystem" },
95+
name: "Nodes",
96+
path: "/stats?tab=nodes",
97+
queryParam: { tab: "nodes" },
9898
show: isMainnet(),
9999
},
100100
],

components/modules/stats/tabs/EcosystemTab.vue renamed to components/modules/stats/tabs/NodesTab.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { capitilize, sortArrayOfObjects } from "@/services/utils"
1313
import { fetchNodeStats } from "@/services/api/stats"
1414
1515
const isLoading = ref(true)
16-
const series = computed(() => getSeriesByGroupAndType("Ecosystem"))
16+
const series = computed(() => getSeriesByGroupAndType("Nodes"))
1717
1818
const getNodeStats = async (name) => {
1919
const data = await fetchNodeStats({ name })

pages/stats/index.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Button from "@/components/ui/Button.vue"
55
/** Stats Tabs */
66
import BlocksTab from "@/components/modules/stats/tabs/BlocksTab.vue"
77
import GeneralTab from "@/components/modules/stats/tabs/GeneralTab.vue"
8-
import EcosystemTab from "@/components/modules/stats/tabs/EcosystemTab.vue"
8+
import NodesTab from "~/components/modules/stats/tabs/NodesTab.vue"
99
import RollupsTab from "@/components/modules/stats/tabs/RollupsTab.vue"
1010
1111
/** Services */
@@ -76,7 +76,7 @@ const tabs = ref([
7676
visible: true,
7777
},
7878
{
79-
name: "ecosystem",
79+
name: "nodes",
8080
visible: isMainnet(),
8181
},
8282
])
@@ -165,7 +165,7 @@ watch(
165165
<GeneralTab v-if="activeTab === 'general'" />
166166
<BlocksTab v-if="activeTab === 'blocks'" />
167167
<RollupsTab v-if="activeTab === 'rollups'" @onUpdateSection="handleSectionUpdate" />
168-
<EcosystemTab v-if="activeTab === 'ecosystem'" />
168+
<NodesTab v-if="activeTab === 'nodes'" />
169169
</Flex>
170170
</template>
171171

services/constants/stats.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export const STATS_SERIES = [
127127
],
128128
},
129129
{
130-
group: 'Ecosystem',
130+
group: 'Nodes',
131131
series: [
132132
{
133133
name: 'nodetype',

0 commit comments

Comments
 (0)