Skip to content

Commit 8a744e7

Browse files
2 parents 56a0c39 + 7f93319 commit 8a744e7

23 files changed

+779
-8
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ NUXT_PUBLIC_CONTRACT_VERIFICATION_SERVICE_URL=https://scv-gateway.dev.service.ae
2222
# Feature flags
2323
NUXT_PUBLIC_ENABLE_MARKET_STATS=true
2424
NUXT_PUBLIC_ENABLE_NODES=true
25+
NUXT_PUBLIC_ENABLE_MINING=true
2526

2627
# Other
2728
NUXT_PUBLIC_AE_TOKEN_ID=ct_J3zBY8xxjsRr3QojETNw48Eb38fjvEuJKkQ6KzECvubvEcvCa

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Changelog
22

33

4+
## [0.23.0](https://github.com/aeternity/aescan/compare/0.22.0...0.23.0) (2025-04-28)
5+
6+
7+
### Features
8+
9+
* Mining Pools Listing 2 ([#1090](https://github.com/aeternity/aescan/issues/1090)) ([7630242](https://github.com/aeternity/aescan/commit/76302420ff0c7dff2f33686b5b2143764fec8e8d))
10+
411
## [0.22.0](https://github.com/aeternity/aescan/compare/0.21.1...0.22.0) (2025-04-22)
512

613

cypress/e2e/app/minings.cy.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
describe('mining', () => {
2+
it('should display mining UI elements', () => {
3+
cy.visit('/mining')
4+
5+
cy.get('.mining-statistics-grid .panel').should('have.length', 11)
6+
cy.get('.mining-statistics-grid canvas').should('have.length', 2)
7+
8+
cy.get('.miners-panel__table').should('be.visible')
9+
10+
cy.contains('.tabs__item', 'Latest Keyblocks').click()
11+
cy.get('.keyblocks-table').should('be.visible')
12+
})
13+
})

nuxt.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export default defineNuxtConfig({
4545
SH_DEX_CONTRACTS: process.env.SH_DEX_CONTRACTS?.split(';'),
4646
ENABLE_MARKET_STATS: process.env.ENABLE_MARKET_STATS,
4747
ENABLE_NODES: process.env.ENABLE_NODES,
48+
ENABLE_MINING: process.env.ENABLE_MINING,
4849
},
4950
},
5051
postcss: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aescan",
3-
"version": "0.22.0",
3+
"version": "0.23.0",
44
"private": true,
55
"author": "æternity",
66
"description": "æScan is a blockchain explorer, analytics platform, and decentralized smart contract navigation platform based on æternity",

src/components/DoughnutChart.vue

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<template>
2+
<div class="doughnut-chart">
3+
<Doughnut
4+
:options="chartOptions"
5+
:data="data"/>
6+
</div>
7+
</template>
8+
9+
<script setup>
10+
import {
11+
ArcElement,
12+
CategoryScale,
13+
Chart as ChartJS,
14+
Legend,
15+
LinearScale,
16+
LineElement,
17+
PointElement,
18+
Title,
19+
Tooltip,
20+
} from 'chart.js'
21+
22+
import { Doughnut } from 'vue-chartjs'
23+
24+
const props = defineProps({
25+
interval: {
26+
type: String,
27+
required: true,
28+
},
29+
topMiners: {
30+
type: Array,
31+
required: true,
32+
},
33+
})
34+
35+
const data = {
36+
labels: props.topMiners.miners,
37+
datasets: [{
38+
data: props.topMiners.blocksMined,
39+
backgroundColor: [
40+
'rgb(0, 61, 255)',
41+
'rgb(102, 231, 115)',
42+
'rgb(245, 39, 78)',
43+
],
44+
hoverOffset: 4,
45+
}],
46+
}
47+
48+
const chartOptions = {
49+
responsive: true,
50+
maintainAspectRatio: false,
51+
plugins: {
52+
legend: {
53+
display: true,
54+
position: 'bottom',
55+
align: 'start',
56+
},
57+
tooltip: {
58+
tooltip: {
59+
position: 'top',
60+
},
61+
callbacks: {
62+
title: context => context.formattedValue,
63+
label: context => `${context.formattedValue} blocks`,
64+
},
65+
},
66+
},
67+
}
68+
69+
ChartJS.register(
70+
CategoryScale,
71+
LinearScale,
72+
PointElement,
73+
LineElement,
74+
Title,
75+
Tooltip,
76+
Legend,
77+
ArcElement,
78+
)
79+
80+
ChartJS.defaults.font.family = 'Roboto Mono'
81+
</script>
82+
83+
<style scoped>
84+
.doughnut-chart {
85+
position: relative;
86+
87+
display: flex;
88+
align-items: center;
89+
justify-content: center;
90+
}
91+
</style>

src/components/LineChart.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import {
2323
Tooltip,
2424
} from 'chart.js'
2525
26-
import { DateTime } from 'luxon'
2726
import { Line } from 'vue-chartjs'
27+
import { DateTime } from 'luxon'
2828
2929
const hasChart = computed(() => props.data?.length > 0)
3030
const isEmpty = computed(() => props.data?.length === 0)
@@ -39,6 +39,10 @@ const props = defineProps({
3939
type: String,
4040
required: true,
4141
},
42+
height: {
43+
type: Number,
44+
default: 250,
45+
},
4246
})
4347
4448
const stats = computed(() => {
@@ -142,7 +146,7 @@ ChartJS.defaults.font.family = 'Roboto Mono'
142146
143147
<style scoped>
144148
.line-chart {
145-
height: 250px;
149+
height: v-bind(height+ 'px');
146150
position: relative;
147151
148152
display: flex;

src/components/MinersPanel.vue

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<template>
2+
<app-panel class="miners-panel">
3+
<paginated-content
4+
:entities="miners"
5+
:total-count="minersCount"
6+
pagination-style="history"
7+
@prev-clicked="loadPrevMiners"
8+
@next-clicked="loadNextMiners">
9+
<miners-table
10+
:miners="miners"
11+
class="miners-panel__table"/>
12+
</paginated-content>
13+
</app-panel>
14+
</template>
15+
16+
<script setup>
17+
const { miners, minersCount } = storeToRefs(useMiningStore())
18+
const { fetchMiners } = useMiningStore()
19+
20+
function loadPrevMiners() {
21+
fetchMiners(miners.value.prev)
22+
}
23+
24+
function loadNextMiners() {
25+
fetchMiners(miners.value.next)
26+
}
27+
28+
if (process.client) {
29+
await fetchMiners()
30+
}
31+
</script>
32+
33+
<style scoped>
34+
.miners-panel-panel__table {
35+
margin-bottom: var(--space-4);
36+
}
37+
</style>

src/components/MinersTable.vue

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<template>
2+
<table>
3+
<thead>
4+
<tr>
5+
<th>
6+
Miner
7+
<hint-tooltip>
8+
{{ miningHints.minerAccount }}
9+
</hint-tooltip>
10+
</th>
11+
<th>
12+
Total Reward
13+
<hint-tooltip>
14+
{{ miningHints.minerTotalReward }}
15+
</hint-tooltip>
16+
</th>
17+
</tr>
18+
</thead>
19+
<tbody>
20+
<tr
21+
v-for="miner in miners.data"
22+
:key="miner.miner">
23+
<td>
24+
<value-hash-ellipsed
25+
:link-to="`/accounts/${miner.miner}`"
26+
:hash="miner.miner "/>
27+
</td>
28+
<td>
29+
<price-label :price="miner.totalReward"/>
30+
</td>
31+
</tr>
32+
</tbody>
33+
</table>
34+
</template>
35+
36+
<script setup>
37+
import { miningHints } from '@/utils/hints/miningHints'
38+
39+
defineProps({
40+
miners: {
41+
type: Array,
42+
required: true,
43+
},
44+
})
45+
</script>

src/components/MiningPoolsPanel.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<template>
2+
<app-panel class="mining-pools-panel">
3+
<paginated-content
4+
:entities="{ data: MINING_POOLS }"
5+
:total-count="MINING_POOLS.length">
6+
<mining-pools-table :pools="MINING_POOLS"/>
7+
</paginated-content>
8+
</app-panel>
9+
</template>

0 commit comments

Comments
 (0)