Improve UI

This commit is contained in:
liangping 2021-08-16 23:03:32 +08:00
parent 1ae8395fc6
commit 1bc87207b4
4 changed files with 187 additions and 158 deletions

View File

@ -1,6 +1,8 @@
<template> <template>
<section> <section>
<b-card> <b-card
no-body
>
<b-card-header> <b-card-header>
<b-card-title> <b-card-title>
<b-badge <b-badge
@ -39,9 +41,16 @@
</b-card-title> </b-card-title>
</b-card-header> </b-card-header>
<b-card-body> <b-card-body>
<b-table-simple> <b-table-simple
stacked="sm"
hover
striped
>
<tbody>
<b-tr> <b-tr>
<b-td style="width:200px"> <b-td
style="text-transform: capitalize; vertical-align: top; width:200px"
>
{{ $t('proposal_id') }} {{ $t('proposal_id') }}
</b-td><b-td>{{ proposal.id }}</b-td> </b-td><b-td>{{ proposal.id }}</b-td>
</b-tr> </b-tr>
@ -73,13 +82,17 @@
<b-tr> <b-tr>
<b-td> <b-td>
{{ $t('proposal_type') }} {{ $t('proposal_type') }}
</b-td><b-td>{{ proposal.type }}</b-td> </b-td><b-td>
{{ proposal.type }}
</b-td>
</b-tr> </b-tr>
</tbody>
</b-table-simple> </b-table-simple>
<div>
<object-field-component <object-field-component
:tablefield="proposal.contents" :tablefield="proposal.contents"
:small="false" :small="false"
/> /></div>
</b-card-body> </b-card-body>
<b-card-footer> <b-card-footer>
<router-link :to="`../gov`"> <router-link :to="`../gov`">
@ -99,7 +112,7 @@
</b-card-footer> </b-card-footer>
</b-card> </b-card>
<b-card> <b-card no-body>
<b-card-header> <b-card-header>
<b-card-title> <b-card-title>
Votes Votes
@ -158,12 +171,14 @@
{{ proposal.tally.abstain }}% voted Abstain {{ proposal.tally.abstain }}% voted Abstain
</b-tooltip> </b-tooltip>
<b-table <b-table
stacked="sm"
:fields="votes_fields" :fields="votes_fields"
:items="votes" :items="votes"
striped
/> />
</b-card-body> </b-card-body>
</b-card> </b-card>
<b-card> <b-card no-body>
<b-card-header> <b-card-header>
<b-card-title> <b-card-title>
Deposits ({{ proposal.total_deposit }}) Deposits ({{ proposal.total_deposit }})
@ -171,8 +186,10 @@
</b-card-header> </b-card-header>
<b-card-body> <b-card-body>
<b-table <b-table
stacked="sm"
:items="deposits" :items="deposits"
:fields="deposit_fields" :fields="deposit_fields"
striped
/> />
</b-card-body> </b-card-body>
<b-card-footer> <b-card-footer>

View File

@ -132,7 +132,7 @@ export default {
}, },
created() { created() {
this.chains = JSON.parse(localStorage.getItem('chains')) this.chains = JSON.parse(localStorage.getItem('chains'))
this.timer = setInterval(this.fetch, 12000) this.timer = setInterval(this.fetch, 120000)
}, },
beforeDestroy() { beforeDestroy() {
clearInterval(this.timer) clearInterval(this.timer)

View File

@ -4,14 +4,16 @@
hover hover
:small="small" :small="small"
striped striped
responsive stacked="sm"
responsive="sm"
> >
<b-tbody>
<b-tr <b-tr
v-for="(value, name) in tablefield" v-for="(value, name) in tablefield"
:key="name" :key="name"
> >
<b-td <b-td
style="text-transform: capitalize; vertical-align: top; width:200px" style="text-transform: capitalize; vertical-align: top;"
> >
{{ name }} {{ name }}
</b-td> </b-td>
@ -32,12 +34,13 @@
hover hover
class="overflow-hidden" class="overflow-hidden"
> >
<b-tabs> <b-tabs pills>
<b-tab <b-tab
v-for="key in Object.keys(value)" v-for="key in Object.keys(value)"
:key="key" :key="key"
:title="key" :title="key"
variant="danger" class="pl-0 pr-0"
title-item-class="bg-light-primary"
> >
<array-field-component <array-field-component
v-if="Array.isArray(value[key])" v-if="Array.isArray(value[key])"
@ -55,12 +58,13 @@
{{ value }} {{ value }}
</b-td> </b-td>
</b-tr> </b-tr>
</b-tbody>
</b-table-simple> </b-table-simple>
</template> </template>
<script> <script>
import { import {
BTableSimple, BTr, BTd, BTabs, BTab, BTableSimple, BTr, BTd, BTabs, BTab, BTbody,
} from 'bootstrap-vue' } from 'bootstrap-vue'
import { import {
abbr, getStakingValidatorByHex, isHexAddress, isStringArray, isToken, tokenFormatter, abbr, getStakingValidatorByHex, isHexAddress, isStringArray, isToken, tokenFormatter,
@ -75,6 +79,7 @@ export default {
BTd, BTd,
BTabs, BTabs,
BTab, BTab,
BTbody,
ArrayFieldComponent, ArrayFieldComponent,
}, },
props: { props: {

View File

@ -5,7 +5,12 @@
v-if="!tx.std" v-if="!tx.std"
:tablefield="tx.raw" :tablefield="tx.raw"
/> />
<b-table-simple v-else> <b-table-simple
v-else
striped
stacked="sm"
>
<tbody>
<b-tr> <b-tr>
<b-td style="width:200px"> <b-td style="width:200px">
{{ 'txhash' }} {{ 'txhash' }}
@ -69,12 +74,14 @@
{{ 'timeout_height' }} {{ 'timeout_height' }}
</b-td><b-td>{{ tx.tx.timeout_height }}</b-td> </b-td><b-td>{{ tx.tx.timeout_height }}</b-td>
</b-tr> </b-tr>
</tbody>
</b-table-simple> </b-table-simple>
</b-card> </b-card>
<b-card <b-card
v-if="tx.tx.messages" v-if="tx.tx.messages"
:title="`Messages (total: ${tx.tx.messages.length})`" :title="`Messages (total: ${tx.tx.messages.length})`"
no-body
> >
<b-card-body <b-card-body
v-for="(item, i) in tx.tx.messages " v-for="(item, i) in tx.tx.messages "