From 5620337d3ad3fecf4a862fdae4f98507d3e67166 Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Sat, 7 Aug 2021 07:35:49 +0800 Subject: [PATCH] change Layout of first panel --- src/views/Summary.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/views/Summary.vue b/src/views/Summary.vue index d2e7dad6..c72fc473 100644 --- a/src/views/Summary.vue +++ b/src/views/Summary.vue @@ -61,10 +61,10 @@ export default { title: '', class: 'border-primary', items: [ - { subtitle: 'chain_id', icon: 'LinkIcon', color: 'light-primary' }, { subtitle: 'height', icon: 'BoxIcon', color: 'light-success' }, { subtitle: 'bonded_and_supply', icon: 'DollarSignIcon', color: 'light-danger' }, { subtitle: 'bonded_ratio', icon: 'PercentIcon', color: 'light-warning' }, + { subtitle: 'inflation', icon: 'TrendingUpIcon', color: 'light-primary' }, ], }, staking: { @@ -91,13 +91,17 @@ export default { }, created() { this.$http.getLatestBlock().then(res => { - const chainIndex = this.chain.items.findIndex(x => x.subtitle === 'chain_id') const height = this.chain.items.findIndex(x => x.subtitle === 'height') - this.$set(this.chain.items[chainIndex], 'title', res.block.header.chain_id) + this.$set(this.chain, 'title', `Chain ID: ${res.block.header.chain_id}`) this.$set(this.chain.items[height], 'title', res.block.header.height) }) + this.$http.getMintingInflation().then(res => { + const chainIndex = this.chain.items.findIndex(x => x.subtitle === 'inflation') + this.$set(this.chain.items[chainIndex], 'title', `${percent(res)}%`) + }) + this.$http.getStakingParameters().then(res => { this.staking = this.normalize(res, 'Staking Parameters') Promise.all([this.$http.getStakingPool(), this.$http.getBankTotal(res.bond_denom)])