forked from cerc-io/cosmos-explorer
improve gov v1
This commit is contained in:
@@ -59,7 +59,7 @@ const proposalInfo = ref();
|
||||
:to="`/${chain.chainName}/gov/${item?.proposal_id}`"
|
||||
class="text-main text-base mb-1 block hover:text-indigo-400 truncate"
|
||||
>
|
||||
{{ item?.content?.title }}
|
||||
{{ item?.content?.title || item?.title }}
|
||||
</RouterLink>
|
||||
<div
|
||||
v-if="item.content"
|
||||
@@ -144,7 +144,7 @@ const proposalInfo = ref();
|
||||
<RouterLink
|
||||
:to="`/${chain.chainName}/gov/${item?.proposal_id}`"
|
||||
class="flex-1 w-0 truncate mr-4"
|
||||
>{{ item?.content?.title }}</RouterLink
|
||||
>{{ item?.content?.title || item?.title }}</RouterLink
|
||||
>
|
||||
<label
|
||||
for="proposal-detail-modal"
|
||||
@@ -237,9 +237,9 @@ const proposalInfo = ref();
|
||||
<h3 class="font-bold text-lg">Description</h3>
|
||||
<p class="py-4">
|
||||
<Component
|
||||
v-if="proposalInfo?.content?.description"
|
||||
:is="select(proposalInfo?.content?.description, 'horizontal')"
|
||||
:value="proposalInfo?.content?.description"
|
||||
v-if="proposalInfo?.content?.description || proposalInfo?.summary"
|
||||
:is="select(proposalInfo?.content?.description || proposalInfo?.summary, 'horizontal')"
|
||||
:value="proposalInfo?.content?.description || proposalInfo?.summary"
|
||||
>
|
||||
</Component>
|
||||
</p>
|
||||
|
||||
@@ -59,6 +59,8 @@ export class CosmosRestClient extends BaseRestClient<RequestRegistry> {
|
||||
req = findApiProfileBySDKVersion(chain.versions?.cosmosSdk)
|
||||
}
|
||||
}
|
||||
console.log("====================")
|
||||
console.log(req, chain)
|
||||
return new CosmosRestClient(endpoint, req || DEFAULT)
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ export const name = 'v0.46.7'
|
||||
|
||||
function proposalAdapter(p: any): GovProposal {
|
||||
if(p) {
|
||||
if(p.messages) p.content = p.messages[0].content
|
||||
if(p.messages) p.content = p.messages[0].content || p.messages[0]
|
||||
p.proposal_id = p.id
|
||||
p.final_tally_result = {
|
||||
yes: p.final_tally_result?.yes_count,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed } from '@vue/reactivity';
|
||||
import MdEditor from 'md-editor-v3';
|
||||
import ObjectElement from '@/components/dynamic/ObjectElement.vue';
|
||||
import {
|
||||
useBaseStore,
|
||||
@@ -20,6 +21,7 @@ import Countdown from '@/components/Countdown.vue';
|
||||
import PaginationBar from '@/components/PaginationBar.vue';
|
||||
import { fromBech32, toHex } from '@cosmjs/encoding';
|
||||
|
||||
|
||||
const props = defineProps(['proposal_id', 'chain']);
|
||||
const proposal = ref({} as GovProposal);
|
||||
const format = useFormatter();
|
||||
@@ -174,7 +176,7 @@ function pageload(p: number) {
|
||||
<div class="bg-base-100 px-4 pt-3 pb-4 rounded mb-4 shadow">
|
||||
<h2 class="card-title flex flex-col md:!justify-between md:!flex-row">
|
||||
<p class="truncate w-full">
|
||||
{{ proposal_id }}. {{ proposal.content?.title }}
|
||||
{{ proposal_id }}. {{ proposal.title || proposal.content?.title }}
|
||||
</p>
|
||||
<div
|
||||
class="badge badge-ghost"
|
||||
@@ -192,6 +194,13 @@ function pageload(p: number) {
|
||||
<div class="">
|
||||
<ObjectElement :value="proposal.content" />
|
||||
</div>
|
||||
<div v-if="proposal.summary">
|
||||
<MdEditor
|
||||
:model-value="format.multiLine(proposal.summary)"
|
||||
previewOnly
|
||||
class="md-editor-recover"
|
||||
></MdEditor>
|
||||
</div>
|
||||
</div>
|
||||
<!-- grid lg:!!grid-cols-3 auto-rows-max-->
|
||||
<!-- flex-col lg:!!flex-row flex -->
|
||||
|
||||
+4
-2
@@ -21,11 +21,13 @@ export interface GovParams {
|
||||
}
|
||||
|
||||
export interface GovProposal {
|
||||
title?: string;
|
||||
summary?: string;
|
||||
proposal_id: string;
|
||||
content: {
|
||||
'@type': string;
|
||||
title: string;
|
||||
description: string;
|
||||
title?: string;
|
||||
description?: string;
|
||||
plan?: {
|
||||
height?: string | number;
|
||||
time?: string | number;
|
||||
|
||||
Reference in New Issue
Block a user