Fixed some issues
This commit is contained in:
parent
b7cf79e1cc
commit
eaac3b295a
@ -1,11 +1,20 @@
|
||||
import dayjs from 'dayjs'
|
||||
import relativeTime from 'dayjs/plugin/relativeTime'
|
||||
import {
|
||||
Bech32, fromBase64, fromHex, toHex,
|
||||
} from '@cosmjs/encoding'
|
||||
import { sha256 } from '@cosmjs/crypto'
|
||||
|
||||
import dayjs from 'dayjs'
|
||||
import duration from 'dayjs/plugin/duration'
|
||||
import relativeTime from 'dayjs/plugin/relativeTime'
|
||||
import localeData from 'dayjs/plugin/localeData'
|
||||
|
||||
dayjs.extend(duration)
|
||||
dayjs.extend(relativeTime)
|
||||
dayjs.extend(localeData)
|
||||
|
||||
export function toDuration(value) {
|
||||
return dayjs.duration(value).humanize()
|
||||
}
|
||||
|
||||
export function toDay(time, format = 'long') {
|
||||
if (format === 'long') {
|
||||
|
@ -242,6 +242,7 @@ section {
|
||||
.gov-wrapper .gov {
|
||||
padding: .5rem;
|
||||
margin: .3rem;
|
||||
min-width: 8rem;
|
||||
text-align: center;
|
||||
background-color: #f8f8f8;
|
||||
border-radius: .357rem;
|
||||
|
@ -15,7 +15,7 @@
|
||||
Top 67% of Voting Power
|
||||
</small>
|
||||
<b-card-title>
|
||||
<span>Validators<small> {{ validators.length }}/{{ stakingParameters.max_validators }}</small> </span>
|
||||
<span>Validators {{ validators.length }}/{{ stakingParameters.max_validators }} </span>
|
||||
</b-card-title>
|
||||
</b-card-header>
|
||||
<b-table
|
||||
|
@ -36,19 +36,11 @@
|
||||
<script>
|
||||
import { BRow, BCol } from 'bootstrap-vue'
|
||||
import {
|
||||
formatNumber, isToken, percent, tokenFormatter,
|
||||
formatNumber, isToken, percent, toDuration, tokenFormatter,
|
||||
} from '@/libs/data'
|
||||
import dayjs from 'dayjs'
|
||||
import duration from 'dayjs/plugin/duration'
|
||||
import relativeTime from 'dayjs/plugin/relativeTime'
|
||||
|
||||
import localeData from 'dayjs/plugin/localeData'
|
||||
import SummaryParmetersComponent from './SummaryParmetersComponent.vue'
|
||||
|
||||
dayjs.extend(duration)
|
||||
dayjs.extend(relativeTime)
|
||||
dayjs.extend(localeData)
|
||||
|
||||
export default {
|
||||
components: {
|
||||
BRow,
|
||||
@ -162,7 +154,7 @@ export default {
|
||||
return { title: `${percent(d)}%`, subtitle: k }
|
||||
}
|
||||
if (d > 1000000000) {
|
||||
return { title: `${dayjs.duration(d / 1000000).humanize()}`, subtitle: k }
|
||||
return { title: `${toDuration(d / 1000000)}`, subtitle: k }
|
||||
}
|
||||
return { title: data[k], subtitle: k }
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user