import {
- BRow, BCol, VBTooltip, BFormInput, BCard, BAlert, BFormCheckbox, BButton,
+ BRow, BCol, VBTooltip, BFormInput, BCard, BAlert, BFormCheckbox, BButton, BBadge, BInputGroup, BInputGroupPrepend,
} from 'bootstrap-vue'
import {
consensusPubkeyToHexAddress, getCachedValidators, timeIn, toDay,
} from '@/libs/utils'
+import { Bech32, toHex } from '@cosmjs/encoding'
export default {
components: {
@@ -77,7 +111,10 @@ export default {
BCard,
BAlert,
BButton,
+ BBadge,
BFormCheckbox,
+ BInputGroup,
+ BInputGroupPrepend,
},
directives: {
'b-tooltip': VBTooltip,
@@ -86,6 +123,7 @@ export default {
const { chain } = this.$route.params
const pinned = localStorage.getItem('pinned') ? localStorage.getItem('pinned').split(',') : ''
return {
+ missedFilter: false,
pinned,
chain,
query: '',
@@ -100,10 +138,14 @@ export default {
uptime() {
const vals = this.query ? this.validators.filter(x => String(x.description.moniker).indexOf(this.query) > -1) : this.validators
vals.sort((a, b) => b.delegator_shares - a.delegator_shares)
- return vals.map(x => ({
+ const rets = vals.map(x => ({
validator: x.description,
address: consensusPubkeyToHexAddress(x.consensus_pubkey),
}))
+ if (this.missedFilter) {
+ return rets.filter(x => this.missing[x.address].missed_blocks_counter > 0)
+ }
+ return rets
},
},
created() {
@@ -115,6 +157,16 @@ export default {
this.$http.getValidatorList().then(res => {
this.validators = res
})
+ this.$http.getSlashingSigningInfo().then(res => {
+ if (res.info) {
+ res.info.forEach(x => {
+ if (x.address) {
+ const hex = toHex(Bech32.decode(x.address).data).toUpperCase()
+ this.missing[hex] = x
+ }
+ })
+ }
+ })
this.initBlocks()
},
beforeDestroy() {
diff --git a/src/views/UptimeMyChainBlocks.vue b/src/views/UptimeMyChainBlocks.vue
index 8d9ff33b..7abcb12d 100644
--- a/src/views/UptimeMyChainBlocks.vue
+++ b/src/views/UptimeMyChainBlocks.vue
@@ -23,14 +23,37 @@
sm="12"
class="text-truncate"
>
-
- {{ x.validator.moniker }}
-
+
+
+ {{ x.validator.moniker }}
+
+
+
+ {{ missing[x.address].missed_blocks_counter }}
+
+
+ 0
+
+
+
import {
- BRow, BCol, VBTooltip, BCard, BAlert, BCardTitle, BFormCheckbox,
+ BRow, BCol, VBTooltip, BCard, BAlert, BCardTitle, BFormCheckbox, BBadge,
} from 'bootstrap-vue'
import {
getLocalChains, timeIn, toDay,
} from '@/libs/utils'
+import { Bech32, toHex } from '@cosmjs/encoding'
export default {
name: 'Blocks',
components: {
+ BBadge,
BRow,
BCol,
BCard,
@@ -105,6 +130,16 @@ export default {
},
created() {
this.initBlocks()
+ this.$http.getSlashingSigningInfo(this.config).then(res => {
+ if (res.info) {
+ res.info.forEach(x => {
+ if (x.address) {
+ const hex = toHex(Bech32.decode(x.address).data).toUpperCase()
+ this.missing[hex] = x
+ }
+ })
+ }
+ })
},
beforeDestroy() {
this.blocks = [] // clear running tasks if it is not finish
diff --git a/src/views/UptimeMyValidators.vue b/src/views/UptimeMyValidators.vue
index ddab0d7b..6fc98379 100644
--- a/src/views/UptimeMyValidators.vue
+++ b/src/views/UptimeMyValidators.vue
@@ -1,6 +1,6 @@
-
+
+
+
+ Note
+
+
+ There are two ways to monitor your validators:
+
Pin a validator on Uptime pages.
+
Specify parameters like following: https://ping.pub/cosmos/uptime/my?validators={"sifchain":["FBADE9A30473BB9ED6DFA16BFB3838E028F33650"],"chain_name":["hexAddress"]}
+
+