fix name in routes (#446)

This commit is contained in:
Fine0830 2025-02-13 18:06:56 +08:00 committed by GitHub
parent 9318d32b0b
commit 2246a9a045
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 12 deletions

View File

@ -50,7 +50,7 @@ limitations under the License. -->
</el-menu-item>
</el-menu-item-group>
</el-sub-menu>
<el-menu-item :index="String(menu.name)" @click="changePage(menu)" v-else>
<el-menu-item :index="String(menu.name)" v-else>
<el-icon class="menu-icons" :style="{ marginRight: '12px' }" @mouseover="setCollapse">
<router-link class="items menu-title" :to="menu.children[0].path">
<Icon size="lg" :iconName="menu.meta.icon" />
@ -83,7 +83,6 @@ limitations under the License. -->
const appStore = useAppStoreWithOut();
const router = useRouter();
const name = ref<string>(String(router.currentRoute.value.name));
const theme = ["VirtualMachine", "Kubernetes"].includes(name.value || "") ? ref("light") : ref("black");
const routes = ref<RouteRecordRaw[] | any>(
(router.options.routes || []).filter((d: any) => d.meta && d.meta.activate),
);
@ -100,9 +99,7 @@ limitations under the License. -->
if (route.name === "ViewWidget") {
showMenu.value = false;
}
const changePage = (menu: RouteRecordRaw) => {
theme.value = ["VirtualMachine", "Kubernetes"].includes(String(menu.name)) ? "light" : "black";
};
const filterMenus = (menus: Recordable[]) => {
return menus.filter((d) => d.meta && !d.meta.notShow && d.meta.activate);
};

View File

@ -33,7 +33,7 @@ export const routesAlarm: Array<RouteRecordRaw> = [
children: [
{
path: "/alerting",
name: "Alarm",
name: "ViewAlarm",
component: Alarm,
},
],

View File

@ -100,7 +100,7 @@ export const routesDashboard: Array<RouteRecordRaw> = [
path: "",
redirect: "/dashboard/related/:layerId/:entity/:serviceId/:destServiceId/:name",
component: Edit,
name: "ViewServiceRelation",
name: "ServiceRelations",
meta: {
notShow: true,
},
@ -121,7 +121,7 @@ export const routesDashboard: Array<RouteRecordRaw> = [
path: "",
redirect: "/dashboard/:layerId/:entity/:serviceId/:podId/:name",
component: Edit,
name: "ViewPod",
name: "Pods",
meta: {
notShow: true,
},
@ -142,7 +142,7 @@ export const routesDashboard: Array<RouteRecordRaw> = [
path: "",
redirect: "/dashboard/:layerId/:entity/:serviceId/:podId/:processId/:name",
component: Edit,
name: "ViewProcess",
name: "Processes",
meta: {
notShow: true,
},
@ -163,7 +163,7 @@ export const routesDashboard: Array<RouteRecordRaw> = [
path: "",
redirect: "/dashboard/:layerId/:entity/:serviceId/:podId/:destServiceId/:destPodId/:name",
component: Edit,
name: "PodRelation",
name: "PodRelations",
meta: {
notShow: true,
},
@ -185,7 +185,7 @@ export const routesDashboard: Array<RouteRecordRaw> = [
redirect:
"/dashboard/:layerId/:entity/:serviceId/:podId/:processId/:destServiceId/:destPodId/:destProcessId/:name",
component: Edit,
name: "ProcessRelation",
name: "ProcessRelations",
meta: {
notShow: true,
},

View File

@ -33,7 +33,7 @@ export const routesSettings: Array<RouteRecordRaw> = [
children: [
{
path: "/settings",
name: "Settings",
name: "ViewSettings",
component: Settings,
},
],