From ce9787b2f9ddc9fca8ca2a94933ce40824d6e117 Mon Sep 17 00:00:00 2001 From: alisa Date: Thu, 27 Apr 2023 23:54:24 +0800 Subject: [PATCH] feat: Parameters Application Version and Node Information --- src/components/CardParameter.vue | 3 +-- src/components/dynamic/ArrayObjectElement.vue | 12 ++++++++---- src/modules/[chain]/params/index.vue | 4 +--- src/stores/useParamsStore.ts | 2 +- yarn.lock | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/components/CardParameter.vue b/src/components/CardParameter.vue index 5be60168..97bc1907 100644 --- a/src/components/CardParameter.vue +++ b/src/components/CardParameter.vue @@ -21,8 +21,7 @@ const props = defineProps({ class="rounded-sm bg-active px-4 py-2" >
{{ item?.subtitle }}
-
{{ item?.value }}
- +
{{ Array.isArray(item?.value) ? (item?.value[0] && item?.value[0].amount)|| '-':`${Number(item?.value)}` === 'NaN' ? item?.value : Number(item?.value)}}
diff --git a/src/components/dynamic/ArrayObjectElement.vue b/src/components/dynamic/ArrayObjectElement.vue index fc76a96d..079b41a6 100644 --- a/src/components/dynamic/ArrayObjectElement.vue +++ b/src/components/dynamic/ArrayObjectElement.vue @@ -3,7 +3,7 @@ import { computed } from '@vue/reactivity'; import DynamicComponent from './DynamicComponent.vue'; const props = defineProps({ - value: { type: Array}, + value: { type: null as any }, thead: { type: Boolean, default: true @@ -22,13 +22,17 @@ const header = computed(() => { - {{ k }} + {{ item }} - - + + + +
+ +
\ No newline at end of file diff --git a/src/modules/[chain]/params/index.vue b/src/modules/[chain]/params/index.vue index e53622c4..42f9c33f 100644 --- a/src/modules/[chain]/params/index.vue +++ b/src/modules/[chain]/params/index.vue @@ -2,9 +2,7 @@ import { useParamStore } from '@/stores'; import { ref, onMounted } from 'vue' import CardParameter from '@/components/CardParameter.vue' -import TableParameter from '@/components/TableParameter.vue' import ArrayObjectElement from '@/components/dynamic/ArrayObjectElement.vue'; -import { sort } from 'semver'; const store = useParamStore() const chain = ref(store.chain) onMounted(() => { @@ -48,7 +46,7 @@ onMounted(() => { -
+
{{ store.nodeVersion?.title }}
diff --git a/src/stores/useParamsStore.ts b/src/stores/useParamsStore.ts index 05da9ba2..a59c56e6 100644 --- a/src/stores/useParamsStore.ts +++ b/src/stores/useParamsStore.ts @@ -143,7 +143,7 @@ export const useParamStore = defineStore("paramstore", { value: value })) this.nodeVersion.items = Object.entries(res.default_node_info).map(([key, value]) => ({ subtitle:key, value: value })) - console.log('handleAbciInfo', res) + console.log('handleAbciInfo', this.nodeVersion.items) }, async getBaseTendermintBlockLatest() { return await this.blockchain.rpc.getBaseBlockLatest() diff --git a/yarn.lock b/yarn.lock index 24f39f22..740fa4cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7365,7 +7365,7 @@ symbol-observable@^2.0.3: tailwindcss@^3.3.1: version "3.3.1" - resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.3.1.tgz#b6662fab6a9b704779e48d083a9fef5a81d2b81e" + resolved "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.1.tgz#b6662fab6a9b704779e48d083a9fef5a81d2b81e" integrity sha512-Vkiouc41d4CEq0ujXl6oiGFQ7bA3WEhUZdTgXAhtKxSy49OmKs8rEfQmupsfF0IGW8fv2iQkp1EVUuapCFrZ9g== dependencies: arg "^5.0.2"