feat: validator

This commit is contained in:
Alisa | Side.one 2023-05-15 09:56:33 +08:00
parent ccf0d755df
commit 8e8a3614c1

View File

@ -136,7 +136,7 @@ onMounted(() => {
<template> <template>
<div> <div>
<div class="bg-base-100 px-4 pt-3 pb-4 rounded shadow border-indigo-500"> <div class="bg-base-100 px-4 pt-3 pb-4 rounded shadow border-indigo-500">
<div class="flex flex-col lg:flex-row"> <div class="flex flex-col lg:flex-row pt-2 pb-1">
<div class="flex-1"> <div class="flex-1">
<div class="flex"> <div class="flex">
<div class="avatar mr-4 relative w-24 rounded-lg overflow-hidden"> <div class="avatar mr-4 relative w-24 rounded-lg overflow-hidden">
@ -158,7 +158,7 @@ onMounted(() => {
</div> </div>
<div class="mx-2"> <div class="mx-2">
<h4>{{ v.description?.moniker }}</h4> <h4>{{ v.description?.moniker }}</h4>
<div class="text-sm mb-2"> <div class="text-sm mb-4">
{{ v.description?.identity || '-' }} {{ v.description?.identity || '-' }}
</div> </div>
<label <label
@ -174,41 +174,46 @@ onMounted(() => {
</div> </div>
</div> </div>
<div class="m-4 text-sm"> <div class="m-4 text-sm">
<p class="text-md">About Us</p> <p class="text-sm mb-3">About Us</p>
<VList class="card-list"> <div class="card-list">
<VListItem prepend-icon="mdi-web"> <div class="flex items-center mb-2">
<span>Website: </span <Icon icon="mdi-web" class="text-xl mr-1" />
><span> {{ v.description?.website || '-' }}</span> <span>Website: </span>
</VListItem> <span> {{ v.description?.website || '-' }}</span>
<VListItem prepend-icon="mdi-email-outline"> </div>
<span>Contact: </span <div class="flex items-center">
><span> {{ v.description?.security_contact }}</span> <Icon icon="mdi-email-outline" class="text-xl mr-1" />
</VListItem> <span>Contact: </span>
</VList> <span> {{ v.description?.security_contact }}</span>
<p class="text-md mt-3">Validator Status</p> </div>
<VList class="card-list"> </div>
<VListItem prepend-icon="mdi-shield-account-outline"> <p class="text-sm mt-4 mb-3">Validator Status</p>
<div class="card-list">
<div class="flex items-center mb-2">
<Icon icon="mdi-shield-account-outline" class="text-xl mr-1" />
<span>Status: </span <span>Status: </span
><span> ><span>
{{ String(v.status).replace('BOND_STATUS_', '') }} {{ String(v.status).replace('BOND_STATUS_', '') }}
</span> </span>
</VListItem> </div>
<VListItem prepend-icon="mdi-shield-alert-outline"> <div class="flex items-center">
<span>Jailed: </span><span> {{ v.jailed || '-' }} </span> <Icon icon="mdi-shield-alert-outline" class="text-xl mr-1" />
</VListItem> <span>Jailed: </span>
</VList> <span> {{ v.jailed || '-' }} </span>
</div>
</div>
</div> </div>
</div> </div>
<div class="flex-1"> <div class="flex-1">
<div class="d-flex flex-column py-3 justify-space-between"> <div class="flex flex-col justify-between">
<div class="d-flex"> <div class="flex mb-2">
<VAvatar <div
color="secondary" class="flex items-center justify-center rounded w-10 h-10"
rounded style="border: 1px solid #666"
variant="outlined" >
icon="mdi-coin" <Icon icon="mdi-coin" class="text-3xl" />
></VAvatar> </div>
<div class="ml-3 d-flex flex-column justify-center"> <div class="ml-3 flex flex-col justify-center">
<h4> <h4>
{{ {{
format.formatToken2({ format.formatToken2({
@ -220,14 +225,14 @@ onMounted(() => {
<span class="text-sm">Total Bonded Tokens</span> <span class="text-sm">Total Bonded Tokens</span>
</div> </div>
</div> </div>
<div class="d-flex"> <div class="flex mb-2">
<VAvatar <div
color="secondary" class="flex items-center justify-center rounded w-10 h-10"
rounded style="border: 1px solid #666"
variant="outlined" >
icon="mdi-percent" <Icon icon="mdi-percent" class="text-3xl" />
></VAvatar> </div>
<div class="ml-3 d-flex flex-column justify-center"> <div class="ml-3 flex flex-col justify-center">
<h4> <h4>
{{ format.formatToken(selfBonded.balance) }} ({{ selfRate }}) {{ format.formatToken(selfBonded.balance) }} ({{ selfRate }})
</h4> </h4>
@ -235,13 +240,14 @@ onMounted(() => {
</div> </div>
</div> </div>
<div class="d-flex"> <div class="flex mb-2">
<VAvatar <div
color="secondary" class="flex items-center justify-center rounded w-10 h-10"
rounded style="border: 1px solid #666"
variant="outlined" >
icon="mdi-account-tie" <Icon icon="mdi-account-tie" class="text-3xl" />
></VAvatar> </div>
<div class="ml-3 d-flex flex-column justify-center"> <div class="ml-3 d-flex flex-column justify-center">
<h4> <h4>
{{ v.min_self_delegation }} {{ staking.params.bond_denom }} {{ v.min_self_delegation }} {{ staking.params.bond_denom }}
@ -249,40 +255,40 @@ onMounted(() => {
<span class="text-sm">Min Self Delegation:</span> <span class="text-sm">Min Self Delegation:</span>
</div> </div>
</div> </div>
<div class="d-flex"> <div class="flex mb-2">
<VAvatar <div
color="secondary" class="flex items-center justify-center rounded w-10 h-10"
rounded style="border: 1px solid #666"
variant="outlined" >
icon="mdi-finance" <Icon icon="mdi-finance" class="text-3xl" />
></VAvatar> </div>
<div class="ml-3 d-flex flex-column justify-center"> <div class="ml-3 flex flex-col justify-center">
<h4>{{ apr }}</h4> <h4>{{ apr }}</h4>
<span class="text-sm">Annual Profit</span> <span class="text-sm">Annual Profit</span>
</div> </div>
</div> </div>
<div class="d-flex"> <div class="flex mb-2">
<VAvatar <div
color="secondary" class="flex items-center justify-center rounded w-10 h-10"
rounded style="border: 1px solid #666"
variant="outlined" >
icon="mdi-stairs-up" <Icon icon="mdi-stairs-up" class="text-3xl" />
></VAvatar> </div>
<div class="ml-3 d-flex flex-column justify-center"> <div class="ml-3 flex flex-col justify-center">
<h4>{{ v.unbonding_height }}</h4> <h4>{{ v.unbonding_height }}</h4>
<span class="text-sm">Unbonding Height</span> <span class="text-sm">Unbonding Height</span>
</div> </div>
</div> </div>
<div class="d-flex"> <div class="flex mb-2">
<VAvatar <div
color="secondary" class="flex items-center justify-center rounded w-10 h-10"
rounded style="border: 1px solid #666"
variant="outlined" >
icon="mdi-clock" <Icon icon="mdi-clock" class="text-3xl" />
></VAvatar> </div>
<div class="ml-3 d-flex flex-column justify-center"> <div class="ml-3 flex flex-col justify-center">
<h4>{{ format.toDay(v.unbonding_time, 'from') }}</h4> <h4>{{ format.toDay(v.unbonding_time, 'from') }}</h4>
<span class="text-sm">Unbonding Time</span> <span class="text-sm">Unbonding Time</span>
</div> </div>
@ -290,8 +296,7 @@ onMounted(() => {
</div> </div>
</div> </div>
</div> </div>
<div class="divider"></div> <div class="text-sm px-4 pt-3 border-t">{{ v.description?.details }}</div>
<div class="text-sm px-4">{{ v.description?.details }}</div>
</div> </div>
<div class="mt-3 grid grid-cols-1 md:grid-cols-3 gap-4"> <div class="mt-3 grid grid-cols-1 md:grid-cols-3 gap-4">
@ -378,7 +383,7 @@ onMounted(() => {
<div class="rounded overflow-auto"> <div class="rounded overflow-auto">
<table class="table validatore-table w-full"> <table class="table validatore-table w-full">
<thead> <thead>
<th class="text-left pl-4" style="position: relative; z-index: 2;"> <th class="text-left pl-4" style="position: relative; z-index: 2">
Height Height
</th> </th>
<th class="text-left pl-4">Hash</th> <th class="text-left pl-4">Hash</th>