improve UX
This commit is contained in:
parent
543118ba92
commit
dcd26824f9
@ -75,6 +75,16 @@
|
|||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
</b-card-body>
|
</b-card-body>
|
||||||
|
<b-card-body class="pt-0">
|
||||||
|
<b-button
|
||||||
|
v-b-modal.withdraw-commission-window
|
||||||
|
block
|
||||||
|
size="sm"
|
||||||
|
variant="primary"
|
||||||
|
>
|
||||||
|
Withdraw Commission
|
||||||
|
</b-button>
|
||||||
|
</b-card-body>
|
||||||
<operation-withdraw-commission-component
|
<operation-withdraw-commission-component
|
||||||
:validator-address="validator"
|
:validator-address="validator"
|
||||||
:address="address"
|
:address="address"
|
||||||
@ -84,12 +94,13 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
BCard, BCardHeader, BCardTitle, BCardBody, BMediaBody, BMedia, BMediaAside, BAvatar,
|
BCard, BCardHeader, BCardTitle, BCardBody, BMediaBody, BMedia, BMediaAside, BAvatar, BButton,
|
||||||
} from 'bootstrap-vue'
|
} from 'bootstrap-vue'
|
||||||
import OperationWithdrawCommissionComponent from './OperationWithdrawCommissionComponent.vue'
|
import OperationWithdrawCommissionComponent from './OperationWithdrawCommissionComponent.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
BButton,
|
||||||
BCard,
|
BCard,
|
||||||
BCardHeader,
|
BCardHeader,
|
||||||
BCardTitle,
|
BCardTitle,
|
||||||
|
@ -111,11 +111,10 @@ export default {
|
|||||||
|
|
||||||
if (cached) {
|
if (cached) {
|
||||||
this.validators = cached
|
this.validators = cached
|
||||||
} else {
|
|
||||||
this.$http.getValidatorList().then(res => {
|
|
||||||
this.validators = res
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
this.$http.getValidatorList().then(res => {
|
||||||
|
this.validators = res
|
||||||
|
})
|
||||||
this.initBlocks()
|
this.initBlocks()
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
@ -13,6 +13,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</b-alert>
|
</b-alert>
|
||||||
<b-row>
|
<b-row>
|
||||||
|
<span
|
||||||
|
v-if="uptime.length===0"
|
||||||
|
class="text-danger"
|
||||||
|
> Your node is out of active validator set</span>
|
||||||
<b-col
|
<b-col
|
||||||
v-for="(x,index) in uptime"
|
v-for="(x,index) in uptime"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
@ -130,7 +130,7 @@
|
|||||||
class="mr-25"
|
class="mr-25"
|
||||||
>
|
>
|
||||||
<feather-icon
|
<feather-icon
|
||||||
icon="PlusIcon"
|
icon="LogInIcon"
|
||||||
class="d-md-none"
|
class="d-md-none"
|
||||||
/><small class="d-none d-md-block">Delegate</small>
|
/><small class="d-none d-md-block">Delegate</small>
|
||||||
</b-button>
|
</b-button>
|
||||||
@ -141,7 +141,7 @@
|
|||||||
size="sm"
|
size="sm"
|
||||||
>
|
>
|
||||||
<feather-icon
|
<feather-icon
|
||||||
icon="MinusIcon"
|
icon="ShareIcon"
|
||||||
class="d-md-none"
|
class="d-md-none"
|
||||||
/><small class="d-none d-md-block"> Withdraw Rewards</small>
|
/><small class="d-none d-md-block"> Withdraw Rewards</small>
|
||||||
</b-button>
|
</b-button>
|
||||||
|
@ -191,22 +191,22 @@
|
|||||||
<div
|
<div
|
||||||
v-for="b,i in balances[acc.addr]"
|
v-for="b,i in balances[acc.addr]"
|
||||||
:key="i"
|
:key="i"
|
||||||
class="d-flex justify-content-between align-items-center"
|
class="d-flex justify-content-between"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ml-25 font-weight-bolder text-uppercase text-success"
|
class="ml-25 font-weight-bolder text-uppercase text-success d-flex flex-column text-left"
|
||||||
title="Balance"
|
title="Balance"
|
||||||
>
|
>
|
||||||
{{ formatDenom(b.denom) }}
|
{{ formatAmount(b.amount, b.denom) }} {{ formatDenom(b.denom) }}
|
||||||
|
<span class="font-small-2 text-muted text-nowrap">{{ currency }}{{ formatCurrency(b.amount, b.denom) }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="d-flex flex-column text-right">
|
||||||
|
<span class="font-weight-bold mb-0">{{ currency }}{{ formatPrice(b.denom) }}</span>
|
||||||
<small
|
<small
|
||||||
:class="priceColor(b.denom)"
|
:class="priceColor(b.denom)"
|
||||||
class="py-0"
|
class="py-0"
|
||||||
>{{ formatChanges(b.denom) }}</small>
|
>{{ formatChanges(b.denom) }}</small>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex flex-column text-right">
|
|
||||||
<span class="font-weight-bold mb-0">{{ formatAmount(b.amount, b.denom) }}</span>
|
|
||||||
<span class="font-small-2 text-muted text-nowrap">{{ currency }}{{ formatCurrency(b.amount, b.denom) }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-for="b,i in delegations[acc.addr]"
|
v-for="b,i in delegations[acc.addr]"
|
||||||
@ -214,19 +214,19 @@
|
|||||||
class="d-flex justify-content-between align-items-center"
|
class="d-flex justify-content-between align-items-center"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="ml-25 font-weight-bolder text-uppercase text-primary"
|
class="ml-25 font-weight-bolder text-uppercase text-primary d-flex flex-column text-left"
|
||||||
title="Delegations"
|
title="Balance"
|
||||||
>
|
>
|
||||||
{{ formatDenom(b.denom) }}
|
{{ formatAmount(b.amount, b.denom) }} {{ formatDenom(b.denom) }}
|
||||||
|
<span class="font-small-2 text-muted text-nowrap">{{ currency }}{{ formatCurrency(b.amount, b.denom) }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="d-flex flex-column text-right">
|
||||||
|
<span class="font-weight-bold mb-0">{{ currency }}{{ formatPrice(b.denom) }}</span>
|
||||||
<small
|
<small
|
||||||
:class="priceColor(b.denom)"
|
:class="priceColor(b.denom)"
|
||||||
class="py-0"
|
class="py-0"
|
||||||
>{{ formatChanges(b.denom) }}</small>
|
>{{ formatChanges(b.denom) }}</small>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex flex-column text-right">
|
|
||||||
<span class="font-weight-bold mb-0">{{ formatAmount(b.amount, b.denom) }}</span>
|
|
||||||
<span class="font-small-2 text-muted text-nowrap">{{ currency }}{{ formatCurrency(b.amount, b.denom) }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</app-collapse-item>
|
</app-collapse-item>
|
||||||
</app-collapse>
|
</app-collapse>
|
||||||
@ -515,8 +515,16 @@ export default {
|
|||||||
})
|
})
|
||||||
this.$http.getStakingDelegations(add.addr, chains[add.chain]).then(res => {
|
this.$http.getStakingDelegations(add.addr, chains[add.chain]).then(res => {
|
||||||
if (res.delegation_responses) {
|
if (res.delegation_responses) {
|
||||||
const delegation = res.delegation_responses.map(x => x.balance)
|
const delegation = res.delegation_responses.map(x => x.balance).reduce((t, c) => {
|
||||||
this.$set(this.delegations, add.addr, delegation)
|
const t1 = t
|
||||||
|
if (t1[c.denom]) {
|
||||||
|
t1[c.denom] += Number(c.amount)
|
||||||
|
} else {
|
||||||
|
t1[c.denom] = Number(c.amount)
|
||||||
|
}
|
||||||
|
return t1
|
||||||
|
}, {})
|
||||||
|
this.$set(this.delegations, add.addr, Object.keys(delegation).map(x => ({ amount: String(delegation[x]), denom: x })))
|
||||||
}
|
}
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
})
|
})
|
||||||
@ -536,10 +544,12 @@ export default {
|
|||||||
this.$bvModal.hide('add-account')
|
this.$bvModal.hide('add-account')
|
||||||
},
|
},
|
||||||
formatDenom(v) {
|
formatDenom(v) {
|
||||||
|
if (!v) return ''
|
||||||
const denom = (v.startsWith('ibc') ? this.ibcDenom[v] : v)
|
const denom = (v.startsWith('ibc') ? this.ibcDenom[v] : v)
|
||||||
return formatTokenDenom(denom)
|
return formatTokenDenom(denom)
|
||||||
},
|
},
|
||||||
formatAmount(v, denom = 'uatom') {
|
formatAmount(v, denom = 'uatom') {
|
||||||
|
if (!v) return ''
|
||||||
return formatTokenAmount(v, 2, denom)
|
return formatTokenAmount(v, 2, denom)
|
||||||
},
|
},
|
||||||
formatAddr(v) {
|
formatAddr(v) {
|
||||||
@ -577,6 +587,15 @@ export default {
|
|||||||
const price = this.getChanges(denom)
|
const price = this.getChanges(denom)
|
||||||
return price === 0 ? '' : `${parseFloat(price.toFixed(2))}%`
|
return price === 0 ? '' : `${parseFloat(price.toFixed(2))}%`
|
||||||
},
|
},
|
||||||
|
formatPrice(denom) {
|
||||||
|
const d2 = this.formatDenom(denom)
|
||||||
|
const quote = this.$store.state.chains.quotes[d2]
|
||||||
|
if (quote) {
|
||||||
|
const price = quote[this.currency2]
|
||||||
|
return price
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
},
|
||||||
formatBalance(v) {
|
formatBalance(v) {
|
||||||
let total = 0
|
let total = 0
|
||||||
const balance = this.balances[v]
|
const balance = this.balances[v]
|
||||||
|
Loading…
Reference in New Issue
Block a user