@@ -6,6 +6,7 @@ import UpgradeOverview from "@/components/modules/upgrade/UpgradeOverview.vue"
66import { isValidId } from " @/services/utils"
77
88/** API */
9+ import { fetchHead } from " @/services/api/main"
910import { fetchValidatorsUpgradeByVersion } from " @/services/api/validator"
1011
1112/** Store */
@@ -21,6 +22,14 @@ if (isValidId(route.params.version, "upgrade_version")) {
2122
2223 if (data .value ) {
2324 upgrade .value = data .value
25+ if (! upgrade .value .tx_hash ) {
26+ const head = await fetchHead ()
27+ if (head) {
28+ upgrade .value .voting_power = head .total_voting_power
29+ }
30+ }
31+
32+ upgrade .value .votedShare = parseFloat (upgrade .value .voted_power ) * 100 / parseFloat (upgrade .value .voting_power )
2433 cacheStore .current .upgrade = upgrade .value
2534 } else {
2635 throw createError ({ statusCode: 404 , statusMessage: ` Upgrade to version ${ route .params .version } not found` })
@@ -29,51 +38,51 @@ if (isValidId(route.params.version, "upgrade_version")) {
2938 throw createError ({ statusCode: 404 , statusMessage: ` Upgrade to version ${ route .params .version } not found` })
3039}
3140
32- // defineOgImageComponent("ValidatorImage ", {
33- // title: "Validator ",
34- // validator: validator .value,
35- // cacheKey: `${validator .value?.moniker || validator.value?.address?.hash }`,
36- // })
41+ defineOgImageComponent (" UpgradeImage " , {
42+ title: " Upgrade " ,
43+ upgrade : upgrade .value ,
44+ cacheKey: ` ${ upgrade .value ? .version }` ,
45+ })
3746
38- // useHead({
39- // title: `Validator ${validator .value?.moniker } - Celenium`,
40- // link: [
41- // {
42- // rel: "canonical",
43- // href: `${useRequestURL().origin}${useRequestURL().pathname}`,
44- // },
45- // ],
46- // meta: [
47- // {
48- // name: "description",
49- // content: `Validator ${validator .value?.moniker} blocks , metadata, uptime, rates, social links, contacts and other data.`,
50- // },
51- // {
52- // property: "og:title",
53- // content: `Validator ${validator .value?.moniker } - Celenium`,
54- // },
55- // {
56- // property: "og:description",
57- // content: `Validator ${validator .value?.moniker} blocks , metadata, uptime, rates, social links, contacts and other data.`,
58- // },
59- // {
60- // property: "og:url",
61- // content: `${useRequestURL().origin}${useRequestURL().pathname}`,
62- // },
63- // {
64- // name: "twitter:title",
65- // content: `Validator ${validator .value?.moniker } - Celenium`,
66- // },
67- // {
68- // name: "twitter:description",
69- // content: `Validator ${validator .value?.moniker} blocks , metadata, uptime, rates, social links, contacts and other data.`,
70- // },
71- // {
72- // name: "twitter:card",
73- // content: "summary_large_image",
74- // },
75- // ],
76- // })
47+ useHead({
48+ title: ` Celestia Node Upgrade to version ${ upgrade .value ? .version } - Celenium` ,
49+ link: [
50+ {
51+ rel: "canonical",
52+ href: ` ${useRequestURL ().origin }${useRequestURL ().pathname }` ,
53+ },
54+ ],
55+ meta: [
56+ {
57+ name: "description",
58+ content: ` Upgrade v${ upgrade .value ? .version } signals , metadata, stake, voting, progress and other data.` ,
59+ },
60+ {
61+ property: "og:title",
62+ content: ` Celestia Node Upgrade to version ${ upgrade .value ? .version } - Celenium` ,
63+ },
64+ {
65+ property: "og:description",
66+ content: ` Upgrade v${ upgrade .value ? .version } signals , metadata, stake, voting, progress and other data.` ,
67+ },
68+ {
69+ property: "og:url",
70+ content: ` ${useRequestURL ().origin }${useRequestURL ().pathname }` ,
71+ },
72+ {
73+ name: "twitter:title",
74+ content: ` Celestia Node Upgrade to version ${ upgrade .value ? .version } - Celenium` ,
75+ },
76+ {
77+ name: "twitter:description",
78+ content: ` Upgrade v${ upgrade .value ? .version } signals , metadata, stake, voting, progress and other data.` ,
79+ },
80+ {
81+ name: "twitter:card",
82+ content: "summary_large_image",
83+ },
84+ ],
85+ })
7786</script>
7887
7988<template>
0 commit comments