+
Ping DashboardBeta
@@ -28,14 +28,14 @@ const chains = computed(()=> {
- Ping Dashboard is not just an explorer but also a wallet and more ... 🛠
+ {{ $t('index.slogan') }}
Cosmos Ecosystem Blockchains 🚀
-
+
{{ chains.length }}/{{ dashboard.length }}
diff --git a/packages/dashboard/src/plugins/i18n/locales/cn.json b/packages/dashboard/src/plugins/i18n/locales/cn.json
index a8987e5e..811b4c65 100644
--- a/packages/dashboard/src/plugins/i18n/locales/cn.json
+++ b/packages/dashboard/src/plugins/i18n/locales/cn.json
@@ -3,6 +3,11 @@
"chain": "面板首页",
"chain-test": "测试功能",
},
+ "index": {
+ "slogan": "Ping Dashboard 是一个区块链浏览器,也是一个网页钱包,还有更多 ... 🛠",
+ "search_placeholder": "搜索区块链",
+ "add_to_favorite": "加入收藏夹"
+ },
"Ecosystem": "生态系统",
"All Blockchains": "全部区块链",
"Favorite": "收藏夹"
diff --git a/packages/dashboard/src/plugins/i18n/locales/en.json b/packages/dashboard/src/plugins/i18n/locales/en.json
index c1c9d8ef..e95911cb 100644
--- a/packages/dashboard/src/plugins/i18n/locales/en.json
+++ b/packages/dashboard/src/plugins/i18n/locales/en.json
@@ -3,7 +3,13 @@
"chain": "Dashboard",
"chain-test": "test",
},
+ "index": {
+ "slogan": "Ping Dashboard is not just an explorer but also a wallet and more ... 🛠",
+ "search_placeholder": "Search Chain",
+ "add_to_favorite": "Add to favorite"
+ },
"Ecosystem": "Ecosystem",
"All Blockchains": "All Blockchain222",
"Favorite": "Favorite"
+
}
diff --git a/packages/dashboard/src/stores/useBlockchain.ts b/packages/dashboard/src/stores/useBlockchain.ts
index 4f8aa89e..4040239a 100644
--- a/packages/dashboard/src/stores/useBlockchain.ts
+++ b/packages/dashboard/src/stores/useBlockchain.ts
@@ -1,7 +1,7 @@
import { ref, computed } from "vue";
import { defineStore } from "pinia";
import { getLogo, useDashboard } from "./useDashboard";
-
+import { useTheme } from 'vuetify'
export const useBlockchain = defineStore("blockchain", () => {
const dbstore = useDashboard()
@@ -18,12 +18,22 @@ export const useBlockchain = defineStore("blockchain", () => {
const name = computed(() => {
return current.value.chain_name
})
+ const primaryColor = computed(() => {
+ const colors = ['#fff', '#fea', '#123', '#68f', '#aca', 'bbe', '#666CFF']
+ const color = colors[Math.floor(Math.random() * colors.length)]
+
+ const vuetifyTheme = useTheme()
+ const currentThemeName = vuetifyTheme.name.value
+ vuetifyTheme.themes.value[currentThemeName].colors.primary = color
+ return color
+ })
const availableEndpoint = computed(() => {
const all = current.value?.apis?.rest
if(all) {
if(!rest.value || all.findIndex(x => x.address === rest.value) < 0) {
const rn = Math.random()
- rest.value = all[Math.floor(rn * all.length)].address
+ const endpoint = all[Math.floor(rn * all.length)]
+ rest.value = endpoint?.address || ''
}
}
@@ -38,7 +48,7 @@ export const useBlockchain = defineStore("blockchain", () => {
// states
availableEndpoint,
// getters
- name, current, logo,
+ name, current, logo, primaryColor,
// actions
setRestEndpoint
};
diff --git a/packages/dashboard/src/stores/useDashboard.ts b/packages/dashboard/src/stores/useDashboard.ts
index 5c532b53..5ce71931 100644
--- a/packages/dashboard/src/stores/useDashboard.ts
+++ b/packages/dashboard/src/stores/useDashboard.ts
@@ -147,7 +147,7 @@ export const useDashboard = defineStore("dashboard", () => {
title: 'Favorite',
children: favNavItems,
badgeContent: favorite.value.length,
- badgeClass: 'bg-error',
+ badgeClass: 'bg-primary',
i18n: true,
icon: { icon: 'mdi-star', size: '22'}
},
@@ -155,7 +155,7 @@ export const useDashboard = defineStore("dashboard", () => {
title: 'All Blockchains',
to: { path : '/'},
badgeContent: length.value,
- badgeClass: 'bg-error',
+ badgeClass: 'bg-primary',
i18n: true,
icon: { icon: 'mdi-grid', size: '22'}
}