Skip to content

Commit 026b618

Browse files
committed
fix: remove console.log calls and replace with logger + minor fixes
1 parent d4063b0 commit 026b618

32 files changed

Lines changed: 601 additions & 491 deletions

src/components/Footer.vue

Lines changed: 138 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,168 +1,190 @@
11
<template>
2-
<footer>
3-
<div class="footer-section">
4-
<nav>
5-
<ul v-for="item in navigation" :key="item.title" :data-label="item.title">
6-
<li v-for="link in item.links" :key="link.title">
7-
<a :href="link.link" target="_blank">{{link.title}}</a>
8-
</li>
9-
</ul>
10-
</nav>
11-
<robo-text size="small" weight="bold" align="center">
12-
<robo-grid id="footer-label" type="flex" gap="x05" valign="center">
13-
<span>Secured by</span>
14-
<img width="100" alt="Polkadot" src="/images/polkadot-new-dot-logo-horizontal.svg" />
15-
</robo-grid>
16-
</robo-text>
17-
</div>
18-
<robo-text v-if="repoversion" size="small" weight="bold" align="center" class="footer-section">
19-
Latest release:
20-
<a :href="repoversion.html_url" target="_blank">{{ repoversion.tag_name }} {{ repoversion.name }}</a>
21-
</robo-text>
22-
</footer>
2+
<footer>
3+
<div class="footer-section">
4+
<nav>
5+
<ul
6+
v-for="item in navigation"
7+
:key="item.title"
8+
:data-label="item.title"
9+
>
10+
<li v-for="link in item.links" :key="link.title">
11+
<a :href="link.link" target="_blank">{{ link.title }}</a>
12+
</li>
13+
</ul>
14+
</nav>
15+
<robo-text size="small" weight="bold" align="center">
16+
<robo-grid id="footer-label" type="flex" gap="x05" valign="center">
17+
<span>Secured by</span>
18+
<img
19+
width="100"
20+
alt="Polkadot"
21+
src="/images/polkadot-new-dot-logo-horizontal.svg"
22+
/>
23+
</robo-grid>
24+
</robo-text>
25+
</div>
26+
<robo-text
27+
v-if="repoversion"
28+
size="small"
29+
weight="bold"
30+
align="center"
31+
class="footer-section"
32+
>
33+
Latest release:
34+
<a :href="repoversion.html_url" target="_blank"
35+
>{{ repoversion.tag_name }} {{ repoversion.name }}</a
36+
>
37+
</robo-text>
38+
</footer>
2339
</template>
2440

2541
<script setup>
26-
27-
import { ref, onMounted, computed } from "vue";
42+
import { logger } from "@/utils/logger";
43+
import { computed, onMounted, ref } from "vue";
2844
import { useStore } from "vuex";
2945
const store = useStore();
3046
3147
const network = computed(() => {
32-
return store.state.robonomicsUIvue?.polkadot?.connection?.network || "polkadot";
48+
return (
49+
store.state.robonomicsUIvue?.polkadot?.connection?.network || "polkadot"
50+
);
3351
});
3452
3553
const navigation = [
36-
{
54+
{
3755
title: "Services",
3856
links: [
39-
{
57+
{
4058
title: "Sensors map",
41-
link: "https://sensors.social",
42-
}
59+
link: "https://sensors.social"
60+
}
4361
]
44-
},
62+
},
4563
46-
{
64+
{
4765
title: "Tokenomics",
4866
links: [
49-
{
67+
{
5068
title: "About XRT",
51-
link: "https://robonomics.network/xrt/",
52-
},
53-
{
69+
link: "https://robonomics.network/xrt/"
70+
},
71+
{
5472
title: "Uniswap",
55-
link: "https://app.uniswap.org/#/swap?inputCurrency=0x7de91b204c1c737bcee6f000aaa6569cf7061cb7&outputCurrency=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
56-
},
57-
{
73+
link: "https://app.uniswap.org/#/swap?inputCurrency=0x7de91b204c1c737bcee6f000aaa6569cf7061cb7&outputCurrency=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
74+
},
75+
{
5876
title: "Basilisk",
59-
link: "https://app.basilisk.cloud/pools-and-farms",
60-
}
77+
link: "https://app.basilisk.cloud/pools-and-farms"
78+
}
6179
]
62-
},
80+
},
6381
64-
{
82+
{
6583
title: "Tools",
6684
links: [
67-
{
85+
{
6886
title: "Substrate Portal",
69-
link: "https://polkadot.js.org/apps/?rpc=wss%3A%2F%2F" + network.value + ".rpc.robonomics.network%2F#/explorer",
70-
},
71-
{
87+
link:
88+
"https://polkadot.js.org/apps/?rpc=wss%3A%2F%2F" +
89+
network.value +
90+
".rpc.robonomics.network%2F#/explorer"
91+
},
92+
{
7293
title: "Subscan",
73-
link: "https://robonomics.subscan.io/",
74-
},
75-
{
94+
link: "https://robonomics.subscan.io/"
95+
},
96+
{
7697
title: "Polkassembly",
77-
link: "https://robonomics.polkassembly.io/",
78-
}
98+
link: "https://robonomics.polkassembly.io/"
99+
}
79100
]
80-
},
101+
},
81102
82-
{
103+
{
83104
title: "Help",
84105
links: [
85-
{
106+
{
86107
title: "GitHub",
87-
link: "https://github.com/airalab/robonomics.app",
88-
},
89-
{
108+
link: "https://github.com/airalab/robonomics.app"
109+
},
110+
{
90111
title: "Wiki",
91-
link: "https://wiki.robonomics.network/",
92-
},
93-
{
112+
link: "https://wiki.robonomics.network/"
113+
},
114+
{
94115
title: "Academy",
95-
link: "https://robonomics.academy/",
96-
},
97-
{
116+
link: "https://robonomics.academy/"
117+
},
118+
{
98119
title: "Contacts",
99-
link: "https://robonomics.network/contact/",
100-
},
101-
{
120+
link: "https://robonomics.network/contact/"
121+
},
122+
{
102123
title: "Issues",
103-
link: "https://github.com/airalab/robonomics.app/issues",
104-
},
124+
link: "https://github.com/airalab/robonomics.app/issues"
125+
}
105126
]
106-
}
127+
}
107128
];
108129
109130
const repoversion = ref(null);
110131
111132
onMounted(async () => {
112-
try {
113-
const response = await fetch('https://api.github.com/repos/airalab/robonomics.app/releases/latest');
114-
const data = await response.json();
115-
repoversion.value = data;
116-
} catch (error) {
117-
repoversion.value = 'Ошибка загрузки';
118-
console.error('Ошибка получения версии:', error);
119-
}
133+
try {
134+
const response = await fetch(
135+
"https://api.github.com/repos/airalab/robonomics.app/releases/latest"
136+
);
137+
const data = await response.json();
138+
repoversion.value = data;
139+
} catch (error) {
140+
repoversion.value = "Ошибка загрузки";
141+
logger.error("Ошибка получения версии:", error);
142+
}
120143
});
121-
122144
</script>
123145
124146
<style scoped>
125-
.footer-section {
126-
border-top: 1px dotted var(--robo-color-text);
127-
padding-top: var(--robo-layout-padding);
128-
margin-top: var(--robo-layout-padding);
129-
}
130-
131-
footer {
132-
margin-top: calc(var(--robo-space) * 5);
133-
padding: var(--robo-layout-padding);
134-
}
147+
.footer-section {
148+
border-top: 1px dotted var(--robo-color-text);
149+
padding-top: var(--robo-layout-padding);
150+
margin-top: var(--robo-layout-padding);
151+
}
135152
136-
footer nav {
137-
display: flex;
138-
gap: calc(var(--robo-layout-padding) * 2);
139-
justify-content: center;
140-
}
153+
footer {
154+
margin-top: calc(var(--robo-space) * 5);
155+
padding: var(--robo-layout-padding);
156+
}
141157
142-
footer nav ul:before {
143-
content: attr(data-label);
144-
display: block;
145-
font-weight: bold;
146-
margin-bottom: var(--robo-space);
147-
}
158+
footer nav {
159+
display: flex;
160+
gap: calc(var(--robo-layout-padding) * 2);
161+
justify-content: center;
162+
}
148163
149-
@media screen and (width < 700px) {
150-
footer nav {
151-
font-size: 80%;
152-
gap: var(--robo-layout-padding);
153-
}
154-
}
164+
footer nav ul:before {
165+
content: attr(data-label);
166+
display: block;
167+
font-weight: bold;
168+
margin-bottom: var(--robo-space);
169+
}
155170
156-
@media screen and (width < 500px) {
157-
footer nav {
158-
flex-direction: column;
159-
}
160-
}
171+
@media screen and (width < 700px) {
172+
footer nav {
173+
font-size: 80%;
174+
gap: var(--robo-layout-padding);
175+
}
176+
}
161177
162-
#footer-label {
163-
display: inline-flex;
164-
width: fit-content;
165-
padding-top: var(--robo-space);
166-
padding-bottom: var(--robo-space);
167-
}
168-
</style>
178+
@media screen and (width < 500px) {
179+
footer nav {
180+
flex-direction: column;
181+
}
182+
}
183+
184+
#footer-label {
185+
display: inline-flex;
186+
width: fit-content;
187+
padding-top: var(--robo-space);
188+
padding-bottom: var(--robo-space);
189+
}
190+
</style>

src/components/Header.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
</template>
8383

8484
<script>
85+
import { logger } from "@/utils/logger";
8586
import { fromUnit, round } from "@/utils/tools";
8687
import { usePolkadotApi } from "robonomics-interface-vue";
8788
import { useAccount, useBalance } from "robonomics-interface-vue/account";
@@ -136,7 +137,7 @@ export default {
136137
);
137138
}
138139
} catch (e) {
139-
console.error(e);
140+
logger.error(e);
140141
}
141142
};
142143

src/components/hardware/hooks/dtwin.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import configApp from "@/config";
2+
import { logger } from "@/utils/logger";
23
import { usePolkadotApi } from "robonomics-interface-vue";
34
import { useAccount } from "robonomics-interface-vue/account";
45
import { ref, watch } from "vue";
@@ -40,7 +41,7 @@ export const getCache = (account) => {
4041
return result;
4142
}
4243
} catch (e) {
43-
console.log(e);
44+
logger.error(e);
4445
}
4546
return { total: false, twins: [] };
4647
};

src/components/web3/BtnSend.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
</template>
1111

1212
<script>
13+
import { logger } from "@/utils/logger";
1314
import { ref } from "vue";
1415
1516
const STATUS = {
@@ -34,7 +35,7 @@ export default {
3435
try {
3536
if (tx) {
3637
const receipt = await tx.wait();
37-
console.log(receipt.hash);
38+
logger.log(receipt.hash);
3839
if (last) {
3940
status.value = STATUS.READY;
4041
}

src/components/web3/FreeMinimum.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
<script>
2222
import { $web3 } from "@/plugins/web3";
23+
import { logger } from "@/utils/logger";
2324
import { computed, ref, watch } from "vue";
2425
import { useStore } from "vuex";
2526
import { checkAvailible, getFreeMinimum } from "./apiNftOracle";
@@ -38,7 +39,9 @@ export default {
3839
account.value = store.state.robonomicsUIvue.polkadot.accounts.find(
3940
(item) => item.address === address
4041
);
41-
} catch (e) { console.error(e); }
42+
} catch (e) {
43+
logger.error(e);
44+
}
4245
},
4346
{ immediate: true }
4447
);

0 commit comments

Comments
 (0)