forked from cerc-io/cosmos-explorer
remove spam proposals
This commit is contained in:
parent
ed28061db0
commit
004bde2b1a
@ -1,5 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<b-button-group class="mb-2">
|
||||||
|
<b-button
|
||||||
|
v-for="(t,i) in types"
|
||||||
|
:key="t"
|
||||||
|
:variant="i===type? 'secondary': 'outline-secondary'"
|
||||||
|
@click="switchStatus(i)"
|
||||||
|
>{{ t }}</b-button>
|
||||||
|
</b-button-group>
|
||||||
<b-row class="match-height">
|
<b-row class="match-height">
|
||||||
<b-col
|
<b-col
|
||||||
v-for="p in proposals"
|
v-for="p in proposals"
|
||||||
@ -36,7 +44,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
BCardTitle, BCardFooter, BButton, BProgressBar, BProgress, BBadge, BTooltip, BRow, BCol, VBModal,
|
BCardTitle, BCardFooter, BButton, BProgressBar, BProgress, BBadge, BTooltip, BRow, BCol, VBModal, BButtonGroup,
|
||||||
} from 'bootstrap-vue'
|
} from 'bootstrap-vue'
|
||||||
import Ripple from 'vue-ripple-directive'
|
import Ripple from 'vue-ripple-directive'
|
||||||
import OperationModal from '@/views/components/OperationModal/index.vue'
|
import OperationModal from '@/views/components/OperationModal/index.vue'
|
||||||
@ -45,6 +53,7 @@ import ProposalSummaryComponent from './components/governance/ProposalSummaryCom
|
|||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
BButton,
|
BButton,
|
||||||
|
BButtonGroup,
|
||||||
BCardFooter,
|
BCardFooter,
|
||||||
BProgressBar,
|
BProgressBar,
|
||||||
BProgress,
|
BProgress,
|
||||||
@ -70,6 +79,12 @@ export default {
|
|||||||
next: '',
|
next: '',
|
||||||
totalPower: 0,
|
totalPower: 0,
|
||||||
tallyParam: null,
|
tallyParam: null,
|
||||||
|
type: '2',
|
||||||
|
types: {
|
||||||
|
2: 'Voting',
|
||||||
|
3: 'Passed',
|
||||||
|
4: 'Rejected',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -79,9 +94,16 @@ export default {
|
|||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
switchStatus(s) {
|
||||||
|
if (!this.loading) {
|
||||||
|
this.proposals = []
|
||||||
|
this.type = s
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
},
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.$http.getGovernanceList(this.next).then(res => {
|
this.$http.getGovernanceListByStatus(this.type).then(res => {
|
||||||
this.proposals = this.proposals.concat(res.proposals)
|
this.proposals = this.proposals.concat(res.proposals)
|
||||||
this.updateTally(this.proposals)
|
this.updateTally(this.proposals)
|
||||||
this.next = res.pagination.next_key
|
this.next = res.pagination.next_key
|
||||||
|
Loading…
Reference in New Issue
Block a user