You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.7 KiB
83 lines
2.7 KiB
<template> |
|
<v-row justify="center" align="center" no-gutters> |
|
<v-col cols="12" class="pa-0"> |
|
<v-card tile flat style="border-bottom: 1px solid #2e2e2e"> |
|
<v-simple-table> |
|
<template #default> |
|
<thead> |
|
<tr> |
|
<th class="text-left">{{ $t('pages.blocks.blocks') }}</th> |
|
<th class="text-left">{{ $t('pages.blocks.shares') }}</th> |
|
<th class="text-left">{{ $t('pages.blocks.uncleRate') }}</th> |
|
<th class="text-left">{{ $t('pages.blocks.orphanRate') }}</th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
<tr v-for="(item, key) in blocks.luck" :key="key"> |
|
<td>{{ key }}</td> |
|
<td>{{ formatPercentage(item.luck) }}</td> |
|
<td>{{ formatPercentage(item.uncleRate) }}</td> |
|
<td>{{ formatPercentage(item.orphanRate) }}</td> |
|
</tr> |
|
</tbody> |
|
</template> |
|
</v-simple-table> |
|
</v-card> |
|
<v-card tile flat> |
|
<v-tabs v-model="tab" background-color="transparent" grow> |
|
<v-tab>{{ $t('pages.blocks.blocks') }}<v-chip label small color="success" class="ml-2">{{ blocks.maturedTotal }}</v-chip></v-tab> |
|
<v-tab>{{ $t('pages.blocks.immature') }}<v-chip label small color="warning" class="ml-2">{{ blocks.immatureTotal }}</v-chip></v-tab> |
|
<v-tab>{{ $t('pages.blocks.newBlocks') }}<v-chip label small color="info" class="ml-2">{{ blocks.candidatesTotal }}</v-chip></v-tab> |
|
</v-tabs> |
|
<v-tabs-items v-model="tab"> |
|
<v-tab-item> |
|
<blocks-table :blocks="matured" :config="config" :no-data-text="$t('pages.blocks.noMatured')" /> |
|
</v-tab-item> |
|
<v-tab-item> |
|
<blocks-table :blocks="immature" :config="config" :no-data-text="$t('pages.blocks.noImmature')" /> |
|
</v-tab-item> |
|
<v-tab-item> |
|
<blocks-table :blocks="candidates" :config="config" :no-data-text="$t('pages.blocks.noPending')" /> |
|
</v-tab-item> |
|
</v-tabs-items> |
|
</v-card> |
|
</v-col> |
|
</v-row> |
|
</template> |
|
|
|
<script> |
|
import BlocksTable from '~/components/tables/Blocks' |
|
|
|
export default { |
|
components: { |
|
BlocksTable, |
|
}, |
|
data() { |
|
return { |
|
tab: null, |
|
} |
|
}, |
|
computed: { |
|
blocks() { |
|
return this.$store.state.blocks |
|
}, |
|
matured() { |
|
return this.$store.state.blocks?.matured || [] |
|
}, |
|
immature() { |
|
return this.$store.state.blocks?.immature || [] |
|
}, |
|
candidates() { |
|
return this.$store.state.blocks?.candidates || [] |
|
}, |
|
config() { |
|
return this.$store.state.env |
|
}, |
|
}, |
|
methods: { |
|
formatPercentage(value) { |
|
return (value * 100).toFixed(2) + '%' |
|
}, |
|
}, |
|
} |
|
</script>
|
|
|