From 8bfcf806e73ac6e41e50cb2b65b40a3e9d16219f Mon Sep 17 00:00:00 2001 From: gusevpm Date: Sat, 18 Oct 2025 22:20:43 +0200 Subject: [PATCH 01/19] Signals and version for validators --- assets/icons.json | 3 +- .../modules/validator/ValidatorOverview.vue | 54 +++++- .../modules/validator/tables/SignalsTable.vue | 156 ++++++++++++++++++ .../modules/validator/tables/VotesTable.vue | 7 +- pages/validators.vue | 8 + services/api/validator.js | 32 ++++ 6 files changed, 251 insertions(+), 9 deletions(-) create mode 100644 components/modules/validator/tables/SignalsTable.vue diff --git a/assets/icons.json b/assets/icons.json index e354e95e..f960568f 100644 --- a/assets/icons.json +++ b/assets/icons.json @@ -238,5 +238,6 @@ "drop": "M17 3.33989C18.5202 4.21758 19.7826 5.47997 20.6603 7.00017C21.538 8.52038 22 10.2448 22 12.0002C22 13.7556 21.5379 15.48 20.6602 17.0002C19.7825 18.5204 18.5201 19.7828 16.9999 20.6605C15.4797 21.5381 13.7552 22.0002 11.9998 22.0001C10.2445 22.0001 8.52002 21.538 6.99984 20.6603C5.47965 19.7826 4.21729 18.5202 3.33963 17C2.46198 15.4797 1.99996 13.7553 2 11.9999L2.005 11.6759C2.061 9.94888 2.56355 8.26585 3.46364 6.79089C4.36373 5.31592 5.63065 4.09934 7.14089 3.25977C8.65113 2.42021 10.3531 1.98629 12.081 2.00033C13.8089 2.01437 15.5036 2.47589 17 3.33989ZM12.823 7.43189C12.731 7.29865 12.6081 7.18973 12.4647 7.11448C12.3214 7.03924 12.1619 6.99993 12 6.99993C11.8381 6.99993 11.6786 7.03924 11.5353 7.11448C11.3919 7.18973 11.269 7.29865 11.177 7.43189L8.575 11.1959C7.553 12.8659 7.941 14.9319 9.45 16.1249C10.178 16.6923 11.0745 17.0004 11.9975 17.0004C12.9205 17.0004 13.817 16.6923 14.545 16.1249C16.055 14.9339 16.442 12.8649 15.449 11.2429L12.823 7.43189Z", "faucet": "M21 21H3C3 19.9 3.9 19 5 19H19C20.11 19 21 19.89 21 21M19 7C19 5.39 17.93 3 15 3S11 5.39 11 7V18H13V7C13 6.54 13.17 5 15 5S17 6.54 17 7H16.5V9H19.5V7H19M7 12C6.45 12 6 12.45 6 13V14H3V15H6V18H8V13C8 12.45 7.55 12 7 12M21 14H18V13C18 12.45 17.55 12 17 12S16 12.45 16 13V18H18V15H21V14Z", "commit": "M17,12C17,14.42 15.28,16.44 13,16.9V21H11V16.9C8.72,16.44 7,14.42 7,12C7,9.58 8.72,7.56 11,7.1V3H13V7.1C15.28,7.56 17,9.58 17,12M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9Z", - "laurel": "M16.956 2.057c.355.124.829.375 1.303.796a3.77 3.77 0 0 1 1.246 2.204c.173.989-.047 1.894-.519 2.683l-.123.194q-.097.147-.196.272q.066.234.117.471q.26-.178.545-.307c.851-.389 1.727-.442 2.527-.306q.226.04.346.076a1 1 0 0 1 .689.712l.029.13q.015.08.03.18a4.45 4.45 0 0 1-.324 2.496a3.94 3.94 0 0 1-1.71 1.85l-.242.12a4.23 4.23 0 0 1-2.234.349A9 9 0 0 1 17.997 15c.37.016.748.093 1.128.24c.732.28 1.299.758 1.711 1.367a3.95 3.95 0 0 1 .654 1.613a1 1 0 0 1-.356.917a3.8 3.8 0 0 1-.716.443c-.933.455-1.978.588-3.043.179l-.032-.015l-.205-.086a3.6 3.6 0 0 1-1.33-1.069l-.143-.197a4 4 0 0 1-.26-.433a6 6 0 0 1-.927.511q.18.262.337.56a7.4 7.4 0 0 1 .66 1.747a1 1 0 0 1-1.95.444l-.028-.11a6 6 0 0 0-.449-1.143C12.706 19.323 12.338 19 12 19s-.706.323-1.048.969a5.6 5.6 0 0 0-.367.874l-.082.269l-.028.11a1 1 0 0 1-1.95-.444a7.3 7.3 0 0 1 .66-1.747q.158-.298.337-.561a6.4 6.4 0 0 1-.93-.508a4 4 0 0 1-.256.43c-.366.541-.855.98-1.473 1.267l-.238.1c-.994.382-1.97.292-2.855-.091l-.188-.087a3.8 3.8 0 0 1-.716-.443a1 1 0 0 1-.356-.917a3.95 3.95 0 0 1 .654-1.613a3.6 3.6 0 0 1 1.71-1.368c.38-.146.758-.223 1.13-.24a9 9 0 0 1-.445-1.023a4.23 4.23 0 0 1-2.233-.348a4 4 0 0 1-.916-.587l-.207-.191a4 4 0 0 1-.724-.977l-.105-.216a4.45 4.45 0 0 1-.265-2.806a1 1 0 0 1 .69-.712q.119-.036.345-.076c.801-.135 1.678-.082 2.53.308q.283.129.545.304q.048-.235.112-.47a5 5 0 0 1-.194-.272c-.556-.832-.83-1.806-.642-2.877l.05-.242a3.75 3.75 0 0 1 1.027-1.803l.169-.159a4 4 0 0 1 1.303-.796a1 1 0 0 1 .975.178c.2.168.462.446.719.83c.556.833.83 1.807.642 2.878a3.77 3.77 0 0 1-1.246 2.204c-.303.27-.607.47-.879.61A7.5 7.5 0 0 0 7 10.728C7 14.23 9.285 17 12 17s5-2.77 5-6.276a7.6 7.6 0 0 0-.253-1.967a4.3 4.3 0 0 1-.881-.61a3.77 3.77 0 0 1-1.246-2.204c-.188-1.07.086-2.045.642-2.877c.257-.385.52-.663.72-.831a1 1 0 0 1 .974-.178" + "laurel": "M16.956 2.057c.355.124.829.375 1.303.796a3.77 3.77 0 0 1 1.246 2.204c.173.989-.047 1.894-.519 2.683l-.123.194q-.097.147-.196.272q.066.234.117.471q.26-.178.545-.307c.851-.389 1.727-.442 2.527-.306q.226.04.346.076a1 1 0 0 1 .689.712l.029.13q.015.08.03.18a4.45 4.45 0 0 1-.324 2.496a3.94 3.94 0 0 1-1.71 1.85l-.242.12a4.23 4.23 0 0 1-2.234.349A9 9 0 0 1 17.997 15c.37.016.748.093 1.128.24c.732.28 1.299.758 1.711 1.367a3.95 3.95 0 0 1 .654 1.613a1 1 0 0 1-.356.917a3.8 3.8 0 0 1-.716.443c-.933.455-1.978.588-3.043.179l-.032-.015l-.205-.086a3.6 3.6 0 0 1-1.33-1.069l-.143-.197a4 4 0 0 1-.26-.433a6 6 0 0 1-.927.511q.18.262.337.56a7.4 7.4 0 0 1 .66 1.747a1 1 0 0 1-1.95.444l-.028-.11a6 6 0 0 0-.449-1.143C12.706 19.323 12.338 19 12 19s-.706.323-1.048.969a5.6 5.6 0 0 0-.367.874l-.082.269l-.028.11a1 1 0 0 1-1.95-.444a7.3 7.3 0 0 1 .66-1.747q.158-.298.337-.561a6.4 6.4 0 0 1-.93-.508a4 4 0 0 1-.256.43c-.366.541-.855.98-1.473 1.267l-.238.1c-.994.382-1.97.292-2.855-.091l-.188-.087a3.8 3.8 0 0 1-.716-.443a1 1 0 0 1-.356-.917a3.95 3.95 0 0 1 .654-1.613a3.6 3.6 0 0 1 1.71-1.368c.38-.146.758-.223 1.13-.24a9 9 0 0 1-.445-1.023a4.23 4.23 0 0 1-2.233-.348a4 4 0 0 1-.916-.587l-.207-.191a4 4 0 0 1-.724-.977l-.105-.216a4.45 4.45 0 0 1-.265-2.806a1 1 0 0 1 .69-.712q.119-.036.345-.076c.801-.135 1.678-.082 2.53.308q.283.129.545.304q.048-.235.112-.47a5 5 0 0 1-.194-.272c-.556-.832-.83-1.806-.642-2.877l.05-.242a3.75 3.75 0 0 1 1.027-1.803l.169-.159a4 4 0 0 1 1.303-.796a1 1 0 0 1 .975.178c.2.168.462.446.719.83c.556.833.83 1.807.642 2.878a3.77 3.77 0 0 1-1.246 2.204c-.303.27-.607.47-.879.61A7.5 7.5 0 0 0 7 10.728C7 14.23 9.285 17 12 17s5-2.77 5-6.276a7.6 7.6 0 0 0-.253-1.967a4.3 4.3 0 0 1-.881-.61a3.77 3.77 0 0 1-1.246-2.204c-.188-1.07.086-2.045.642-2.877c.257-.385.52-.663.72-.831a1 1 0 0 1 .974-.178", + "bell-ringing": "M 8.705 21.001 L 12.705 21.001 C 13.257 21.001 13.705 20.553 13.705 20.001 C 13.705 19.448 13.257 19.001 12.705 19.001 L 8.705 19.001 C 8.153 19.001 7.705 19.448 7.705 20.001 C 7.705 20.553 8.153 21.001 8.705 21.001 Z M 3.903 0.81 C 3.773 0.579 3.556 0.409 3.3 0.338 C 3.045 0.267 2.771 0.3 2.54 0.431 C 0.957 1.327 -0.015 3.012 0 4.831 C 0.006 5.383 0.458 5.826 1.01 5.821 C 1.562 5.815 2.006 5.363 2 4.811 C 1.991 3.72 2.574 2.71 3.522 2.172 C 4.003 1.9 4.173 1.291 3.902 0.81 Z M 17.504 0.81 C 17.234 1.291 17.404 1.9 17.884 2.171 C 18.833 2.709 19.416 3.72 19.407 4.811 C 19.402 5.363 19.845 5.815 20.398 5.82 C 20.95 5.825 21.402 5.382 21.407 4.83 C 21.423 3.011 20.45 1.326 18.867 0.43 C 18.386 0.159 17.776 0.329 17.505 0.81 Z M 3.705 7.001 C 3.705 9.914 2.973 11.845 2.206 13.078 L 2.194 13.097 C 1.836 13.671 1.554 14.126 1.364 14.456 C 1.275 14.607 1.192 14.763 1.117 14.923 C 1.085 14.994 1.049 15.08 1.02 15.174 C 0.997 15.253 0.953 15.42 0.97 15.623 C 0.983 15.837 1.042 16.046 1.143 16.236 C 1.25 16.422 1.396 16.582 1.571 16.706 C 1.76 16.837 1.977 16.92 2.205 16.948 L 2.209 16.948 C 2.37 16.97 2.531 16.983 2.693 16.988 C 3.028 17.001 3.492 17.001 4.069 17.001 L 17.341 17.001 C 17.918 17.001 18.382 17.001 18.717 16.988 C 18.879 16.983 19.041 16.97 19.201 16.948 L 19.205 16.948 C 19.301 16.934 19.589 16.891 19.839 16.705 C 20.014 16.581 20.16 16.421 20.267 16.235 C 20.401 15.994 20.43 15.76 20.44 15.624 C 20.457 15.42 20.412 15.253 20.389 15.174 C 20.361 15.08 20.325 14.993 20.293 14.922 C 20.229 14.781 20.142 14.621 20.046 14.456 C 19.856 14.125 19.574 13.671 19.216 13.098 L 19.205 13.078 C 18.437 11.845 17.705 9.914 17.705 7.001 C 17.705 4.169 16 1.617 13.384 0.533 C 10.768 -0.55 7.757 0.049 5.755 2.051 C 4.442 3.364 3.705 5.144 3.705 7.001 Z M 8.705 21.001 L 12.705 21.001 C 13.257 21.001 13.705 20.553 13.705 20.001 C 13.705 19.448 13.257 19.001 12.705 19.001 L 8.705 19.001 C 8.153 19.001 7.705 19.448 7.705 20.001 C 7.705 20.553 8.153 21.001 8.705 21.001 Z M 3.903 0.81 C 3.773 0.579 3.556 0.409 3.3 0.338 C 3.045 0.267 2.771 0.3 2.54 0.431 C 0.957 1.327 -0.015 3.012 0 4.831 C 0.006 5.383 0.458 5.826 1.01 5.821 C 1.562 5.815 2.006 5.363 2 4.811 C 1.991 3.72 2.574 2.71 3.522 2.172 C 4.003 1.9 4.173 1.291 3.902 0.81 Z M 17.504 0.81 C 17.234 1.291 17.404 1.9 17.884 2.171 C 18.833 2.709 19.416 3.72 19.407 4.811 C 19.402 5.363 19.845 5.815 20.398 5.82 C 20.95 5.825 21.402 5.382 21.407 4.83 C 21.423 3.011 20.45 1.326 18.867 0.43 C 18.386 0.159 17.776 0.329 17.505 0.81 Z M 3.705 7.001 C 3.705 9.914 2.973 11.845 2.206 13.078 L 2.194 13.097 C 1.836 13.671 1.554 14.126 1.364 14.456 C 1.275 14.607 1.192 14.763 1.117 14.923 C 1.085 14.994 1.049 15.08 1.02 15.174 C 0.997 15.253 0.953 15.42 0.97 15.623 C 0.983 15.837 1.042 16.046 1.143 16.236 C 1.25 16.422 1.396 16.582 1.571 16.706 C 1.76 16.837 1.977 16.92 2.205 16.948 L 2.209 16.948 C 2.37 16.97 2.531 16.983 2.693 16.988 C 3.028 17.001 3.492 17.001 4.069 17.001 L 17.341 17.001 C 17.918 17.001 18.382 17.001 18.717 16.988 C 18.879 16.983 19.041 16.97 19.201 16.948 L 19.205 16.948 C 19.301 16.934 19.589 16.891 19.839 16.705 C 20.014 16.581 20.16 16.421 20.267 16.235 C 20.401 15.994 20.43 15.76 20.44 15.624 C 20.457 15.42 20.412 15.253 20.389 15.174 C 20.361 15.08 20.325 14.993 20.293 14.922 C 20.229 14.781 20.142 14.621 20.046 14.456 C 19.856 14.125 19.574 13.671 19.216 13.098 L 19.205 13.078 C 18.437 11.845 17.705 9.914 17.705 7.001 C 17.705 4.169 16 1.617 13.384 0.533 C 10.768 -0.55 7.757 0.049 5.755 2.051 C 4.442 3.364 3.705 5.144 3.705 7.001 Z" } diff --git a/components/modules/validator/ValidatorOverview.vue b/components/modules/validator/ValidatorOverview.vue index 28c052a2..1f4af5d8 100644 --- a/components/modules/validator/ValidatorOverview.vue +++ b/components/modules/validator/ValidatorOverview.vue @@ -8,13 +8,20 @@ import AmountInCurrency from "@/components/AmountInCurrency.vue" import BlocksTable from "./tables/BlocksTable.vue" import DelegatorsTable from "./tables/DelegatorsTable.vue" import JailsTable from "./tables/JailsTable.vue" +import SignalsTable from "./tables/SignalsTable.vue" import VotesTable from "./tables/VotesTable.vue" /** Services */ import { comma, numToPercent, shortHex, splitAddress } from "@/services/utils" /** API */ -import { fetchValidatorBlocks, fetchValidatorDelegators, fetchValidatorJails, fetchValidatorUptime } from "@/services/api/validator" +import { + fetchValidatorBlocks, + fetchValidatorDelegators, + fetchValidatorJails, + fetchValidatorUptime, + fetchSignals +} from "@/services/api/validator" import { fetchVotesByAddressHash } from "@/services/api/address" /** Store */ @@ -50,6 +57,10 @@ const tabs = ref([ name: "Votes", icon: "check-circle", }, + { + name: "Signals", + icon: "bell-ringing", + }, ]) const preselectedTab = route.query.tab && tabs.value.map((tab) => tab.name).includes(route.query.tab) ? route.query.tab : tabs.value[0].name const activeTab = ref(preselectedTab) @@ -58,6 +69,7 @@ const isRefetching = ref(false) const delegators = ref([]) const blocks = ref([]) const jails = ref([]) +const signals = ref([]) const votes = ref([]) const uptime = ref([]) @@ -120,6 +132,21 @@ const getJails = async () => { isRefetching.value = false } +const getSignals = async () => { + isRefetching.value = true + + const { data } = await fetchSignals({ + validatorId: props.validator.id, + limit: limit, + offset: (page.value - 1) * limit, + }) + + signals.value = data.value + handleNextCondition.value = signals.value?.length < limit + + isRefetching.value = false +} + const getVotes = async () => { isRefetching.value = true @@ -150,6 +177,7 @@ const getUptime = async () => { if (activeTab.value === "Delegators") await getDelegators() if (activeTab.value === "Proposed Blocks") await getBlocks() if (activeTab.value === "Jails") await getJails() +if (activeTab.value === "Signals") await getSignals() if (activeTab.value === "Votes") await getVotes() await getUptime() @@ -231,6 +259,9 @@ watch( case "Jails": getJails() break + case "Signals": + getSignals() + break case "Votes": getVotes() break @@ -259,6 +290,9 @@ watch( case "Jails": getJails() break + case "Signals": + getSignals() + break case "Votes": getVotes() break @@ -423,6 +457,11 @@ const handleDelegate = () => { {{ comma(validator.min_self_delegation) }} + + Version + {{ `v${validator.version}` }} + +
@@ -508,7 +547,18 @@ const handleDelegate = () => { No votes - No {{ page === 1 ? "" : "more" }} votes from this address on any proposals + No {{ page === 1 ? "" : "more" }} votes from this validator on any proposals + + + + + diff --git a/components/modules/validator/tables/SignalsTable.vue b/components/modules/validator/tables/SignalsTable.vue new file mode 100644 index 00000000..15f2ce5d --- /dev/null +++ b/components/modules/validator/tables/SignalsTable.vue @@ -0,0 +1,156 @@ + + + + + diff --git a/components/modules/validator/tables/VotesTable.vue b/components/modules/validator/tables/VotesTable.vue index 05e94377..4fc6f09d 100644 --- a/components/modules/validator/tables/VotesTable.vue +++ b/components/modules/validator/tables/VotesTable.vue @@ -2,15 +2,10 @@ /** Vendor */ import { DateTime } from "luxon" -/** UI */ -import Tooltip from "@/components/ui/Tooltip.vue" - /** Services */ -import { comma, tia } from "@/services/utils" +import { comma } from "@/services/utils" import { getVoteIcon, getVoteIconColor } from "@/services/utils/states" -const router = useRouter() - const props = defineProps({ votes: { type: Array, diff --git a/pages/validators.vue b/pages/validators.vue index 44d16bf3..e1177054 100644 --- a/pages/validators.vue +++ b/pages/validators.vue @@ -271,6 +271,7 @@ onMounted(() => { Rate Max Rate Max Change Rate + Version @@ -348,6 +349,13 @@ onMounted(() => { + + + + {{ `v${v.version}` }} + + + diff --git a/services/api/validator.js b/services/api/validator.js index d4b6ab81..0642de05 100644 --- a/services/api/validator.js +++ b/services/api/validator.js @@ -100,3 +100,35 @@ export const fetchValidatorUptime = ({ id, limit }) => { console.error(error) } } + +export const fetchValidatorsUpgrades = ({ limit, offset }) => { + try { + const url = new URL(`${useServerURL()}/signal/upgrade`) + + if (limit) url.searchParams.append("limit", limit) + if (offset) url.searchParams.append("offset", offset) + + return useFetch(encodeURI(url.href), { + key: "validators_upgrades", + }) + } catch (error) { + console.error(error) + } +} + +export const fetchSignals = ({ validatorId, version, limit, offset }) => { + try { + const url = new URL(`${useServerURL()}/signal`) + + if (validatorId) url.searchParams.append("validator_id", validatorId) + if (version) url.searchParams.append("version", version) + if (limit) url.searchParams.append("limit", limit) + if (offset) url.searchParams.append("offset", offset) + + return useFetch(encodeURI(url.href), { + key: "upgrades_signals", + }) + } catch (error) { + console.error(error) + } +} From 34594f9251e7f4301089fb0a6938d422a300d978 Mon Sep 17 00:00:00 2001 From: gusevpm Date: Mon, 20 Oct 2025 22:15:00 +0200 Subject: [PATCH 02/19] Node upgrades --- components/LeftSidebar.vue | 6 + components/cmd/CommandMenu.vue | 9 + components/modules/upgrade/SignalsTable.vue | 180 ++++++ .../modules/upgrade/UpgradeOverview.vue | 552 ++++++++++++++++++ .../modules/validator/ValidatorOverview.vue | 65 +-- .../modules/validator/tables/SignalsTable.vue | 10 +- pages/upgrade/[version].vue | 108 ++++ pages/upgrades.vue | 411 +++++++++++++ pages/validators.vue | 4 +- public/llms.txt | 2 +- services/api/validator.js | 12 + services/utils/general.js | 11 + services/utils/strings.js | 6 +- 13 files changed, 1333 insertions(+), 43 deletions(-) create mode 100644 components/modules/upgrade/SignalsTable.vue create mode 100644 components/modules/upgrade/UpgradeOverview.vue create mode 100644 pages/upgrade/[version].vue create mode 100644 pages/upgrades.vue diff --git a/components/LeftSidebar.vue b/components/LeftSidebar.vue index 78a824f8..8dc7f240 100644 --- a/components/LeftSidebar.vue +++ b/components/LeftSidebar.vue @@ -178,6 +178,12 @@ const modularLinks = reactive([ const isToolsLinkCollapsed = ref(false) const toolsLinks = reactive([ + { + icon: "node", + name: "Node Upgrades", + path: "/upgrades", + new: true, + }, { icon: "widgets", name: "Widgets", diff --git a/components/cmd/CommandMenu.vue b/components/cmd/CommandMenu.vue index 465fd241..a845efa8 100644 --- a/components/cmd/CommandMenu.vue +++ b/components/cmd/CommandMenu.vue @@ -301,6 +301,15 @@ const rawNavigationActions = [ router.push("/blobstream") }, }, + { + type: "callback", + icon: "arrow-narrow-right", + title: "Go to Upgrades", + runText: "Open Upgrades", + callback: () => { + router.push("/upgrades") + }, + }, { type: "callback", icon: "arrow-narrow-right", diff --git a/components/modules/upgrade/SignalsTable.vue b/components/modules/upgrade/SignalsTable.vue new file mode 100644 index 00000000..db2ef442 --- /dev/null +++ b/components/modules/upgrade/SignalsTable.vue @@ -0,0 +1,180 @@ + + + + + diff --git a/components/modules/upgrade/UpgradeOverview.vue b/components/modules/upgrade/UpgradeOverview.vue new file mode 100644 index 00000000..06f44ae6 --- /dev/null +++ b/components/modules/upgrade/UpgradeOverview.vue @@ -0,0 +1,552 @@ + + + + + diff --git a/components/modules/validator/ValidatorOverview.vue b/components/modules/validator/ValidatorOverview.vue index 1f4af5d8..8b1ac1f9 100644 --- a/components/modules/validator/ValidatorOverview.vue +++ b/components/modules/validator/ValidatorOverview.vue @@ -12,7 +12,7 @@ import SignalsTable from "./tables/SignalsTable.vue" import VotesTable from "./tables/VotesTable.vue" /** Services */ -import { comma, numToPercent, shortHex, splitAddress } from "@/services/utils" +import { capitilize, comma, numToPercent, shortHex, splitAddress } from "@/services/utils" /** API */ import { @@ -42,23 +42,23 @@ const props = defineProps({ const tabs = ref([ { - name: "Delegators", + name: "delegators", icon: "address", }, { - name: "Proposed Blocks", + name: "proposed blocks", icon: "block", }, { - name: "Jails", + name: "jails", icon: "grid", }, { - name: "Votes", + name: "votes", icon: "check-circle", }, { - name: "Signals", + name: "signals", icon: "bell-ringing", }, ]) @@ -173,19 +173,18 @@ const getUptime = async () => { } } -/** Initital fetch for delegators and uptime */ -if (activeTab.value === "Delegators") await getDelegators() -if (activeTab.value === "Proposed Blocks") await getBlocks() -if (activeTab.value === "Jails") await getJails() -if (activeTab.value === "Signals") await getSignals() -if (activeTab.value === "Votes") await getVotes() - +/** Initital fetch */ +if (activeTab.value?.toLowerCase() === "delegators") await getDelegators() +if (activeTab.value?.toLowerCase() === "proposed blocks") await getBlocks() +if (activeTab.value?.toLowerCase() === "jails") await getJails() +if (activeTab.value?.toLowerCase() === "signals") await getSignals() +if (activeTab.value?.toLowerCase() === "votes") await getVotes() await getUptime() onMounted(() => { router.replace({ query: { - tab: activeTab.value, + tab: activeTab.value?.toLowerCase(), }, }) }) @@ -249,20 +248,20 @@ const parsedContacts = computed(() => { watch( () => page.value, () => { - switch (activeTab.value) { - case "Delegators": + switch (activeTab.value?.toLowerCase()) { + case "delegators": getDelegators() break - case "Proposed Blocks": + case "proposed blocks": getBlocks() break - case "Jails": + case "jails": getJails() break - case "Signals": + case "signals": getSignals() break - case "Votes": + case "votes": getVotes() break } @@ -274,26 +273,26 @@ watch( () => { router.replace({ query: { - tab: activeTab.value, + tab: activeTab.value?.toLowerCase(), }, }) page.value = 1 - switch (activeTab.value) { - case "Delegators": + switch (activeTab.value?.toLowerCase()) { + case "delegators": getDelegators() break - case "Proposed Blocks": + case "proposed blocks": getBlocks() break - case "Jails": + case "jails": getJails() break - case "Signals": + case "signals": getSignals() break - case "Votes": + case "votes": getVotes() break } @@ -502,13 +501,13 @@ const handleDelegate = () => { :class="[$style.tab, activeTab === tab.name && $style.active]" > - {{ tab.name }} + {{ capitilize(tab.name) }} -