Merge pull request #363 from alisaweb3/v3-single

Parameters page
This commit is contained in:
ping
2023-04-27 17:54:07 +08:00
committed by GitHub
538 changed files with 365 additions and 23012 deletions
-12
View File
@@ -1,12 +0,0 @@
<template>
<div class="text-main text-h5 mb-4">Parameters</div>
<div class="bg-card px-4 pt-3 pb-4 rounded-sm">
<div class="text-base mb-3 text-main">Minting Parameters</div>
<div class="grid grid-cols-5 gap-4">
<div v-for="item in 10" :key="item" class="rounded-sm bg-active px-4 py-2">
<div class="text-xs mb-2 text-secondary">Blocks Per Year</div>
<div class="text-base text-main">4,360,000</div>
</div>
</div>
</div>
</template>
+3 -3
View File
@@ -19,15 +19,15 @@ onMounted(()=>{
</VTabs>
<VWindow v-model="tab" class="mt-5">
<VWindowItem value="2">
<ProposalListItem :proposals="store.proposals['2']"/>
<ProposalListItem :proposals="store?.proposals['2']"/>
</VWindowItem>
<VWindowItem value="3">
<ProposalListItem :proposals="store.proposals['3']"/>
<ProposalListItem :proposals="store?.proposals['3']"/>
</VWindowItem>
<VWindowItem value="4">
<ProposalListItem :proposals="store.proposals['4']"/>
<ProposalListItem :proposals="store?.proposals['4']"/>
</VWindowItem>
</VWindow>
</div>
+1 -3
View File
@@ -25,9 +25,7 @@ const format = useFormatter();
const ticker = computed(() => store.coinInfo.tickers[store.tickerIndex]);
blockchain.$subscribe((m, s) => {
console.log('index:', m);
if (!Array.isArray(m.events) && ['chainName', 'endpoint'].includes(m.events.key)) {
console.log(m.events.key);
store.loadDashboard();
}
});
@@ -154,7 +152,7 @@ function shortName(name: string, id: string) {
<VCardTitle>Active Proposals</VCardTitle>
</VCardItem>
<VCardItem>
<ProposalListItem :proposals="store.proposals" />
<ProposalListItem :proposals="store?.proposals" />
</VCardItem>
<VCardText v-if="store.proposals.length === 0">No active proposals</VCardText>
</VCard>
-1
View File
@@ -176,7 +176,6 @@ export const useIndexModule = defineStore('module-index', {
},
actions: {
async loadDashboard() {
console.log('initial dashboard')
this.$reset()
this.initCoingecko()
useMintStore().fetchInflation()
+50
View File
@@ -0,0 +1,50 @@
<script lang="ts" setup>
import { useParamStore } from '@/stores';
import { ref, onMounted } from 'vue'
import CardParameter from '@/components/CardParameter.vue'
import TableParameter from '@/components/TableParameter.vue'
import { sort } from 'semver';
const store = useParamStore()
const chain = ref(store.chain)
onMounted(() => {
// fetch the data
store.initial()
})
</script>
<template>
<div>
<!-- Chain ID -->
<div class="bg-card px-4 pt-3 pb-4 rounded-sm">
<div class="text-base mb-3 text-main">{{ chain.title }}</div>
<div class="grid grid-cols-5 gap-4">
<div v-for="(item,index) of chain.items" :key="index" class="rounded-sm bg-active px-4 py-2">
<div class="text-xs mb-2 text-secondary">{{ item.subtitle }}</div>
<div class="text-base text-main">{{ item.value }}</div>
</div>
</div>
</div>
<!-- minting Parameters -->
<CardParameter :cardItem="store.mint"/>
<!-- Staking Parameters -->
<CardParameter :cardItem="store.staking"/>
<!-- Governance Parameters -->
<CardParameter :cardItem="store.gov"/>
<!-- Distribution Parameters -->
<CardParameter :cardItem="store.distribution"/>
<!-- Slashing Parameters -->
<CardParameter :cardItem="store.slashing"/>
<!-- Application Version -->
<TableParameter :tableItem="store.appVersion"/>
<!-- Node Information -->
<TableParameter :tableItem="store.nodeVersion"/>
</div>
</template>
<route>
{
meta: {
i18n: 'parameters'
}
}
</route>