Skip to content

Commit

Permalink
Merge pull request #83 from cosmos-gaminghub/dev
Browse files Browse the repository at this point in the history
Dev > Master
  • Loading branch information
EG-easy authored Mar 1, 2022
2 parents dbc4329 + 894ba26 commit 5cc582a
Show file tree
Hide file tree
Showing 13 changed files with 212 additions and 41 deletions.
11 changes: 1 addition & 10 deletions components/elements/validator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@
<span class="title">Uptime</span>
{{ row.value }}%
</template>
<template #cell(total_missed_block)="row">
<span class="title">Total Missed Blocks</span>
{{ row.value }}
</template>
<template #cell(commission)="row">
<span class="title">Commission</span>
{{ row.value | getPercent }}
Expand Down Expand Up @@ -137,7 +133,7 @@ export default {
filteredRow () {
return this.validators.filter((row) => {
if (!this.searchValue) { return true }
if (String(row.moniker).includes(this.searchValue)) {
if (String(row.moniker).toLowerCase().includes(this.searchValue.toLowerCase())) {
return true
}
return false
Expand Down Expand Up @@ -170,11 +166,6 @@ export default {
label: 'Uptime',
sortable: true
},
{
key: 'total_missed_block',
label: 'Total Missed Blocks',
sortable: true
},
{
key: 'commission',
label: 'Commission',
Expand Down
14 changes: 7 additions & 7 deletions components/pageFooter/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
<div class="cnt">
<h4>Abouts us</h4>
<ul>
<li> <a href="https://cosmosgaminghub.com">Home Page</a></li>
<li> <a href="https://docs.cosmosgaminghub.com">Document</a></li>
<li> <a href="https://whitepaper.cosmosgaminghub.com/en">White Paper EN</a></li>
<li> <a href="https://whitepaper.cosmosgaminghub.com/ja">White Paper JA</a></li>
<li> <a href="https://whitepaper.cosmosgaminghub.com/ch">White Paper CH</a></li>
<li> <a href="https://gamenet.one">Home Page</a></li>
<li> <a href="https://docs.gamenet.one">Document</a></li>
<li> <a href="https://whitepaper.gamenet.one/en">White Paper EN</a></li>
<li> <a href="https://whitepaper.gamenet.one/ja">White Paper JA</a></li>
<li> <a href="https://whitepaper.gamenet.one/ch">White Paper CH</a></li>
</ul>
</div>
</div>
<div class="col-md-3">
<div class="cnt">
<h4>Community</h4>
<ul>
<li><a href="https://twitter.com/cosmosgaminghub">Twitter</a></li>
<li><a href="https://twitter.com/_GAME_official">Twitter</a></li>
<li> <a href="https://discord.com/invite/VfvTCP7Rm2">Discord</a></li>
<li> <a href="https://github.com/cosmos-gaminghub">Github</a></li>
<li> <a href="https://medium.com/cosmosgaminghub">Medium</a></li>
<li> <a href="https://medium.com/game">Medium</a></li>
</ul>
</div>
</div>
Expand Down
7 changes: 4 additions & 3 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module.exports = {
'~/plugins/pagination2.js',
'~/plugins/clipboard.js'
],
loading: false,

// Auto import components: https://go.nuxtjs.dev/config-components
components: false,
Expand Down Expand Up @@ -114,11 +115,11 @@ module.exports = {
},
{
id: 2,
name: 'nibiru-2000',
link: 'https://nibiru-2000.game-explorer.io/',
name: 'nibiru-3000',
link: 'https://nibiru-3000.game-explorer.io/',
logo: '/assets/images/icon/nibiru.png',
denom: 'GAME',
prefix: 'nibiru'
prefix: 'game'
},
{
id: 3,
Expand Down
103 changes: 98 additions & 5 deletions pages/validators/_address.vue
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
<div class="cos-table-title">
<div class="table-title">
<h2 class="card-title">
UPTimes (Total missed blocks: {{ validator.total_missed_block }})
Uptime
</h2>
</div>
<div class="table-total">
Expand Down Expand Up @@ -254,10 +254,61 @@
<h2 class="card-title">
Delegators
</h2>
<div class="table-total" />
</div>
<div class="table-total table-delegators">
<span class="title-total"><img src="/assets/images/icon_delegators.svg">{{ paginateDelegators.totalRecords | formatNumber }}</span>
</div>
</div>
<empty-table v-if="loaded.delegator && !delegators.length" :obj-name="'Delegators'" />
<div v-else class="cos-table-list">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover text-center table-snow-power tbl-delegator">
<thead>
<tr>
<th class="text-left">
Delegator Address
</th>
<th class="text-right">
Amount
</th>
</tr>
</thead>
<tbody v-if="loaded.delegator">
<tr v-for="delegator in filteredRowDelegator" :key="delegator.delegator_address">
<td class="text-left">
<nuxt-link class="box btn1" :to="'/account/'+delegator.delegator_address">
{{ delegator.delegator_address | formatHashBlock }}
</nuxt-link>
</td>
<td class="text-right">
<span class="title">Amount</span>
<div class="amount-power">
{{ delegator.amount | getAmount(true) }}.<small>{{ delegator.amount | getAmount(false) }}</small> {{ current_denom }}
</div>
</td>
</tr>
</tbody>
<tbody v-else>
<tr v-for="i in 5" :key="i">
<td colspan="2" class="td-skeleton">
<Skeleton />
</td>
</tr>
</tbody>
</table>
</div>
<div class="well">
<div v-if="loaded.delegator" class="pagination-wrapper">
<pagination
v-model="pagination.delegator.page"
:records="paginateDelegators.totalRecords"
:per-page="paginateDelegators.itemsPerPage"
:options="optionPaginate"
@paginate="getDelegatorWithPage"
/>
</div>
</div>
</div>
<empty-table :obj-name="'Delegators'" />
</div>
</div>
</div>
Expand Down Expand Up @@ -411,7 +462,8 @@ export default {
blocks: [],
loaded: {
blocks: false,
tx: false
tx: false,
delegator: false
},
pagination: {
blocks: {
Expand All @@ -423,6 +475,11 @@ export default {
page: 1,
totalRecords: 25,
totalPage: 5
},
delegator: {
page: 1,
totalRecords: 25,
totalPage: 5
}
},
notFound: false,
Expand All @@ -435,7 +492,7 @@ export default {
}
},
computed: {
...mapState('blocks', ['proposedBlocks', 'powerEvents', 'delegations', 'lastProposedBlocks', 'uptimes', 'paginateBlocks', 'paginateTx']),
...mapState('blocks', ['proposedBlocks', 'powerEvents', 'delegators', 'delegations', 'lastProposedBlocks', 'uptimes', 'paginateBlocks', 'paginateTx', 'paginateDelegators']),
...mapState('network', ['info', 'bondedTokens']),
...mapState('validators', ['validator', 'tokens']),
filteredRow () {
Expand All @@ -458,6 +515,16 @@ export default {
return false
})
},
filteredRowDelegator () {
return this.delegators.filter((row, index) => {
const from = (this.pagination.delegator.page - 1) * this.paginateDelegators.itemsPerPage
const to = from + this.paginateDelegators.itemsPerPage
if (index >= from && index < to) {
return true
}
return false
})
},
current_denom () {
return this.$store.state.network.current_network ? this.$store.state.network.current_network.denom : 'ATOM'
}
Expand Down Expand Up @@ -499,6 +566,7 @@ export default {
getValidator: 'validators/GET_VALIDATOR_DETAIL',
getProposedBlocks: 'blocks/GET_PROPOSED_BLOCKS',
getPowerEvents: 'blocks/GET_POWER_EVENT_QUERY',
getDelegators: 'blocks/GET_DELEGATORS_QUERY',
getDelegations: 'blocks/GET_DELEGATIONS_QUERY',
getMissedBlocks: 'blocks/GET_UPTIMES'
}),
Expand All @@ -507,6 +575,8 @@ export default {
setBlockPage: 'blocks/SET_PAGE_BLOCKS',
setEmptyProposedBlocks: 'blocks/SET_EMPTY_PROPOSED_BLOCKS',
setPowerEvents: 'blocks/SET_PAGE_POWER_EVENTS',
setDelegatorsOffset: 'blocks/SET_DELEGATOR_OFFSET',
setEmptyDelegators: 'blocks/SET_EMPTY_DELEGATORS',
setEmptyPowerEvents: 'blocks/SET_EMPTY_POWER_EVENTS',
setEmptyValidator: 'validators/SET_EMPTY_VALIDATOR'
}),
Expand All @@ -523,6 +593,15 @@ export default {
}
}
},
getDelegatorWithPage (page) {
const index = page * this.paginateDelegators.itemsPerPage
if (!this.delegators[index]) {
if (this.paginateDelegators.offset >= this.paginateDelegators.totalRecords) {
this.loaded.delegator = false
this.getDelegatorsTable()
}
}
},
getTxWithPage (page) {
const index = page * this.paginateTx.itemsPerPage
if (!this.powerEvents[index]) {
Expand Down Expand Up @@ -561,6 +640,7 @@ export default {
this.getProposedBlocksTable()
this.getPowerEventsTable()
this.getDelegatorsTable()
},
getProposedBlocksTable () {
this.getProposedBlocks({
Expand All @@ -587,10 +667,23 @@ export default {
console.log('error getPowerEvents ', error)
})
},
getDelegatorsTable () {
this.getDelegators({
offset: this.paginateDelegators.offset,
operator_address: this.$route.params.address
}).then(() => {
this.loaded.delegator = true
}).catch((error) => {
this.loaded.delegator = true
// eslint-disable-next-line no-console
console.log('error getDelegators ', error)
})
},
emptyOldData () {
this.setEmptyProposedBlocks()
this.setEmptyPowerEvents()
this.setEmptyValidator()
this.setEmptyDelegators()
},
async getKeyBaseImage (identity) {
return await new Promise((resolve, reject) => {
Expand Down
20 changes: 19 additions & 1 deletion static/assets/css/_for_element.css
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,21 @@ table.table-validators tbody tr td {
#table-validators th {
vertical-align: middle;
}

.delegated-missed .table-transactions .cos-table-title .table-total.table-delegators {
line-height: 1;
}
.delegated-missed .table-transactions .cos-table-title .table-total.table-delegators span.title-total {
display: flex ;
flex-direction: row ;
flex-wrap: wrap ;
justify-content: center ;
align-items: center ;
align-content: center ;
}
.delegated-missed .table-transactions .cos-table-title .table-total.table-delegators span.title-total img {
margin-right: 3px;
width: 15px;
}
@media (max-width: 1110px) {
.page-content.header-smaller .blocks-status {
background-color: #e3e3e3;
Expand Down Expand Up @@ -421,4 +435,8 @@ table.table-validators tbody tr td {
.page-content.page-dashboard .custom-page-title .blocks-status {
display: table;
}
.delegated-missed .table-transactions table.tbl-delegator tbody tr td:nth-child(2),
.delegated-missed .table-transactions table.tbl-delegator tbody tr td:nth-child(1){
width: 100% !important;
}
}
Loading

0 comments on commit 5cc582a

Please sign in to comment.