Skip to content

Commit b3a55ea

Browse files
authored
fix: Fix menu display exception issue (#9883)
1 parent 270411f commit b3a55ea

File tree

8 files changed

+14
-19
lines changed

8 files changed

+14
-19
lines changed

frontend/src/routers/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ router.afterEach((to) => {
7373
localStorage.setItem('cachedRoute' + to.meta.activeMenu, '/cronjobs/cronjob');
7474
} else if (to.meta.activeMenu === '/containers' && to.path === '/containers/container/operate') {
7575
localStorage.setItem('cachedRoute' + to.meta.activeMenu, '/containers/container');
76+
} else if (to.meta.activeMenu === '/toolbox' && to.path === '/toolbox/clam/setting') {
77+
localStorage.setItem('cachedRoute' + to.meta.activeMenu, '/toolbox/clam');
7678
} else {
7779
localStorage.setItem('cachedRoute' + to.meta.activeMenu, to.path);
7880
}

frontend/src/routers/modules/container.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ const containerRouter = {
5353
meta: {
5454
activeMenu: '/containers',
5555
requiresAuth: false,
56-
parent: 'menu.container',
57-
title: 'menu.container',
58-
detail: 'commons.table.operate',
56+
ignoreTab: true,
5957
},
6058
},
6159
{
@@ -67,9 +65,7 @@ const containerRouter = {
6765
meta: {
6866
activeMenu: '/containers',
6967
requiresAuth: false,
70-
parent: 'menu.container',
71-
title: 'container.compose',
72-
detail: 'commons.button.view',
68+
ignoreTab: true,
7369
},
7470
},
7571
{

frontend/src/routers/modules/cronjob.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ const cronRouter = {
3737
meta: {
3838
activeMenu: '/cronjobs',
3939
requiresAuth: false,
40-
title: 'menu.cronjob',
41-
detail: 'commons.table.operate',
40+
ignoreTab: true,
4241
},
4342
},
4443
{

frontend/src/routers/modules/database.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ const databaseRouter = {
3939
meta: {
4040
activeMenu: '/databases',
4141
requiresAuth: false,
42-
parent: 'menu.database',
43-
title: 'MySQL',
44-
detail: 'commons.button.set',
42+
ignoreTab: true,
4543
},
4644
},
4745
{
@@ -91,9 +89,7 @@ const databaseRouter = {
9189
meta: {
9290
activeMenu: '/databases',
9391
requiresAuth: false,
94-
parent: 'menu.database',
95-
title: 'PostgreSQL',
96-
detail: 'commons.button.set',
92+
ignoreTab: true,
9793
},
9894
},
9995
{

frontend/src/routers/modules/setting.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ const settingRouter = {
110110
meta: {
111111
requiresAuth: true,
112112
activeMenu: 'Expired',
113+
ignoreTab: true,
113114
},
114115
},
115116
],

frontend/src/routers/modules/toolbox.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ const toolboxRouter = {
6060
component: () => import('@/views/toolbox/clam/setting/index.vue'),
6161
hidden: true,
6262
meta: {
63-
parent: 'menu.toolbox',
64-
title: 'toolbox.device.toolbox',
63+
ignoreTab: true,
6564
activeMenu: '/toolbox',
6665
requiresAuth: false,
6766
},

frontend/src/routers/modules/website.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ const webSiteRouter = {
2727
hidden: true,
2828
props: true,
2929
meta: {
30-
parent: 'menu.website',
31-
title: 'menu.config',
3230
activeMenu: '/websites',
3331
requiresAuth: false,
32+
ignoreTab: true,
3433
},
3534
},
3635
{

frontend/src/utils/router.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ export const routerToNameWithParams = async (name: string, params: any) => {
3333

3434
const tabStoreMiddleWare = () => {
3535
try {
36-
const tabsStore = TabsStore();
3736
let route = router.currentRoute;
37+
if (route.value.meta.ignoreTab) {
38+
return;
39+
}
40+
const tabsStore = TabsStore();
3841
tabsStore.addTab(route.value);
3942
tabsStore.activeTabPath = route.value?.path;
4043
} catch (error) {}

0 commit comments

Comments
 (0)