From 5c3118116f8b2fc13b563af1d76675db333d5002 Mon Sep 17 00:00:00 2001 From: "Alisa | Side.one" Date: Sat, 6 May 2023 22:56:04 +0800 Subject: [PATCH] feat: format code --- .idea/vcs.xml | 6 - .idea/workspace.xml | 106 --- src/App.vue | 34 +- src/components/CardParameter.vue | 22 +- src/components/CardStatisticsHorizontal.vue | 24 +- src/components/CardStatisticsVertical.vue | 8 +- src/components/CardStatisticsWithImages.vue | 27 +- src/components/Countdown.vue | 17 +- src/components/ProposalProcess.vue | 21 +- src/components/ThemeSwitcher.vue | 17 +- src/components/UptimeBar.vue | 53 +- src/components/ValidatorCommissionRate.vue | 100 ++- src/components/charts/DonutChart.vue | 16 +- src/components/charts/PriceMarketChart.vue | 41 +- src/components/charts/apexChartConfig.ts | 259 +++++--- src/components/dynamic/ArrayBytesElement.vue | 7 +- src/components/dynamic/ArrayCoinElement.vue | 13 +- src/components/dynamic/ArrayElement.vue | 25 +- src/components/dynamic/ArrayObjectElement.vue | 41 +- src/components/dynamic/DynamicComponent.vue | 9 +- src/components/dynamic/NumberElement.vue | 6 +- src/components/dynamic/ObjectElement.vue | 42 +- .../dynamic/ObjectHorizontalElement.vue | 26 +- src/components/dynamic/TextElement.vue | 27 +- src/components/dynamic/TxsElement.vue | 64 +- src/components/dynamic/UInt8Array.vue | 18 +- src/components/dynamic/index.ts | 68 +- src/components/icons/IconCommunity.vue | 7 +- src/components/icons/IconDocumentation.vue | 7 +- src/components/icons/IconEcosystem.vue | 7 +- src/components/icons/IconSupport.vue | 7 +- src/layouts/blank.vue | 13 +- src/layouts/components/Breadcrumbs.vue | 27 +- src/layouts/components/ChainProfile.vue | 105 +-- src/layouts/components/DefaultLayout.vue | 2 +- src/layouts/components/NavBarI18n.vue | 21 +- .../components/NavBarNotifications.vue | 47 +- src/layouts/components/NavbarShortcuts.vue | 2 +- .../components/NavbarThemeSwitcher.vue | 8 +- src/layouts/components/newFooter.vue | 58 +- src/libs/address.ts | 112 ++-- src/libs/api.ts | 262 ++++++-- src/libs/client.ts | 453 +++++++------ src/libs/http.ts | 39 +- src/libs/index.ts | 8 +- src/libs/misc.ts | 20 +- src/libs/registry.ts | 136 ++-- src/libs/utils.ts | 219 ++++--- src/modules/[chain]/account/[address].vue | 580 +++++++++-------- src/modules/[chain]/block/[height].vue | 33 +- src/modules/[chain]/block/block.ts | 117 ++-- src/modules/[chain]/block/index.vue | 11 +- src/modules/[chain]/cosmwasm/WasmStore.ts | 166 +++-- .../[chain]/cosmwasm/[code_id]/contracts.vue | 256 ++++---- src/modules/[chain]/cosmwasm/index.vue | 72 ++- src/modules/[chain]/cosmwasm/types.ts | 90 +-- src/modules/[chain]/gov/[proposal_id].vue | 3 - src/modules/[chain]/gov/index.vue | 8 +- src/modules/[chain]/ibc/[connection_id].vue | 220 ++++--- src/modules/[chain]/ibc/index.vue | 78 ++- src/modules/[chain]/index.vue | 76 ++- src/modules/[chain]/indexStore.ts | 428 ++++++------ src/modules/[chain]/params/index.vue | 58 +- src/modules/[chain]/staking/[validator].vue | 608 +++++++++++------- src/modules/[chain]/statesync/index.vue | 129 ++-- src/modules/[chain]/tx/[hash].vue | 135 ++-- src/modules/[chain]/uptime/index.vue | 173 +++-- src/modules/wallet/test.vue | 12 +- src/pages/[...all].vue | 45 +- src/pages/second-page.vue | 13 +- src/plugins/i18n/index.ts | 10 +- src/plugins/pinia/ClientProperties.ts | 12 +- src/stores/index.ts | 24 +- src/stores/template.ts | 18 +- src/stores/useBankStore.ts | 88 +-- src/stores/useBaseStore.ts | 127 ++-- src/stores/useCoinGecko.ts | 89 +-- src/stores/useDistributionStore.ts | 29 +- src/stores/useFormatter.ts | 372 ++++++----- src/stores/useGovStore.ts | 115 ++-- src/stores/useMintStore.ts | 49 +- src/stores/useParamsStore.ts | 423 ++++++------ src/stores/useStakingStore.ts | 154 +++-- src/stores/useWalletStore.ts | 18 +- vite.config.ts | 73 ++- 85 files changed, 4308 insertions(+), 3261 deletions(-) delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1ddf..00000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 8c765164..00000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - { - "keyToString": { - "RunOnceActivity.OpenProjectViewOnStart": "true", - "RunOnceActivity.ShowReadmeOnStart": "true", - "last_opened_file_path": "/Users/ping/workspace/dashboard" - } -} - - - $USER_HOME$/.subversion - - - - - 1678753718354 - - - - - - - - - - - \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index b7c44406..3460a20b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,26 +1,34 @@ diff --git a/src/components/dynamic/NumberElement.vue b/src/components/dynamic/NumberElement.vue index c9b45445..9bcdb11a 100644 --- a/src/components/dynamic/NumberElement.vue +++ b/src/components/dynamic/NumberElement.vue @@ -1,6 +1,6 @@ \ No newline at end of file + {{ Number(props.value) }} + diff --git a/src/components/dynamic/ObjectElement.vue b/src/components/dynamic/ObjectElement.vue index 2d92f453..48cbbf10 100644 --- a/src/components/dynamic/ObjectElement.vue +++ b/src/components/dynamic/ObjectElement.vue @@ -1,23 +1,29 @@ \ No newline at end of file +
+ + + + + + + +
{{ k }} +
+ +
+
+
+ diff --git a/src/components/dynamic/ObjectHorizontalElement.vue b/src/components/dynamic/ObjectHorizontalElement.vue index de8815da..1db000aa 100644 --- a/src/components/dynamic/ObjectHorizontalElement.vue +++ b/src/components/dynamic/ObjectHorizontalElement.vue @@ -1,17 +1,19 @@ \ No newline at end of file +
+ + {{ k }} + + + + +
+ diff --git a/src/components/dynamic/TextElement.vue b/src/components/dynamic/TextElement.vue index 8482d710..7c9f5079 100644 --- a/src/components/dynamic/TextElement.vue +++ b/src/components/dynamic/TextElement.vue @@ -2,16 +2,23 @@ import { useFormatter } from '@/stores'; import MdEditor from 'md-editor-v3'; -const props = defineProps(["value"]); -const format = useFormatter() +const props = defineProps(['value']); +const format = useFormatter(); function isMD() { - if(props.value && (props.value.indexOf("\n") > -1 || props.value.indexOf("\\n") > -1)){ - return true - } - return false + if ( + props.value && + (props.value.indexOf('\n') > -1 || props.value.indexOf('\\n') > -1) + ) { + return true; + } + return false; } - \ No newline at end of file + diff --git a/src/components/dynamic/TxsElement.vue b/src/components/dynamic/TxsElement.vue index c06c7522..2bbe6052 100644 --- a/src/components/dynamic/TxsElement.vue +++ b/src/components/dynamic/TxsElement.vue @@ -1,35 +1,51 @@ \ No newline at end of file + + + + Hash + Msgs + Memo + + + + + + {{ + item.hash + }} + + + {{ + format.messages( + item.tx.body.messages.map((x) => ({ '@type': x.typeUrl })) + ) + }} + + {{ item.tx.body.memo }} + + + +
[]
+ diff --git a/src/components/dynamic/UInt8Array.vue b/src/components/dynamic/UInt8Array.vue index 6134cf4a..6d07a2e3 100644 --- a/src/components/dynamic/UInt8Array.vue +++ b/src/components/dynamic/UInt8Array.vue @@ -2,15 +2,17 @@ import { toBase64, toHex } from '@cosmjs/encoding'; import { computed } from '@vue/reactivity'; -const props = defineProps(["value"]); -const format = ref('base64') -const text = computed(()=> { - return format.value === 'hex'? toHex(props.value) : toBase64(props.value) -}) +const props = defineProps(['value']); +const format = ref('base64'); +const text = computed(() => { + return format.value === 'hex' ? toHex(props.value) : toBase64(props.value); +}); function change() { - format.value = format.value === 'hex'? 'base64': 'hex' + format.value = format.value === 'hex' ? 'base64' : 'hex'; } \ No newline at end of file + {{ text }} + diff --git a/src/components/dynamic/index.ts b/src/components/dynamic/index.ts index cfa736ac..7053bf6f 100644 --- a/src/components/dynamic/index.ts +++ b/src/components/dynamic/index.ts @@ -1,39 +1,39 @@ -import ObjectElement from './ObjectElement.vue' -import TextElement from './TextElement.vue' -import ArrayElement from './ArrayElement.vue' -import UInt8Array from './UInt8Array.vue' -import NumberElement from './NumberElement.vue' -import TxsElement from './TxsElement.vue' -import ObjectHorizontalElement from './ObjectHorizontalElement.vue' -import Long from 'long' +import ObjectElement from './ObjectElement.vue'; +import TextElement from './TextElement.vue'; +import ArrayElement from './ArrayElement.vue'; +import UInt8Array from './UInt8Array.vue'; +import NumberElement from './NumberElement.vue'; +import TxsElement from './TxsElement.vue'; +import ObjectHorizontalElement from './ObjectHorizontalElement.vue'; +import Long from 'long'; export function select(v: any, direct?: string) { - // if(k === 'txs' && v) { - // return TxsElement - // } else { - const type = typeof v - switch(type) { - case 'object': - return selectObject(v, direct) - case 'number': - return NumberElement - default: - return TextElement - } - // } + // if(k === 'txs' && v) { + // return TxsElement + // } else { + const type = typeof v; + switch (type) { + case 'object': + return selectObject(v, direct); + case 'number': + return NumberElement; + default: + return TextElement; + } + // } } function selectObject(v: Object, direct?: string) { - switch(true) { - case v instanceof Long: - return NumberElement - case v instanceof Uint8Array: - return UInt8Array - case Array.isArray(v): - return ArrayElement - case direct === 'horizontal': - return ObjectHorizontalElement - default: - return ObjectElement - } -} \ No newline at end of file + switch (true) { + case v instanceof Long: + return NumberElement; + case v instanceof Uint8Array: + return UInt8Array; + case Array.isArray(v): + return ArrayElement; + case direct === 'horizontal': + return ObjectHorizontalElement; + default: + return ObjectElement; + } +} diff --git a/src/components/icons/IconCommunity.vue b/src/components/icons/IconCommunity.vue index 2dc8b055..ea8ddefb 100644 --- a/src/components/icons/IconCommunity.vue +++ b/src/components/icons/IconCommunity.vue @@ -1,5 +1,10 @@ \ No newline at end of file + diff --git a/src/layouts/components/ChainProfile.vue b/src/layouts/components/ChainProfile.vue index e019a8c7..66b81d0e 100644 --- a/src/layouts/components/ChainProfile.vue +++ b/src/layouts/components/ChainProfile.vue @@ -1,61 +1,72 @@ + {{ + baseStore.latest.block?.header?.chain_id || chainStore.chainName || '' + }} + + {{ chainStore.connErr || chainStore.endpoint.address }} diff --git a/src/layouts/components/DefaultLayout.vue b/src/layouts/components/DefaultLayout.vue index bb128f87..c7ac8939 100644 --- a/src/layouts/components/DefaultLayout.vue +++ b/src/layouts/components/DefaultLayout.vue @@ -67,7 +67,7 @@ blockchain.$subscribe((m, s) => {