diff --git a/src/@core/layouts/layout-vertical/components/vertical-nav-menu/VerticalNavMenu.vue b/src/@core/layouts/layout-vertical/components/vertical-nav-menu/VerticalNavMenu.vue
index b7b6a1ca..7cbf8c6a 100644
--- a/src/@core/layouts/layout-vertical/components/vertical-nav-menu/VerticalNavMenu.vue
+++ b/src/@core/layouts/layout-vertical/components/vertical-nav-menu/VerticalNavMenu.vue
@@ -57,14 +57,6 @@
-
-
-
-
-
{ shallShadowBottom = evt.srcElement.scrollTop > 0 }"
>
-
@@ -156,24 +147,6 @@ export default {
appLogoImage,
}
},
- computed: {
- current() {
- const preload = []
- const { selected } = this.$store.state.chains
- const current = navMenuItems.find(x => (x.title === selected.chain_name))
- // preload.push({ header: 'current' })
- preload.push(current)
- return preload
- },
- options() {
- return navMenuItems.map(x => {
- if (x.children) {
- return { title: x.title, logo: x.icon, route: x.children[0].route }
- }
- return x
- })
- },
- },
}
diff --git a/src/@core/layouts/layout-vertical/components/vertical-nav-menu/components/vertical-nav-menu-items/VerticalNavMenuItems.vue b/src/@core/layouts/layout-vertical/components/vertical-nav-menu/components/vertical-nav-menu-items/VerticalNavMenuItems.vue
index 8a51b752..a9ac5c87 100644
--- a/src/@core/layouts/layout-vertical/components/vertical-nav-menu/components/vertical-nav-menu-items/VerticalNavMenuItems.vue
+++ b/src/@core/layouts/layout-vertical/components/vertical-nav-menu/components/vertical-nav-menu-items/VerticalNavMenuItems.vue
@@ -2,7 +2,7 @@
@@ -15,6 +15,7 @@ import { provide, ref } from '@vue/composition-api'
import VerticalNavMenuHeader from '../vertical-nav-menu-header'
import VerticalNavMenuLink from '../vertical-nav-menu-link/VerticalNavMenuLink.vue'
import VerticalNavMenuGroup from '../vertical-nav-menu-group/VerticalNavMenuGroup.vue'
+import modules from '../../../../../modules'
export default {
components: {
@@ -30,10 +31,35 @@ export default {
},
setup() {
provide('openGroups', ref([]))
-
return {
resolveNavItemComponent,
}
},
+ computed: {
+ menus() {
+ // pick current blockchain
+ const { selected } = this.$store.state.chains
+ const { excludes } = selected
+ const children = []
+ modules().forEach(m => {
+ if (excludes === undefined || excludes.indexOf(m.route) === -1) {
+ if (m.scope.match('normal') || m.scope.match(selected.chain_name)) {
+ children.push({
+ title: m.title,
+ route: { name: m.route, params: { chain: selected.chain_name } },
+ })
+ }
+ }
+ })
+ const current = {
+ title: selected.chain_name,
+ icon: selected.logo,
+ route: { name: selected.chain_name, params: { chain: selected.chain_name } },
+ }
+ current.children = children
+ // this.items.unshift(current)
+ return [{ header: 'dashboard' }, current, { header: 'ecosystem' }].concat(this.items)
+ },
+ },
}
diff --git a/src/@core/layouts/modules.js b/src/@core/layouts/modules.js
new file mode 100644
index 00000000..adda4fdc
--- /dev/null
+++ b/src/@core/layouts/modules.js
@@ -0,0 +1,48 @@
+export default () => ([
+ {
+ scope: 'normal',
+ title: 'dashboard',
+ route: 'dashboard',
+ },
+ {
+ scope: 'normal',
+ title: 'blocks',
+ route: 'blocks',
+ },
+ {
+ scope: 'normal',
+ title: 'staking',
+ route: 'staking',
+ },
+ {
+ scope: 'normal',
+ title: 'governance',
+ route: 'governance',
+ exclude: 'emoney',
+ },
+ {
+ scope: 'normal',
+ title: 'uptime',
+ route: 'uptime',
+ },
+ {
+ scope: 'normal',
+ title: 'statesync',
+ route: 'statesync',
+ },
+ {
+ scope: 'normal',
+ title: 'parameters',
+ route: 'parameters',
+ },
+ {
+ scope: 'cos-mos',
+ title: 'gravity',
+ route: 'gravity',
+ },
+ {
+ scope: 'osmosis',
+ title: 'trade',
+ route: 'osmosis-trade',
+ },
+])
diff --git a/src/@core/layouts/utils.js b/src/@core/layouts/utils.js
index e97c6b80..ec94e98b 100644
--- a/src/@core/layouts/utils.js
+++ b/src/@core/layouts/utils.js
@@ -40,6 +40,8 @@ export const resolveNavDataRouteName = link => {
* @param {Object} link nav-link object
*/
export const isNavLinkActive = link => {
+ // only select one active nav
+ if (link.route && link.route.name === 'dashboard' && link.title !== link.route.name) return false
// Matched routes array of current route
const matchedRoutes = router.currentRoute.matched
diff --git a/src/libs/utils.js b/src/libs/utils.js
index 9407dd70..012d5e1d 100644
--- a/src/libs/utils.js
+++ b/src/libs/utils.js
@@ -359,7 +359,6 @@ export function formatTokenDenom(tokenDenom) {
denom = nativeAsset.symbol
} else {
const config = Object.values(chains)
- console.log(config, localStorage.getItem('selected_chain'))
config.forEach(x => {
if (x.assets) {
const asset = x.assets.find(a => (a.base === denom))
diff --git a/src/navigation/vertical/index.js b/src/navigation/vertical/index.js
index 8a9cb207..6b31a3c4 100644
--- a/src/navigation/vertical/index.js
+++ b/src/navigation/vertical/index.js
@@ -1,72 +1,22 @@
import store from '@/store'
import { isTestnet } from '../../libs/utils'
-const modules = [
- {
- scope: 'normal',
- title: 'summary',
- route: 'info',
- },
- {
- scope: 'normal',
- title: 'blocks',
- route: 'blocks',
- },
- {
- scope: 'normal',
- title: 'staking',
- route: 'staking',
- },
- {
- scope: 'normal',
- title: 'governance',
- route: 'governance',
- exclude: 'emoney',
- },
- {
- scope: 'normal',
- title: 'uptime',
- route: 'uptime',
- },
- {
- scope: 'normal',
- title: 'statesync',
- route: 'statesync',
- },
- {
- scope: 'cos-mos',
- title: 'gravity',
- route: 'gravity',
- },
- {
- scope: 'osmosis',
- title: 'trade',
- route: 'osmosis-trade',
- },
-]
-
function processMenu() {
const chainMenus = []
+ const blockchains = []
Object.keys(store.state.chains.config).forEach(chain => {
const menu = {
title: chain,
- icon: store.state.chains.config[chain].logo,
+ logo: store.state.chains.config[chain].logo,
+ route: { name: 'dashboard', params: { chain } },
}
- const { excludes } = store.state.chains.config[chain]
- const children = []
- modules.forEach(m => {
- if (excludes === undefined || excludes.indexOf(m.route) === -1) {
- if (m.scope.match('normal') || m.scope.match(chain)) {
- children.push({
- // header: `item-${chain}-${m.route}`,
- title: m.title,
- route: { name: m.route, params: { chain } },
- })
- }
- }
- })
- menu.children = children
- chainMenus.push(menu)
+ blockchains.push(menu)
+ })
+
+ chainMenus.push({
+ title: 'blockchains',
+ children: blockchains,
+ icon: 'https://ping.pub/logo.svg',
})
chainMenus.push({ header: 'LINKS' })
if (isTestnet()) {
diff --git a/src/router/index.js b/src/router/index.js
index 4f679fec..a2fb44bd 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -120,7 +120,7 @@ const router = new VueRouter({
// chain modules
{
path: '/:chain/',
- name: 'info',
+ name: 'dashboard',
alias: '/:chain',
component: () => import('@/views/Summary.vue'),
meta: {
@@ -133,6 +133,20 @@ const router = new VueRouter({
],
},
},
+ {
+ path: '/:chain/parameters',
+ name: 'parameters',
+ component: () => import('@/views/Summary.vue'),
+ meta: {
+ pageTitle: 'Parameters',
+ breadcrumb: [
+ {
+ text: 'Parameters',
+ active: true,
+ },
+ ],
+ },
+ },
{
path: '/:chain/statesync',
name: 'statesync',