mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-13 08:17:33 +00:00
feat: add activate
This commit is contained in:
parent
d27a1833cd
commit
a3b040d495
@ -29,6 +29,7 @@ limitations under the License. -->
|
|||||||
:style="{ border: 'none' }"
|
:style="{ border: 'none' }"
|
||||||
>
|
>
|
||||||
<template v-for="(menu, index) in routes" :key="index">
|
<template v-for="(menu, index) in routes" :key="index">
|
||||||
|
<span v-if="menu.meta.activate">
|
||||||
<el-sub-menu :index="String(menu.name)" v-if="menu.meta.hasGroup" popper-class="sub-list">
|
<el-sub-menu :index="String(menu.name)" v-if="menu.meta.hasGroup" popper-class="sub-list">
|
||||||
<template #title>
|
<template #title>
|
||||||
<router-link class="items" :to="menu.path">
|
<router-link class="items" :to="menu.path">
|
||||||
@ -60,6 +61,7 @@ limitations under the License. -->
|
|||||||
</router-link>
|
</router-link>
|
||||||
</template>
|
</template>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-menu>
|
</el-menu>
|
||||||
</div>
|
</div>
|
||||||
@ -95,7 +97,7 @@ limitations under the License. -->
|
|||||||
theme.value = ["VirtualMachine", "Kubernetes"].includes(String(menu.name)) ? "light" : "black";
|
theme.value = ["VirtualMachine", "Kubernetes"].includes(String(menu.name)) ? "light" : "black";
|
||||||
};
|
};
|
||||||
const filterMenus = (menus: Recordable[]) => {
|
const filterMenus = (menus: Recordable[]) => {
|
||||||
return menus.filter((d) => d.meta && !d.meta.notShow);
|
return menus.filter((d) => d.meta && !d.meta.notShow && d.meta.activate);
|
||||||
};
|
};
|
||||||
function setCollapse() {
|
function setCollapse() {
|
||||||
open.value = true;
|
open.value = true;
|
||||||
|
@ -25,6 +25,7 @@ export const routesAlarm: Array<RouteRecordRaw> = [
|
|||||||
title: "Alerting",
|
title: "Alerting",
|
||||||
icon: "spam",
|
icon: "spam",
|
||||||
hasGroup: false,
|
hasGroup: false,
|
||||||
|
activate: true,
|
||||||
},
|
},
|
||||||
component: Layout,
|
component: Layout,
|
||||||
children: [
|
children: [
|
||||||
|
@ -26,6 +26,7 @@ export const routesDashboard: Array<RouteRecordRaw> = [
|
|||||||
title: "Dashboards",
|
title: "Dashboards",
|
||||||
icon: "dashboard_customize",
|
icon: "dashboard_customize",
|
||||||
hasGroup: true,
|
hasGroup: true,
|
||||||
|
activate: true,
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
@ -34,6 +35,7 @@ export const routesDashboard: Array<RouteRecordRaw> = [
|
|||||||
name: "List",
|
name: "List",
|
||||||
meta: {
|
meta: {
|
||||||
title: "Dashboard List",
|
title: "Dashboard List",
|
||||||
|
activate: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -42,6 +44,7 @@ export const routesDashboard: Array<RouteRecordRaw> = [
|
|||||||
name: "New",
|
name: "New",
|
||||||
meta: {
|
meta: {
|
||||||
title: "New Dashboard",
|
title: "New Dashboard",
|
||||||
|
activate: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@ import type { MenuOptions } from "@/types/app";
|
|||||||
async function layerDashboards() {
|
async function layerDashboards() {
|
||||||
const appStore = useAppStoreWithOut();
|
const appStore = useAppStoreWithOut();
|
||||||
await appStore.getActivateMenus();
|
await appStore.getActivateMenus();
|
||||||
const routes = appStore.activateMenus.map((item: MenuOptions) => {
|
const routes = appStore.allMenus.map((item: MenuOptions) => {
|
||||||
const route: any = {
|
const route: any = {
|
||||||
path: "",
|
path: "",
|
||||||
name: item.name,
|
name: item.name,
|
||||||
@ -30,6 +30,7 @@ async function layerDashboards() {
|
|||||||
icon: item.icon || "cloud_queue",
|
icon: item.icon || "cloud_queue",
|
||||||
title: item.title,
|
title: item.title,
|
||||||
hasGroup: item.hasGroup,
|
hasGroup: item.hasGroup,
|
||||||
|
activate: item.activate,
|
||||||
},
|
},
|
||||||
children: item.subItems && item.subItems.length ? [] : undefined,
|
children: item.subItems && item.subItems.length ? [] : undefined,
|
||||||
};
|
};
|
||||||
@ -41,6 +42,7 @@ async function layerDashboards() {
|
|||||||
title: child.title,
|
title: child.title,
|
||||||
layer: child.layer,
|
layer: child.layer,
|
||||||
icon: child.icon || "cloud_queue",
|
icon: child.icon || "cloud_queue",
|
||||||
|
activate: child.activate,
|
||||||
},
|
},
|
||||||
component: () => import("@/views/Layer.vue"),
|
component: () => import("@/views/Layer.vue"),
|
||||||
};
|
};
|
||||||
@ -65,6 +67,7 @@ async function layerDashboards() {
|
|||||||
title: item.title,
|
title: item.title,
|
||||||
layer: item.layer,
|
layer: item.layer,
|
||||||
icon: item.icon,
|
icon: item.icon,
|
||||||
|
activate: item.activate,
|
||||||
},
|
},
|
||||||
component: () => import("@/views/Layer.vue"),
|
component: () => import("@/views/Layer.vue"),
|
||||||
},
|
},
|
||||||
|
@ -25,6 +25,7 @@ export const routesMarketplace: Array<RouteRecordRaw> = [
|
|||||||
title: "Marketplace",
|
title: "Marketplace",
|
||||||
icon: "marketplace",
|
icon: "marketplace",
|
||||||
hasGroup: true,
|
hasGroup: true,
|
||||||
|
activate: true,
|
||||||
},
|
},
|
||||||
component: Layout,
|
component: Layout,
|
||||||
children: [
|
children: [
|
||||||
@ -33,6 +34,7 @@ export const routesMarketplace: Array<RouteRecordRaw> = [
|
|||||||
name: "MenusManagement",
|
name: "MenusManagement",
|
||||||
meta: {
|
meta: {
|
||||||
title: "Categories",
|
title: "Categories",
|
||||||
|
activate: true,
|
||||||
},
|
},
|
||||||
component: () => import("@/views/marketplace/Menus.vue"),
|
component: () => import("@/views/marketplace/Menus.vue"),
|
||||||
},
|
},
|
||||||
@ -41,6 +43,7 @@ export const routesMarketplace: Array<RouteRecordRaw> = [
|
|||||||
name: "Settings",
|
name: "Settings",
|
||||||
meta: {
|
meta: {
|
||||||
title: "Settings",
|
title: "Settings",
|
||||||
|
activate: true,
|
||||||
},
|
},
|
||||||
component: () => import("@/views/marketplace/Settings.vue"),
|
component: () => import("@/views/marketplace/Settings.vue"),
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user