show raw log

This commit is contained in:
Pham Tu 2024-01-24 11:58:22 +07:00
parent 9059d22d77
commit 8deb5aaca3
No known key found for this signature in database
GPG Key ID: 7460FD99133ADA1C
2 changed files with 21 additions and 1 deletions

View File

@ -22,6 +22,12 @@ if (props.hash) {
const messages = computed(() => {
return tx.value?.tx?.body?.messages || [];
});
const rawLog = computed(() => {
return tx.value?.txResponse?.rawLog
? JSON.parse(tx.value?.txResponse?.rawLog)
: tx.value?.txResponse?.logs || [];
});
</script>
<template>
<div>
@ -119,6 +125,18 @@ const messages = computed(() => {
<div v-if="messages.length === 0">{{ $t('tx.no_messages') }}</div>
</div>
<div v-if="rawLog" class="bg-base-100 px-4 pt-3 pb-4 rounded shadow mb-4">
<h2 class="card-title truncate mb-2">
{{ $t('account.logs') }}: ({{ rawLog.length }})
</h2>
<div v-for="(msg, i) in rawLog">
<div class="border border-slate-400 rounded-md mt-4">
<DynamicComponent :value="msg" />
</div>
</div>
<div v-if="rawLog.length === 0">{{ $t('tx.no_logs') }}</div>
</div>
<div
v-if="tx?.txResponse"
class="bg-base-100 px-4 pt-3 pb-4 rounded shadow"

View File

@ -66,6 +66,7 @@
"height": "Height",
"hash": "Hash",
"messages": "Messages",
"logs": "Logs",
"time": "Time",
"error": "Account does not exists on chain"
},
@ -249,7 +250,8 @@
"gas": "Gas",
"fee": "Fee",
"memo": "Memo",
"no_messages": "No messages"
"no_messages": "No messages",
"no_logs": "No logs"
},
"uptime": {
"overall": "Overall",