forked from cerc-io/cosmos-explorer
add btn disable & update description to verification page
This commit is contained in:
parent
0a0b78c14e
commit
0e61813efd
@ -5,6 +5,14 @@ import { computed, onMounted, ref } from "vue";
|
||||
|
||||
import DynamicComponent from '@/components/dynamic/DynamicComponent.vue';
|
||||
|
||||
interface Verification {
|
||||
chainId?: string;
|
||||
account?: string;
|
||||
codeId?: string;
|
||||
contract?: string;
|
||||
txHash?: string;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
contract: { type: String },
|
||||
@ -12,21 +20,21 @@ const props = defineProps({
|
||||
|
||||
const baseurl = "https://prod.compiler.welldonestudio.io"
|
||||
|
||||
const verification = ref({});
|
||||
const verification = ref<Verification>({});
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
const base = useBaseStore()
|
||||
const chainId = base.latest?.block?.header?.chain_id || "neutron-1"
|
||||
// console.log("mounted", `${baseurl}/deploy-histories/neutron?contract=${props.contract}`, chainId.value)
|
||||
const url = `${baseurl}/deploy-histories/${chainId}?contract=${props.contract}`
|
||||
console.log("url:", url)
|
||||
get(url).then((x) => {
|
||||
console.log("verification:", x)
|
||||
verification.value = x
|
||||
}).catch(e => {
|
||||
console.error(e)
|
||||
})
|
||||
const base = useBaseStore()
|
||||
const chainId = base.latest?.block?.header?.chain_id || "neutron-1"
|
||||
// console.log("mounted", `${baseurl}/deploy-histories/neutron?contract=${props.contract}`, chainId.value)
|
||||
const url = `${baseurl}/deploy-histories/${chainId}?contract=${props.contract}`
|
||||
console.log("url:", url)
|
||||
get(url).then((x) => {
|
||||
console.log("verification:", x)
|
||||
verification.value = x
|
||||
}).catch(e => {
|
||||
console.error(e)
|
||||
})
|
||||
})
|
||||
|
||||
function verify() {
|
||||
@ -39,23 +47,45 @@ function verify() {
|
||||
if(x.result) verification.value = x.result
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div class="bg-base-100 px-4 pt-3 pb-4 rounded mb-4 shadow">
|
||||
<div class="flex justify-between">
|
||||
<span><h2 class="card-title truncate w-full mt-4 text-left">Verification</h2></span>
|
||||
<span class="avatar tooltip tooltip-left" data-tip="Powered By welldonestudio">
|
||||
<span class="avatar tooltip tooltip-left" data-tip="Powered By WELLDONE Studio">
|
||||
<div class="w-8 rounded">
|
||||
<img src="../assets/images/welldone-logo.svg" alt="Powered By welldonestudio"/>
|
||||
<img src="../assets/images/welldone-logo.svg" alt="Powered By WELLDONE Studio"/>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
<!-- alert-info -->
|
||||
<div
|
||||
class="text-[#00cfe8] bg-[rgba(0,207,232,0.12)] rounded shadow mt-4 alert-info"
|
||||
>
|
||||
<div
|
||||
class="drop-shadow-md px-4 pt-2 pb-2"
|
||||
style="box-shadow: rgba(0, 207, 232, 0.4) 0px 6px 15px -7px"
|
||||
>
|
||||
<h2 class="text-base font-semibold">{{ $t('consensus.tips') }}</h2>
|
||||
</div>
|
||||
<div class="px-4 py-4">
|
||||
<ul style="list-style-type: disc" class="pl-8">
|
||||
<li>
|
||||
{{ $t('cosmwasm.tips_description_1') }}
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://docs.welldonestudio.io/code/verification-api/" target="_blank">Link to Verification API Manual</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div><DynamicComponent :value="verification"/></div>
|
||||
<div class="text-center">
|
||||
<div v-if="Object.keys(verification).length == 0" >
|
||||
<Icon icon="mdi:emoticon-sad-outline"></Icon>Haven't found verification
|
||||
</div>
|
||||
<button class="btn btn-primary mt-5" @click="verify">verify</button>
|
||||
<button class="btn btn-primary mt-5" @click="verify" :disabled="verification.error !== undefined">verify</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
@ -119,7 +119,8 @@
|
||||
"contract_balances": "合约余额",
|
||||
"no_escrowed_assets": "没有托管地址",
|
||||
"contract_states": "合约状态",
|
||||
"query_contract": "查询合约"
|
||||
"query_contract": "查询合约",
|
||||
"tips_description_1": "This feature is available when deploying contracts via WELLDONE Code. For more information, please check the document at the link below."
|
||||
},
|
||||
"gov": {
|
||||
"voting": "投票中",
|
||||
|
@ -127,7 +127,8 @@
|
||||
"contract_balances": "Contract Balances",
|
||||
"no_escrowed_assets": "No Escrowed Assets",
|
||||
"contract_states": "Contract States",
|
||||
"query_contract": "Query Contract"
|
||||
"query_contract": "Query Contract",
|
||||
"tips_description_1": "This feature is available when deploying contracts via WELLDONE Code. For more information, please check the document at the link below."
|
||||
},
|
||||
"gov": {
|
||||
"voting": "Voting",
|
||||
|
@ -118,7 +118,8 @@
|
||||
"contract_balances": "Saldo Kontrak",
|
||||
"no_escrowed_assets": "Tidak Ada Aset yang Dititipkan",
|
||||
"contract_states": "Bagian Kontrak",
|
||||
"query_contract": "Query Kontrak"
|
||||
"query_contract": "Query Kontrak",
|
||||
"tips_description_1": "This feature is available when deploying contracts via WELLDONE Code. For more information, please check the document at the link below."
|
||||
},
|
||||
"gov": {
|
||||
"voting": "Voting",
|
||||
|
Loading…
Reference in New Issue
Block a user