i18n: update add en src/modules/[chain]/block/

Author: Salman Wahib <hello@sxlmnwb.xyz>
Co-authored-by: liangping <18786721@qq.com>
This commit is contained in:
Salman Wahib 2023-06-21 00:04:29 +07:00
parent 4257406286
commit 5b4d4718c2
3 changed files with 33 additions and 18 deletions

View File

@ -66,36 +66,36 @@ onBeforeRouteUpdate(async (to, from, next) => {
<div v-if="remainingBlocks > 0"> <div v-if="remainingBlocks > 0">
<div class="text-primary font-bold text-lg my-10">#{{ target }}</div> <div class="text-primary font-bold text-lg my-10">#{{ target }}</div>
<Countdown :time="estimateTime" css="md:!text-5xl font-sans md:mx-5" /> <Countdown :time="estimateTime" css="md:!text-5xl font-sans md:mx-5" />
<div class="my-5">Estimated Time: <span class="text-xl font-bold">{{ format.toLocaleDate(estimateDate) }}</span> <div class="my-5">{{ $t('block.estimated_time') }}: <span class="text-xl font-bold">{{ format.toLocaleDate(estimateDate) }}</span>
</div> </div>
<div class="pt-10 flex justify-center"> <div class="pt-10 flex justify-center">
<table class="table w-max rounded-lg bg-base-100"> <table class="table w-max rounded-lg bg-base-100">
<tbody> <tbody>
<tr class="hover cursor-pointer" @click="edit = !edit"> <tr class="hover cursor-pointer" @click="edit = !edit">
<td>Countdown For Block:</td> <td>{{ $t('block.countdown_for_block') }}:</td>
<td class="text-right"><span class="md:!ml-40">{{ target }}</span></td> <td class="text-right"><span class="md:!ml-40">{{ target }}</span></td>
</tr> </tr>
<tr v-if="edit"> <tr v-if="edit">
<td colspan="2" class="text-center"> <td colspan="2" class="text-center">
<h3 class="text-lg font-bold">Input A New Target Block Number</h3> <h3 class="text-lg font-bold">{{ $t('block.countdown_for_block_input') }}</h3>
<p class="py-4"> <p class="py-4">
<div class="join"> <div class="join">
<input class="input input-bordered join-item" v-model="newHeight" type="number" /> <input class="input input-bordered join-item" v-model="newHeight" type="number" />
<button class="btn btn-primary join-item" @click="updateTarget()">Update</button> <button class="btn btn-primary join-item" @click="updateTarget()">{{ $t('block.btn_update') }}</button>
</div> </div>
</p> </p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Current Height:</td> <td>{{ $t('block.current_height') }}:</td>
<td class="text-right">#{{ store.latest?.block?.header.height }}</td> <td class="text-right">#{{ store.latest?.block?.header.height }}</td>
</tr> </tr>
<tr> <tr>
<td>Remaining Blocks:</td> <td>{{ $t('block.remaining_blocks') }}:</td>
<td class="text-right">{{ remainingBlocks }}</td> <td class="text-right">{{ remainingBlocks }}</td>
</tr> </tr>
<tr> <tr>
<td>Average Block Time:</td> <td>{{ $t('block.average_block_time') }}:</td>
<td class="text-right">{{ (store.blocktime / 1000).toFixed(1) }}s</td> <td class="text-right">{{ (store.blocktime / 1000).toFixed(1) }}s</td>
</tr> </tr>
</tbody> </tbody>
@ -125,17 +125,17 @@ onBeforeRouteUpdate(async (to, from, next) => {
</div> </div>
<div class="bg-base-100 px-4 pt-3 pb-4 rounded mb-4 shadow"> <div class="bg-base-100 px-4 pt-3 pb-4 rounded mb-4 shadow">
<h2 class="card-title flex flex-row justify-between">Block Header</h2> <h2 class="card-title flex flex-row justify-between">{{ $t('block.block_header') }}</h2>
<DynamicComponent :value="current.block?.header" /> <DynamicComponent :value="current.block?.header" />
</div> </div>
<div class="bg-base-100 px-4 pt-3 pb-4 rounded mb-4 shadow"> <div class="bg-base-100 px-4 pt-3 pb-4 rounded mb-4 shadow">
<h2 class="card-title flex flex-row justify-between">Transactions</h2> <h2 class="card-title flex flex-row justify-between">{{ $t('account.transactions') }}</h2>
<TxsElement :value="current.block?.data?.txs" /> <TxsElement :value="current.block?.data?.txs" />
</div> </div>
<div class="bg-base-100 px-4 pt-3 pb-4 rounded shadow"> <div class="bg-base-100 px-4 pt-3 pb-4 rounded shadow">
<h2 class="card-title flex flex-row justify-between">Last Commit</h2> <h2 class="card-title flex flex-row justify-between">{{ $t('block.last_commit') }}</h2>
<DynamicComponent :value="current.block?.last_commit" /> <DynamicComponent :value="current.block?.last_commit" />
</div> </div>
</div> </div>

View File

@ -19,12 +19,12 @@ const list = computed(() => {
<div> <div>
<div class="tabs tabs-boxed bg-transparent mb-4"> <div class="tabs tabs-boxed bg-transparent mb-4">
<a class="tab text-gray-400 uppercase" :class="{ 'tab-active': tab === 'blocks' }" <a class="tab text-gray-400 uppercase" :class="{ 'tab-active': tab === 'blocks' }"
@click="tab = 'blocks'">Recent</a> @click="tab = 'blocks'">{{ $t('block.recent') }}</a>
<RouterLink class="tab text-gray-400 uppercase" <RouterLink class="tab text-gray-400 uppercase"
:to="`/${chain}/block/${Number(base.latest?.block?.header.height||0) + 10000}`" :to="`/${chain}/block/${Number(base.latest?.block?.header.height||0) + 10000}`"
>Future</RouterLink> >{{ $t('block.future') }}</RouterLink>
<a class="tab text-gray-400 uppercase" :class="{ 'tab-active': tab === 'transactions' }" <a class="tab text-gray-400 uppercase" :class="{ 'tab-active': tab === 'transactions' }"
@click="tab = 'transactions'">Transactions</a> @click="tab = 'transactions'">{{ $t('account.transactions') }}</a>
</div> </div>
<div v-show="tab === 'blocks'" class="grid xl:!grid-cols-6 md:!grid-cols-4 grid-cols-1 gap-3"> <div v-show="tab === 'blocks'" class="grid xl:!grid-cols-6 md:!grid-cols-4 grid-cols-1 gap-3">
@ -53,10 +53,10 @@ const list = computed(() => {
<table class="table w-full table-compact"> <table class="table w-full table-compact">
<thead class="bg-base-200"> <thead class="bg-base-200">
<tr> <tr>
<th style="position: relative; z-index: 2;">Height</th> <th style="position: relative; z-index: 2;">{{ $t('account.height') }}</th>
<th style="position: relative; z-index: 2;">Hash</th> <th style="position: relative; z-index: 2;">{{ $t('account.hash') }}</th>
<th>Messages</th> <th>{{ $t('account.messages') }}</th>
<th>Fees</th> <th>{{ $t('block.fees') }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -83,7 +83,7 @@ const list = computed(() => {
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path> d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg> </svg>
<span>Only show txs in recent blocks</span> <span>{{ $t('block.only_tx') }}</span>
</div> </div>
</div> </div>
</div> </div>

View File

@ -64,5 +64,20 @@
"messages": "Messages", "messages": "Messages",
"time": "Time", "time": "Time",
"error": "Account does not exists on chain" "error": "Account does not exists on chain"
},
"block": {
"estimated_time": "Estimated Time",
"countdown_for_block": "Countdown For Block",
"countdown_for_block_input": "Input A New Target Block Number",
"btn_update": "Update",
"current_height": "Current Height",
"remaining_blocks": "Remaining Blocks",
"average_block_time": "Average Block Time",
"block_header": "Block Header",
"last_commit": "Last Commit",
"recent": "Recent",
"future": "Future",
"fees": "Fees",
"only_tx": "Only show txs in recent blocks"
} }
} }