Improve UI

This commit is contained in:
liangping 2021-08-17 10:54:43 +08:00
parent 1bc87207b4
commit 1bddb844a5
6 changed files with 23 additions and 30 deletions

View File

@ -5,6 +5,7 @@
:sticky-header="true" :sticky-header="true"
:no-border-collapse="true" :no-border-collapse="true"
responsive responsive
class="ml-0 mr-0"
> >
<template #cell()="data"> <template #cell()="data">
<span v-if="isTokenField(data.value)">{{ formatTokens(data.value) }}</span> <span v-if="isTokenField(data.value)">{{ formatTokens(data.value) }}</span>
@ -26,7 +27,7 @@ import { BTable } from 'bootstrap-vue'
// import fetch from 'node-fetch' // import fetch from 'node-fetch'
import { import {
abbr, getStakingValidatorByHex, isHexAddress, isToken, toDay, tokenFormatter, getStakingValidatorByHex, isHexAddress, isToken, toDay, tokenFormatter,
} from '@/libs/data/data' } from '@/libs/data/data'
// import { Proposal, Proposer } from '@/libs/data' // import { Proposal, Proposer } from '@/libs/data'
// import { formatToken } from '@/libs/data/data' // import { formatToken } from '@/libs/data/data'
@ -61,7 +62,7 @@ export default {
if (reg.test(value)) { if (reg.test(value)) {
return toDay(value) return toDay(value)
} }
return abbr(value, 40) return value
}, },
formatTokens(value) { formatTokens(value) {
return tokenFormatter(value) return tokenFormatter(value)

View File

@ -2,6 +2,7 @@
<div> <div>
<b-card <b-card
no-body no-body
class="text-truncate"
> >
<b-card-header> <b-card-header>
<b-card-title> <b-card-title>
@ -15,7 +16,6 @@
sort-by="tokens" sort-by="tokens"
striped striped
hover hover
responsive
stacked="sm" stacked="sm"
> >
<!-- Column: Height --> <!-- Column: Height -->
@ -75,7 +75,7 @@ export default {
{ {
key: 'hash', key: 'hash',
thClass: 'd-none d-lg-block', thClass: 'd-none d-lg-block',
tdClass: 'd-none d-lg-block', tdClass: 'd-none d-lg-block text-truncate',
}, },
{ {
key: 'proposer', key: 'proposer',

View File

@ -9,8 +9,8 @@
<b-card> <b-card>
<b-card-title <b-card-title
class="mb-0" class="mb-0"
style="height:40px;"
> >
#{{ p.id }}.
<b-badge <b-badge
v-if="p.status == 1" v-if="p.status == 1"
pill pill
@ -43,7 +43,6 @@
> >
Rejected Rejected
</b-badge> </b-badge>
#{{ p.id }}.
<router-link <router-link
:to="`./gov/${p.id}`" :to="`./gov/${p.id}`"
> >

View File

@ -5,6 +5,7 @@
> >
<b-card-header> <b-card-header>
<b-card-title> <b-card-title>
#{{ proposal.id }}
<b-badge <b-badge
v-if="proposal.status == 1" v-if="proposal.status == 1"
pill pill
@ -37,7 +38,7 @@
> >
Rejected Rejected
</b-badge> </b-badge>
#{{ proposal.id }} {{ proposal.title }} {{ proposal.title }}
</b-card-title> </b-card-title>
</b-card-header> </b-card-header>
<b-card-body> <b-card-body>
@ -71,13 +72,8 @@
</b-tr> </b-tr>
<b-tr> <b-tr>
<b-td> <b-td>
{{ $t('proposal_voting_start_time') }} {{ $t('voting_time') }}
</b-td><b-td>{{ proposal.voting_start_time }}</b-td> </b-td><b-td>{{ proposal.voting_start_time }} - {{ proposal.voting_end_time }}</b-td>
</b-tr>
<b-tr>
<b-td>
{{ $t('proposal_voting_end_time') }}
</b-td><b-td>{{ proposal.voting_end_time }}</b-td>
</b-tr> </b-tr>
<b-tr> <b-tr>
<b-td> <b-td>
@ -88,7 +84,7 @@
</b-tr> </b-tr>
</tbody> </tbody>
</b-table-simple> </b-table-simple>
<div> <div style="white-space: pre-line">
<object-field-component <object-field-component
:tablefield="proposal.contents" :tablefield="proposal.contents"
:small="false" :small="false"

View File

@ -124,6 +124,8 @@ export default {
} }
</script> </script>
<style scoped> <style lang='css'>
@media (min-width: 768px) {
td:first-child { width: 20% ;}
}
</style> </style>

View File

@ -1,6 +1,9 @@
<template> <template>
<div> <div>
<b-card title="Baisc"> <b-card
title="Baisc"
class="text-truncate"
>
<object-field-component <object-field-component
v-if="!tx.std" v-if="!tx.std"
:tablefield="tx.raw" :tablefield="tx.raw"
@ -14,7 +17,9 @@
<b-tr> <b-tr>
<b-td style="width:200px"> <b-td style="width:200px">
{{ 'txhash' }} {{ 'txhash' }}
</b-td><b-td>{{ tx.txhash }}</b-td> </b-td><b-td
class="text-truncate"
>{{ tx.txhash }}</b-td>
</b-tr> </b-tr>
<b-tr> <b-tr>
<b-td> <b-td>
@ -44,20 +49,10 @@
{{ 'timestamp' }} {{ 'timestamp' }}
</b-td><b-td>{{ formatTime(tx.timestamp) }}</b-td> </b-td><b-td>{{ formatTime(tx.timestamp) }}</b-td>
</b-tr> </b-tr>
<b-tr>
<b-td>
{{ 'gas_used' }}
</b-td><b-td>{{ tx.gas_used }}</b-td>
</b-tr>
<b-tr>
<b-td>
{{ 'gas_wanted' }}
</b-td><b-td>{{ tx.gas_wanted }}</b-td>
</b-tr>
<b-tr> <b-tr>
<b-td> <b-td>
{{ 'gas' }} {{ 'gas' }}
</b-td><b-td>{{ tx.tx.gas }}</b-td> </b-td><b-td>{{ tx.gas_used }} / {{ tx.gas_wanted }}</b-td>
</b-tr> </b-tr>
<b-tr> <b-tr>
<b-td> <b-td>