From 1eb1fc161f9ee2ed6ca9b71dad4035d86c86e49a Mon Sep 17 00:00:00 2001
From: liangping <18786721@qq.com>
Date: Fri, 4 Nov 2022 10:07:57 +0800
Subject: [PATCH 01/16] improve dashboard
---
.../dashboard/DashboardCardHorizontal.vue | 56 ++++++++++++++++---
1 file changed, 48 insertions(+), 8 deletions(-)
diff --git a/src/views/components/dashboard/DashboardCardHorizontal.vue b/src/views/components/dashboard/DashboardCardHorizontal.vue
index d27fa3a1..a7f59c57 100644
--- a/src/views/components/dashboard/DashboardCardHorizontal.vue
+++ b/src/views/components/dashboard/DashboardCardHorizontal.vue
@@ -5,29 +5,50 @@
{{ statistic || '-' }}
- {{ statisticTitle }}
+ {{ statisticTitle }}
+
+ {{ showPrice(statistic) }}
+
+
+ {{ showPrice(statistic) }}
+
-
-
+ :text="statisticTitle.substring(0,1)"
+ :title="statisticTitle"
+ />
From 8c4efe30b662c16da6392db9afce620dea318ff9 Mon Sep 17 00:00:00 2001
From: liangping <18786721@qq.com>
Date: Fri, 4 Nov 2022 10:27:48 +0800
Subject: [PATCH 02/16] improve display for no price token
---
.../components/dashboard/DashboardCardHorizontal.vue | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/views/components/dashboard/DashboardCardHorizontal.vue b/src/views/components/dashboard/DashboardCardHorizontal.vue
index a7f59c57..9046d9f1 100644
--- a/src/views/components/dashboard/DashboardCardHorizontal.vue
+++ b/src/views/components/dashboard/DashboardCardHorizontal.vue
@@ -6,13 +6,16 @@
{{ statistic || '-' }}
{{ statisticTitle }}
+
+ {{ showPrice(statistic, statisticTitle) }}
+
- {{ showPrice(statistic) }}
+ {{ showPrice(statistic, statisticTitle) }}
- {{ showPrice(statistic) }}
+ {{ showPrice(statistic, statisticTitle) }}
= 2) {
const quote = this.$store.state.chains.quotes[token[1]]
@@ -84,7 +87,7 @@ export default {
return `${getUserCurrencySign()}${(Number(token[0].replaceAll(',', '')) * price).toFixed(2)}`
}
}
- return token
+ return statisticTitle
},
},
}
From d25c9d19540818890a8c47a38fe161d237d13435 Mon Sep 17 00:00:00 2001
From: liangping <18786721@qq.com>
Date: Fri, 4 Nov 2022 10:39:34 +0800
Subject: [PATCH 03/16] fix percent of price change
---
src/views/components/dashboard/DashboardCardHorizontal.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/views/components/dashboard/DashboardCardHorizontal.vue b/src/views/components/dashboard/DashboardCardHorizontal.vue
index 9046d9f1..f3f2aa5f 100644
--- a/src/views/components/dashboard/DashboardCardHorizontal.vue
+++ b/src/views/components/dashboard/DashboardCardHorizontal.vue
@@ -12,7 +12,7 @@
{{ showPrice(statistic, statisticTitle) }}
@@ -20,7 +20,7 @@
{{ showPrice(statistic, statisticTitle) }}
From aa21308537fc1841a1dce02b372468b2af55fe74 Mon Sep 17 00:00:00 2001
From: Taariq Levack
Date: Fri, 4 Nov 2022 11:34:22 +0200
Subject: [PATCH 04/16] Update secret mainnet endpoints
---
src/chains/mainnet/secret.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/chains/mainnet/secret.json b/src/chains/mainnet/secret.json
index b4147458..67f67208 100644
--- a/src/chains/mainnet/secret.json
+++ b/src/chains/mainnet/secret.json
@@ -1,8 +1,8 @@
{
"chain_name": "secret",
"coingecko": "secret",
- "api": ["https://api.roninventures.io","https://api.scrt.network"],
- "rpc": ["http://beta-api.scrt.network:26657", "https://api.scrt.network:443"],
+ "api": ["https://secretnetwork-lcd.stakely.io", "https://secret.api.consensus.one", "https://secret-4.api.trivium.network:1317"],
+ "rpc": ["https://secretnetwork-rpc.stakely.io", "https://secret.rpc.consensus.one", "https://secret-4.api.trivium.network:26657"],
"snapshot_provider": "",
"sdk_version": "0.45.4",
"coin_type": "529",
From 4cb900ed1787b4cf308fb7073e7806f3fd801fb5 Mon Sep 17 00:00:00 2001
From: liangping <18786721@qq.com>
Date: Fri, 4 Nov 2022 22:33:24 +0800
Subject: [PATCH 05/16] improve active proposal
---
src/views/Dashboard.vue | 187 ++++++++++++++++++++++++++++++++--------
1 file changed, 153 insertions(+), 34 deletions(-)
diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue
index 621522d4..15ddcee3 100644
--- a/src/views/Dashboard.vue
+++ b/src/views/Dashboard.vue
@@ -93,33 +93,128 @@
Active Proposals
-
-
-
- {{ myVotes[prop.id] || 'Vote' }}
-
-
-
-
-
- {{ prop.id }}. {{ prop.title }}
-
- {{ formatType(prop.contents['@type']) }} {{ formatEnding(prop.voting_end_time) }}
-
-
-
+
+
+ {{ prop.id }}
+
+
+
+
+
+ {{ prop.title }}
+
+ {{ formatType(prop.contents['@type']) }} {{ formatEnding(prop.voting_end_time) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ percent(prop.tally.yes) }}% voted Yes
+
+
+ {{ percent(prop.tally.no) }}% voted No
+
+
+ {{ percent(prop.tally.veto) }}% voted No With Veto
+
+
+ {{ percent(prop.tally.abstain) }}% voted Abstain
+
+
+
+
+ {{ myVotes[prop.id] ? `${myVotes[prop.id]}`: 'Vote' }}
+
+
+
+
+
+
+
+ {{ addNewLine(prop.description) }}
+
+
+
+
No active proposal!
@@ -343,7 +438,7 @@
From 201c11bfc160fe88019e9bb291fc39da8dfc988a Mon Sep 17 00:00:00 2001
From: liangping <18786721@qq.com>
Date: Sat, 5 Nov 2022 08:08:27 +0800
Subject: [PATCH 06/16] add padding
---
src/views/Dashboard.vue | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue
index 15ddcee3..204c3439 100644
--- a/src/views/Dashboard.vue
+++ b/src/views/Dashboard.vue
@@ -192,6 +192,7 @@
v-b-modal.operation-modal
variant="primary"
size="sm"
+ class="mb-2"
@click="selectProposal('Vote',prop.id, prop.title)"
>
{{ myVotes[prop.id] ? `${myVotes[prop.id]}`: 'Vote' }}
@@ -209,7 +210,7 @@
class="shadow-none"
style="max-height:350px;overflow: auto;"
>
-
+
{{ addNewLine(prop.description) }}
From 92938f7d50a98a07fb99a0aa56384bcd0bca7674 Mon Sep 17 00:00:00 2001
From: liangping <18786721@qq.com>
Date: Sat, 5 Nov 2022 12:47:19 +0800
Subject: [PATCH 07/16] fix label issue
---
src/views/Dashboard.vue | 37 +++++++++++--------
src/views/Governance.vue | 9 ++++-
src/views/GovernanceProposalView.vue | 6 ++-
.../governance/ProposalSummaryComponent.vue | 6 ++-
4 files changed, 37 insertions(+), 21 deletions(-)
diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue
index 204c3439..5b864562 100644
--- a/src/views/Dashboard.vue
+++ b/src/views/Dashboard.vue
@@ -133,7 +133,7 @@
@@ -169,22 +169,22 @@
- {{ percent(prop.tally.yes) }}% voted Yes
+ {{ percent(prop.tally.yes) }}% voters voted Yes
- {{ percent(prop.tally.no) }}% voted No
+ {{ percent(prop.tally.no) }}% voters voted No
- {{ percent(prop.tally.veto) }}% voted No With Veto
+ {{ percent(prop.tally.veto) }}% voters voted No With Veto
- {{ percent(prop.tally.abstain) }}% voted Abstain
+ {{ percent(prop.tally.abstain) }}% voters voted Abstain
@@ -515,6 +515,7 @@ export default {
selectedProposalId: 0,
selectedTitle: '',
operationModalType: '',
+ totalPower: 0,
voteColors: {
YES: 'success',
NO: 'warning',
@@ -568,20 +569,21 @@ export default {
this.supply = `${formatNumber(formatTokenAmount(pool[1].amount, 2, res.bond_denom, false), true, 2)}`
this.bonded = `${formatNumber(formatTokenAmount(pool[0].bondedToken, 2, res.bond_denom, false), true, 2)}`
this.ratio = `${percent(pool[0].bondedToken / pool[1].amount)}%`
-
- this.$http.getGovernanceListByStatus(2).then(gov => {
- gov.proposals.forEach(p => {
- this.$http.getGovernanceTally(p.id, pool[0].bondedToken).then(update => {
- const p2 = p
- p2.tally = update
- this.proposals.push(p2)
- this.proposals.sort((a, b) => a.id - b.id)
- })
- })
- })
+ this.totalPower = pool[0].bondedToken
})
})
+ this.$http.getGovernanceListByStatus(2).then(gov => {
+ gov.proposals.forEach(p => {
+ this.$http.getGovernanceTally(p.id, 0).then(update => {
+ const p2 = p
+ p2.tally = update
+ this.proposals.push(p2)
+ this.proposals.sort((a, b) => a.id - b.id)
+ })
+ })
+ })
+
this.$http.getLatestBlock().then(res => {
this.height = res.block.header.height
if (timeIn(res.block.header.time, 3, 'm')) {
@@ -722,6 +724,9 @@ export default {
return value ? value.replace(/(?:\\[rn])+/g, '\n') : '-'
},
percent: v => percent(v),
+ processBarLength(v) {
+ return percent(v)
+ },
formatDate: v => dayjs(v).format('YYYY-MM-DD HH:mm:ss'),
convert(v) {
if (typeof v === 'object') {
diff --git a/src/views/Governance.vue b/src/views/Governance.vue
index e0b83a96..2b4b4395 100644
--- a/src/views/Governance.vue
+++ b/src/views/Governance.vue
@@ -7,7 +7,10 @@
lg="6"
md="12"
>
-
+
@@ -64,6 +67,7 @@ export default {
max: 1,
operationModalType: '',
next: '',
+ totalPower: 0,
}
},
mounted() {
@@ -81,9 +85,10 @@ export default {
},
updateTally(res) {
this.$http.getStakingPool().then(pool => {
+ this.totalPower = pool.bondedToken
const voting = res.filter(i => i.status === 2)
if (voting.length > 0) {
- voting.forEach(p => this.$http.getGovernanceTally(p.id, pool.bondedToken).then(update => {
+ voting.forEach(p => this.$http.getGovernanceTally(p.id, 0).then(update => {
this.$set(p, 'tally', update)
}))
}
diff --git a/src/views/GovernanceProposalView.vue b/src/views/GovernanceProposalView.vue
index 2ad5ddfa..13acd37b 100644
--- a/src/views/GovernanceProposalView.vue
+++ b/src/views/GovernanceProposalView.vue
@@ -113,7 +113,7 @@
{
if (p.status === 2) {
this.$http.getStakingPool().then(pool => {
- this.$http.getGovernanceTally(pid, pool.bondedToken).then(t => p.updateTally(t))
+ this.totalPower = pool.bondedToken
+ this.$http.getGovernanceTally(pid, 0).then(t => p.updateTally(t))
})
}
this.proposal = p
diff --git a/src/views/components/governance/ProposalSummaryComponent.vue b/src/views/components/governance/ProposalSummaryComponent.vue
index 4b2e5cb3..529c651c 100644
--- a/src/views/components/governance/ProposalSummaryComponent.vue
+++ b/src/views/components/governance/ProposalSummaryComponent.vue
@@ -65,7 +65,7 @@
({}),
},
+ totalPower: {
+ type: Number,
+ default: 0,
+ },
},
methods: {
selectProposal(modal, pid, title) {
From fd575711c278366d29b9b41513c5dde108cca996 Mon Sep 17 00:00:00 2001
From: NodeStake
Date: Sat, 5 Nov 2022 14:13:05 +0800
Subject: [PATCH 08/16] Add Rebus rpc/api by NodeStake
---
src/chains/mainnet/rebus.json | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/chains/mainnet/rebus.json b/src/chains/mainnet/rebus.json
index 8fcb3247..7f55e439 100644
--- a/src/chains/mainnet/rebus.json
+++ b/src/chains/mainnet/rebus.json
@@ -1,7 +1,7 @@
{
"chain_name": "rebus",
- "api": ["https://api.mainnet.rebus.money:1317"],
- "rpc": ["https://api.mainnet.rebus.money:26657"],
+ "api": ["https://api.mainnet.rebus.money:1317","https://api.rebus.nodestake.top"],
+ "rpc": ["https://api.mainnet.rebus.money:26657","https://rpc.rebus.nodestake.top"],
"snapshot_provider": "",
"sdk_version": "0.45.6",
"coin_type": "118",
@@ -17,4 +17,4 @@
"logo": "/logos/rebus.png"
}
]
-}
\ No newline at end of file
+}
From 128130fbf2d6be8640340160bcba6ce6fc7cd6cd Mon Sep 17 00:00:00 2001
From: NodeStake
Date: Sat, 5 Nov 2022 14:14:03 +0800
Subject: [PATCH 09/16] Add teritori rpc/api by NodeStake
---
src/chains/mainnet/teritori.json | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/chains/mainnet/teritori.json b/src/chains/mainnet/teritori.json
index 29474faf..ebb12292 100644
--- a/src/chains/mainnet/teritori.json
+++ b/src/chains/mainnet/teritori.json
@@ -1,7 +1,7 @@
{
"chain_name": "teritori",
- "api": ["https://rest.mainnet.teritori.com"],
- "rpc": ["https://rpc.mainnet.teritori.com"],
+ "api": ["https://rest.mainnet.teritori.com","https://api.teritori.nodestake.top"],
+ "rpc": ["https://rpc.mainnet.teritori.com","https://rpc.teritori.nodestake.top"],
"snapshot_provider": "",
"sdk_version": "0.45.4",
"coin_type": "118",
@@ -17,4 +17,4 @@
"logo": "/logos/teritori.svg"
}
]
-}
\ No newline at end of file
+}
From 28703ec3a22b292c89b5731d2aec4f6cbd464e37 Mon Sep 17 00:00:00 2001
From: liangping <18786721@qq.com>
Date: Sat, 5 Nov 2022 17:37:34 +0800
Subject: [PATCH 10/16] add quorum
---
src/views/Dashboard.vue | 121 +++++++++++++++++++++++++++-------------
1 file changed, 83 insertions(+), 38 deletions(-)
diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue
index 5b864562..7074d269 100644
--- a/src/views/Dashboard.vue
+++ b/src/views/Dashboard.vue
@@ -132,40 +132,48 @@
>
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
+
@@ -515,6 +523,7 @@ export default {
selectedProposalId: 0,
selectedTitle: '',
operationModalType: '',
+ tallyParam: null,
totalPower: 0,
voteColors: {
YES: 'success',
@@ -574,12 +583,14 @@ export default {
})
this.$http.getGovernanceListByStatus(2).then(gov => {
- gov.proposals.forEach(p => {
+ this.proposals = gov.proposals
+ this.proposals.forEach(p => {
this.$http.getGovernanceTally(p.id, 0).then(update => {
- const p2 = p
- p2.tally = update
- this.proposals.push(p2)
- this.proposals.sort((a, b) => a.id - b.id)
+ // const p2 = p
+ // p2.tally = update
+ // this.proposals.push(p2)
+ // this.proposals.sort((a, b) => a.id - b.id)
+ this.$set(p, 'tally', update)
})
})
})
@@ -599,6 +610,10 @@ export default {
this.communityPool = this.formatToken(res.pool)
})
+ this.$http.getGovernanceParameterTallying().then(res => {
+ this.tallyParam = res
+ })
+
const conf = this.$http.getSelectedConfig()
if (conf.excludes && conf.excludes.indexOf('mint') > -1) {
this.inflation = '-'
@@ -611,6 +626,12 @@ export default {
}
},
methods: {
+ scaleWidth() {
+ if (this.tallyParam) {
+ return Number(this.tallyParam.quorum) * Number(this.tallyParam.threshold) * 100
+ }
+ return 30
+ },
selectProposal(modal, pid, title) {
this.operationModalType = modal
this.selectedProposalId = Number(pid)
@@ -773,4 +794,28 @@ export default {
.addzone :hover {
border: 2px dashed #7367F0;
}
+
+.scale {
+ width: 100%;
+ height: 3em;
+ position: relative;
+ /* margin: 30px; // */
+}
+.box {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ top: 0;
+ left: 0;
+ padding-top: 0.5em;
+ /* opacity: 0.7; */
+ background: transparent;
+}
+.overlay {
+ z-index: 9;
+ border-right-color: green;
+ border-right-width: 2px;
+ border-right-style: dotted;
+ background: transparent;
+}
From 37d0ec4aa3afac8e8ee2c57de159fbd7fb5f806e Mon Sep 17 00:00:00 2001
From: liangping <18786721@qq.com>
Date: Sun, 6 Nov 2022 17:34:47 +0800
Subject: [PATCH 11/16] remove locale for now
---
src/layouts/components/Navbar.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/layouts/components/Navbar.vue b/src/layouts/components/Navbar.vue
index 492a1b86..20b2c4ee 100644
--- a/src/layouts/components/Navbar.vue
+++ b/src/layouts/components/Navbar.vue
@@ -84,9 +84,9 @@
-
+
-
+
Date: Sun, 6 Nov 2022 17:35:44 +0800
Subject: [PATCH 12/16] improve governance
---
.../base/bootstrap-extended/_progress.scss | 25 +++
src/views/Dashboard.vue | 36 +---
src/views/Governance.vue | 5 +
src/views/GovernanceProposalView.vue | 178 +++++++++-------
.../governance/ProposalSummaryComponent.vue | 194 ++++++++++--------
5 files changed, 247 insertions(+), 191 deletions(-)
diff --git a/src/@core/scss/base/bootstrap-extended/_progress.scss b/src/@core/scss/base/bootstrap-extended/_progress.scss
index 3c2956d7..3abd8c31 100644
--- a/src/@core/scss/base/bootstrap-extended/_progress.scss
+++ b/src/@core/scss/base/bootstrap-extended/_progress.scss
@@ -22,3 +22,28 @@
.progress {
border-radius: 3px;
}
+
+
+.scale {
+ width: 100%;
+ height: 3em;
+ position: relative;
+ /* margin: 30px; // */
+}
+.box {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ top: 0;
+ left: 0;
+ padding-top: 0.5em;
+ /* opacity: 0.7; /**/
+ background: transparent;
+}
+.overlay {
+ z-index: 9;
+ width: 2px;
+ border-right-color: green;
+ border-right-width: 2px;
+ border-right-style: dotted;
+}
diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue
index 7074d269..14ac7d53 100644
--- a/src/views/Dashboard.vue
+++ b/src/views/Dashboard.vue
@@ -138,6 +138,7 @@
:max="totalPower? 100 * (totalPower/prop.tally.total) :100"
height="2rem"
show-progress
+ class="font-small-1"
>
-
+
diff --git a/src/views/Governance.vue b/src/views/Governance.vue
index 2b4b4395..3333fd8a 100644
--- a/src/views/Governance.vue
+++ b/src/views/Governance.vue
@@ -10,6 +10,7 @@
@@ -68,9 +69,13 @@ export default {
operationModalType: '',
next: '',
totalPower: 0,
+ tallyParam: null,
}
},
mounted() {
+ this.$http.getGovernanceParameterTallying().then(res => {
+ this.tallyParam = res
+ })
this.getList()
},
methods: {
diff --git a/src/views/GovernanceProposalView.vue b/src/views/GovernanceProposalView.vue
index 13acd37b..5f40b234 100644
--- a/src/views/GovernanceProposalView.vue
+++ b/src/views/GovernanceProposalView.vue
@@ -112,83 +112,94 @@
-
-
-
-
-
-
-
- {{ percent(proposal.tally.yes) }}% voted Yes
-
-
- {{ percent(proposal.tally.no) }}% voted No
-
-
- {{ percent(proposal.tally.veto) }}% voted No With Veto
-
-
- {{ percent(proposal.tally.abstain) }}% voted Abstain
-
-
-
-
- {{ formatAddress(data.item.voter) }}
-
-
-
-
-
- Load More Votes
-
-
+
+
+
+
+
+
+
+
+
+
+ {{ percent(proposal.tally.yes) }}% voted Yes
+
+
+ {{ percent(proposal.tally.no) }}% voted No
+
+
+ {{ percent(proposal.tally.veto) }}% voted No With Veto
+
+
+ {{ percent(proposal.tally.abstain) }}% voted Abstain
+
+
+
+
+
+
+
+
+ {{ formatAddress(data.item.voter) }}
+
+
+
+
+
+ Load More Votes
+
+
{
+ this.tallyParam = res
+ })
const pid = this.$route.params.proposalid
if (this.$route.query.from) {
this.from = this.$route.query.from
@@ -392,6 +407,15 @@ export default {
})
},
methods: {
+ scaleWidth(p) {
+ if (this.tallyParam) {
+ if (p.status === 2) {
+ return Number(this.tallyParam.quorum) * Number(this.tallyParam.threshold) * 100
+ }
+ return Number(this.tallyParam.threshold) * 100
+ }
+ return 50
+ },
percent: v => percent(v),
formatDate: v => dayjs(v).format('YYYY-MM-DD HH:mm'),
formatToken: v => tokenFormatter(v, {}),
diff --git a/src/views/components/governance/ProposalSummaryComponent.vue b/src/views/components/governance/ProposalSummaryComponent.vue
index 529c651c..0b568c8d 100644
--- a/src/views/components/governance/ProposalSummaryComponent.vue
+++ b/src/views/components/governance/ProposalSummaryComponent.vue
@@ -63,96 +63,105 @@
-
-
-
-
-
-
-
-
- {{ percent(p.tally.yes) }}% voted Yes
-
-
- {{ percent(p.tally.no) }}% voted No
-
-
- {{ percent(p.tally.veto) }}% voted No With Veto
-
-
- {{ percent(p.tally.abstain) }}% voted Abstain
-
-
-
-
+
+
+
+ {{ percent(p.tally.yes) }}% voted Yes
+
+
+ {{ percent(p.tally.no) }}% voted No
+
+
+ {{ percent(p.tally.veto) }}% voted No With Veto
+
+
+ {{ percent(p.tally.abstain) }}% voted Abstain
+
+
+
+
- {{ $t('btn_detail') }}
+
+ {{ $t('btn_detail') }}
+
+
+
+ {{ $t('btn_deposit') }}
-
-
- {{ $t('btn_deposit') }}
-
-
- {{ $t('btn_vote') }}
-
-
-
+
+ {{ $t('btn_vote') }}
+
+
+