forked from cerc-io/cosmos-explorer
add frequency
This commit is contained in:
parent
af061b553d
commit
c4cf50b4ca
@ -118,8 +118,33 @@
|
|||||||
<h4>#{{ height }}</h4>
|
<h4>#{{ height }}</h4>
|
||||||
</b-col>
|
</b-col>
|
||||||
<b-col
|
<b-col
|
||||||
|
md="3"
|
||||||
sm="12"
|
sm="12"
|
||||||
md="9"
|
>
|
||||||
|
<b-input-group
|
||||||
|
prepend="Fetch Frequency"
|
||||||
|
>
|
||||||
|
<b-form-select
|
||||||
|
id="frequency"
|
||||||
|
v-model="frequency"
|
||||||
|
placeholder="Frequency to fetch data"
|
||||||
|
@change="onFrequencyChange()"
|
||||||
|
>
|
||||||
|
<b-form-select-option value="6000">
|
||||||
|
6s
|
||||||
|
</b-form-select-option>
|
||||||
|
<b-form-select-option value="2000">
|
||||||
|
2s
|
||||||
|
</b-form-select-option>
|
||||||
|
<b-form-select-option value="1000">
|
||||||
|
1s
|
||||||
|
</b-form-select-option>
|
||||||
|
</b-form-select>
|
||||||
|
</b-input-group>
|
||||||
|
</b-col>
|
||||||
|
<b-col
|
||||||
|
sm="12"
|
||||||
|
md="6"
|
||||||
>
|
>
|
||||||
<b-input-group
|
<b-input-group
|
||||||
prepend="Qty of absent validators"
|
prepend="Qty of absent validators"
|
||||||
@ -144,7 +169,12 @@
|
|||||||
class="text-truncate"
|
class="text-truncate"
|
||||||
>
|
>
|
||||||
{{ x.name }}
|
{{ x.name }}
|
||||||
<b-badge :variant="x.counter > 0 ? 'light-danger': 'light-success'">
|
<b-badge
|
||||||
|
v-if="x.proposed > 0"
|
||||||
|
v-b-tooltip.hover.v-second
|
||||||
|
:title="x.proposed > 0?`${ Number(x.counter / x.proposed * 100).toFixed(2) } %`:''"
|
||||||
|
:variant="x.counter > 0 ? 'light-danger': 'light-success'"
|
||||||
|
>
|
||||||
{{ x.counter }} / {{ x.proposed }}
|
{{ x.counter }} / {{ x.proposed }}
|
||||||
</b-badge>
|
</b-badge>
|
||||||
</b-col>
|
</b-col>
|
||||||
@ -157,7 +187,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
BSkeleton, BSkeletonWrapper, BInputGroupAppend, BTabs, BTab, BFormGroup,
|
BSkeleton, BSkeletonWrapper, BInputGroupAppend, BTabs, BTab, BFormGroup, BFormSelect, BFormSelectOption,
|
||||||
BRow, BCol, VBTooltip, BFormInput, BCard, BAlert, BFormCheckbox, BButton, BBadge, BInputGroup, BInputGroupPrepend,
|
BRow, BCol, VBTooltip, BFormInput, BCard, BAlert, BFormCheckbox, BButton, BBadge, BInputGroup, BInputGroupPrepend,
|
||||||
} from 'bootstrap-vue'
|
} from 'bootstrap-vue'
|
||||||
|
|
||||||
@ -177,6 +207,8 @@ export default {
|
|||||||
BButton,
|
BButton,
|
||||||
BBadge,
|
BBadge,
|
||||||
BFormCheckbox,
|
BFormCheckbox,
|
||||||
|
BFormSelect,
|
||||||
|
BFormSelectOption,
|
||||||
BInputGroup,
|
BInputGroup,
|
||||||
BSkeleton,
|
BSkeleton,
|
||||||
BSkeletonWrapper,
|
BSkeletonWrapper,
|
||||||
@ -208,6 +240,7 @@ export default {
|
|||||||
absentValsInBlock: {},
|
absentValsInBlock: {},
|
||||||
numOfBlock: 1000,
|
numOfBlock: 1000,
|
||||||
temp: 0,
|
temp: 0,
|
||||||
|
frequency: 6000,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -302,7 +335,7 @@ export default {
|
|||||||
blocks.push({ sigs, height })
|
blocks.push({ sigs, height })
|
||||||
this.blocks = blocks
|
this.blocks = blocks
|
||||||
|
|
||||||
this.timer = setInterval(this.fetch_latest, 6000)
|
this.timer = setInterval(this.fetch_latest, this.frequency)
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -313,6 +346,10 @@ export default {
|
|||||||
})
|
})
|
||||||
return sigs
|
return sigs
|
||||||
},
|
},
|
||||||
|
onFrequencyChange() {
|
||||||
|
clearInterval(this.timer)
|
||||||
|
this.timer = setInterval(this.fetch_latest, this.frequency)
|
||||||
|
},
|
||||||
hex2base64(v) {
|
hex2base64(v) {
|
||||||
return toBase64(fromHex(v))
|
return toBase64(fromHex(v))
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user