From 39dbfd9eada3e4147a30e2e523647efb6f2b9e46 Mon Sep 17 00:00:00 2001 From: GussevPM Date: Mon, 22 Jan 2024 13:47:37 +0100 Subject: [PATCH 01/41] Add donation links --- components/TheFooter.vue | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/components/TheFooter.vue b/components/TheFooter.vue index d53f1710..c18f3e23 100644 --- a/components/TheFooter.vue +++ b/components/TheFooter.vue @@ -64,31 +64,33 @@ const handleChangeTheme = (theme) => { Celenium - - Celestia Explorer, {{ new Date().getFullYear() }} + - + Celestia Explorer, {{ new Date().getFullYear() }} - + - - - Version {{ appConfig.version }} - + + Version + {{ appConfig.version }} - - - Donations: - celestia - -
+ + Donations: + + + TIA - wevu augt h7f5 - - + + + + ETH + + + - From 64f32db47358f00e21e09305987a804c8c02a9b8 Mon Sep 17 00:00:00 2001 From: GussevPM Date: Mon, 22 Jan 2024 21:56:59 +0100 Subject: [PATCH 02/41] Add cross-env --- package.json | 3 ++- pnpm-lock.yaml | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 42282746..4d029a32 100644 --- a/package.json +++ b/package.json @@ -6,13 +6,14 @@ "license": "MIT", "scripts": { "build": "nuxt build", - "dev": "PORT=9090 nuxt dev", + "dev": "cross-env PORT=9090 nuxt dev", "generate": "nuxt generate", "preview": "nuxt preview", "postinstall": "nuxt prepare" }, "devDependencies": { "@nuxt/devtools": "latest", + "cross-env": "^7.0.3", "nuxt": "3.9.1", "nuxt-og-image": "2.0.28", "nuxt-simple-sitemap": "^4.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 32e79797..6c9bb00b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -52,6 +52,9 @@ devDependencies: '@nuxt/devtools': specifier: latest version: 1.0.8(nuxt@3.9.1)(vite@5.0.11) + cross-env: + specifier: ^7.0.3 + version: 7.0.3 nuxt: specifier: 3.9.1 version: 3.9.1(sass@1.66.1)(vite@5.0.11) @@ -3331,6 +3334,14 @@ packages: resolution: {integrity: sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==} dev: false + /cross-env@7.0.3: + resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} + engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} + hasBin: true + dependencies: + cross-spawn: 7.0.3 + dev: true + /cross-spawn@7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} From be117ab5bf4969054fdfe5fc6b9c9ca0da859830 Mon Sep 17 00:00:00 2001 From: GussevPM Date: Tue, 23 Jan 2024 01:10:45 +0100 Subject: [PATCH 03/41] Change queries --- components/widgets/BlobsWidget.vue | 8 +++----- components/widgets/TransactionsWidget.vue | 7 +++---- services/api/stats.js | 6 +++--- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/components/widgets/BlobsWidget.vue b/components/widgets/BlobsWidget.vue index 9e79245f..3df46735 100644 --- a/components/widgets/BlobsWidget.vue +++ b/components/widgets/BlobsWidget.vue @@ -9,7 +9,7 @@ import Tooltip from "@/components/ui/Tooltip.vue" import { formatBytes } from "@/services/utils" /** API */ -import { fetchHistogram } from "@/services/api/stats" +import { fetchSeries } from "@/services/api/stats" const days = ref([]) const weeks = ref([]) @@ -18,11 +18,9 @@ const totalSize = ref(0) const maxSize = ref(0) onMounted(async () => { - const data = await fetchHistogram({ - table: "block_stats", - func: "sum", + const data = await fetchSeries({ + table: "blobs_size", period: "day", - column: "blobs_size", from: parseInt(DateTime.now().minus({ days: 120 }).ts / 1_000), }) diff --git a/components/widgets/TransactionsWidget.vue b/components/widgets/TransactionsWidget.vue index 74bd5bc2..7c47847d 100644 --- a/components/widgets/TransactionsWidget.vue +++ b/components/widgets/TransactionsWidget.vue @@ -9,7 +9,7 @@ import Tooltip from "@/components/ui/Tooltip.vue" import { comma, abbreviate } from "@/services/utils" /** API */ -import { fetchHistogram } from "@/services/api/stats" +import { fetchSeries } from "@/services/api/stats" const histogram = ref([]) @@ -26,9 +26,8 @@ const max = ref(0) const roundedMax = ref(0) const getHistogram = async (sectorOffset) => { - const data = await fetchHistogram({ - table: "tx", - func: "count", + const data = await fetchSeries({ + table: "tx_count", period: "hour", from: parseInt(DateTime.now().minus({ hours: 24 - sectorOffset }).ts / 1_000), }) diff --git a/services/api/stats.js b/services/api/stats.js index dfe9fd7f..deece2f0 100644 --- a/services/api/stats.js +++ b/services/api/stats.js @@ -1,14 +1,14 @@ /** Services */ import { useServerURL } from "@/services/config" -export const fetchHistogram = async ({ table, func, period, column, from, to }) => { +export const fetchSeries = async ({ table, func, period, column, from, to }) => { try { - const url = new URL(`${useServerURL()}/stats/histogram/${table}/${func}/${period}`) + const url = new URL(`${useServerURL()}/stats/series/${table}/${period}`) if (column) url.searchParams.append("column", column) if (from) url.searchParams.append("from", from) if (to) url.searchParams.append("to", to) - + console.log(url); const data = await $fetch(url.href) return data } catch (error) { From 20fd4bf303ceab22c2e1a6b7521ae8cf66e04543 Mon Sep 17 00:00:00 2001 From: GussevPM Date: Tue, 23 Jan 2024 22:07:42 +0100 Subject: [PATCH 04/41] Fix transactions widget --- components/widgets/TransactionsWidget.vue | 2 +- services/api/stats.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/components/widgets/TransactionsWidget.vue b/components/widgets/TransactionsWidget.vue index 7c47847d..8bbf3bf1 100644 --- a/components/widgets/TransactionsWidget.vue +++ b/components/widgets/TransactionsWidget.vue @@ -44,7 +44,7 @@ const buildHistogram = async () => { const currentHour = DateTime.now().hour const currentSector = hoursMap.find((m) => m.includes(currentHour)) const currentHourIdx = currentSector.indexOf(currentHour) - const sectorOffset = 6 - currentHourIdx + const sectorOffset = 5 - currentHourIdx await getHistogram(sectorOffset) diff --git a/services/api/stats.js b/services/api/stats.js index deece2f0..ded105bc 100644 --- a/services/api/stats.js +++ b/services/api/stats.js @@ -8,7 +8,6 @@ export const fetchSeries = async ({ table, func, period, column, from, to }) => if (column) url.searchParams.append("column", column) if (from) url.searchParams.append("from", from) if (to) url.searchParams.append("to", to) - console.log(url); const data = await $fetch(url.href) return data } catch (error) { From ee910d8222416f57f0d0fb6a5b2058b84539e139 Mon Sep 17 00:00:00 2001 From: GussevPM Date: Tue, 23 Jan 2024 22:17:00 +0100 Subject: [PATCH 05/41] Fix transactions widget --- components/widgets/TransactionsWidget.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/widgets/TransactionsWidget.vue b/components/widgets/TransactionsWidget.vue index 8bbf3bf1..68dbe849 100644 --- a/components/widgets/TransactionsWidget.vue +++ b/components/widgets/TransactionsWidget.vue @@ -29,7 +29,7 @@ const getHistogram = async (sectorOffset) => { const data = await fetchSeries({ table: "tx_count", period: "hour", - from: parseInt(DateTime.now().minus({ hours: 24 - sectorOffset }).ts / 1_000), + from: parseInt(DateTime.now().minus({ hours: 25 - sectorOffset }).ts / 1_000), }) histogram.value = data.reverse() } From cb247718a65cf2b33880a67b03b0c1e512c7ad71 Mon Sep 17 00:00:00 2001 From: GussevPM Date: Tue, 23 Jan 2024 22:28:26 +0100 Subject: [PATCH 06/41] Remove func parameter in fetchSeries --- services/api/stats.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/api/stats.js b/services/api/stats.js index ded105bc..54a425dc 100644 --- a/services/api/stats.js +++ b/services/api/stats.js @@ -1,7 +1,7 @@ /** Services */ import { useServerURL } from "@/services/config" -export const fetchSeries = async ({ table, func, period, column, from, to }) => { +export const fetchSeries = async ({ table, period, column, from, to }) => { try { const url = new URL(`${useServerURL()}/stats/series/${table}/${period}`) From 60e5a85a9e4bc9f56f29f02eba554930a7a92bf0 Mon Sep 17 00:00:00 2001 From: GussevPM Date: Tue, 23 Jan 2024 22:52:34 +0100 Subject: [PATCH 07/41] Add button --- pages/namespaces/treemap/index.vue | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/pages/namespaces/treemap/index.vue b/pages/namespaces/treemap/index.vue index 355312ac..b433900d 100644 --- a/pages/namespaces/treemap/index.vue +++ b/pages/namespaces/treemap/index.vue @@ -138,14 +138,19 @@ const handleSelectFilter = (target) => {