From 8118a9f911e5a72dc16215dabed182f1c059160c Mon Sep 17 00:00:00 2001
From: Eric <5089238+emizzle@users.noreply.github.com>
Date: Wed, 26 Jun 2024 16:54:59 +1000
Subject: [PATCH] Update footer
- balance and block number are continually updated
- codex node and ethereum rpc connections continually checked
---
src/App.vue | 41 +++++++++++++++++--
src/components/Balance.vue | 19 +++++++--
src/components/BlockNumber.vue | 9 +++-
src/components/NetworkConnectionState.vue | 50 +++++++++++++++++++++++
src/plugins/CodexPlugin.js | 3 +-
5 files changed, 112 insertions(+), 10 deletions(-)
create mode 100644 src/components/NetworkConnectionState.vue
diff --git a/src/App.vue b/src/App.vue
index 55dfa18..46571c9 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,5 +1,5 @@
- My balance: {{ formatEther(balance) }} TST
-
\ No newline at end of file
+
+

+

+
{{ formatEther(balance) }} TST
+
+
diff --git a/src/components/BlockNumber.vue b/src/components/BlockNumber.vue
index 7e3e3ba..74e8272 100644
--- a/src/components/BlockNumber.vue
+++ b/src/components/BlockNumber.vue
@@ -6,12 +6,17 @@ const blockNumber = ref(0)
onMounted(async () => {
blockNumber.value = await ethProvider.getBlockNumber()
- ethProvider.on('block', (newBlockNum) => {
+ ethProvider.on('block', (newBlockNum, event) => {
blockNumber.value = newBlockNum
})
})
- Current block: {{ blockNumber }}
+
+
+ Block {{ blockNumber }}
+
diff --git a/src/components/NetworkConnectionState.vue b/src/components/NetworkConnectionState.vue
new file mode 100644
index 0000000..5834079
--- /dev/null
+++ b/src/components/NetworkConnectionState.vue
@@ -0,0 +1,50 @@
+
+
+
+
+
diff --git a/src/plugins/CodexPlugin.js b/src/plugins/CodexPlugin.js
index 59bca64..2a409aa 100644
--- a/src/plugins/CodexPlugin.js
+++ b/src/plugins/CodexPlugin.js
@@ -3,7 +3,8 @@ export default {
const codexApi = {
info: () => fetch(`${codexRestUrl}/debug/info`),
download: (cid) => fetch(`${codexRestUrl}/data/${cid}/network`),
- downloadLocal: (cid) => fetch(`${codexRestUrl}/data/${cid}`)
+ downloadLocal: (cid) => fetch(`${codexRestUrl}/data/${cid}`),
+ spr: () => fetch(`${codexRestUrl}/spr`)
}
app.provide('myAddress', myAddress)