feat: Add menus in side bar (#30)

This commit is contained in:
Fine0830
2022-03-21 15:36:56 +08:00
committed by GitHub
parent 42d8e909f6
commit 61f82c54df
21 changed files with 386 additions and 95 deletions

43
src/router/browser.ts Normal file
View File

@@ -0,0 +1,43 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { RouteRecordRaw } from "vue-router";
import Layout from "@/layout/Index.vue";
export const routesBrowser: Array<RouteRecordRaw> = [
{
path: "",
name: "Browser",
meta: {
title: "browser",
icon: "language",
},
redirect: "/browser",
component: Layout,
children: [
{
path: "/browser",
name: "Browser",
meta: {
title: "browser",
headPath: "/browser",
exact: true,
},
component: () => import("@/views/Layer.vue"),
},
],
},
];

View File

@@ -23,7 +23,7 @@ export const routesDatabase: Array<RouteRecordRaw> = [
name: "Database",
meta: {
title: "database",
icon: "epic",
icon: "bar_chart",
},
redirect: "/database",
component: Layout,

43
src/router/functions.ts Normal file
View File

@@ -0,0 +1,43 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { RouteRecordRaw } from "vue-router";
import Layout from "@/layout/Index.vue";
export const routesFunctions: Array<RouteRecordRaw> = [
{
path: "",
name: "Functions",
meta: {
title: "functions",
icon: "cloud_queue",
},
redirect: "/functions",
component: Layout,
children: [
{
path: "/functions",
name: "Functions",
meta: {
title: "functions",
headPath: "/functions",
exact: true,
},
component: () => import("@/views/Layer.vue"),
},
],
},
];

View File

@@ -23,12 +23,18 @@ import { routesDashboard } from "./dashboard";
import { routesEvent } from "./event";
import { routesSetting } from "./setting";
import { routesAlarm } from "./alarm";
import { routesSelf } from "./selfObservability";
import { routesFunctions } from "./functions";
import { routesBrowser } from "./browser";
const routes: Array<RouteRecordRaw> = [
...routesGen,
...routesMesh,
...routesDatabase,
...routesFunctions,
...routesInfra,
...routesBrowser,
...routesDatabase,
...routesSelf,
...routesDashboard,
...routesAlarm,
...routesEvent,

View File

@@ -27,24 +27,34 @@ export const routesInfra: Array<RouteRecordRaw> = [
exact: true,
hasGroup: true,
},
redirect: "/infrastructure",
component: Layout,
children: [
{
path: "/infrastructure/vm",
name: "VirtualMachine",
path: "/infrastructure",
name: "Linux",
meta: {
title: "virtualMachine",
title: "linux",
},
component: () => import("@/views/infrastructure/Infrastructure.vue"),
},
{
path: "/infrastructure/k8s",
name: "Kubernetes",
meta: {
title: "kubernetes",
},
component: () => import("@/views/infrastructure/Infrastructure.vue"),
component: () => import("@/views/Layer.vue"),
// component: () => import("@/views/infrastructure/Infrastructure.vue"),
},
// {
// path: "/infrastructure/vm",
// name: "VirtualMachine",
// meta: {
// title: "virtualMachine",
// },
// component: () => import("@/views/infrastructure/Infrastructure.vue"),
// },
// {
// path: "/infrastructure/k8s",
// name: "Kubernetes",
// meta: {
// title: "kubernetes",
// },
// component: () => import("@/views/infrastructure/Infrastructure.vue"),
// },
],
},
];

View File

@@ -0,0 +1,52 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { RouteRecordRaw } from "vue-router";
import Layout from "@/layout/Index.vue";
export const routesSelf: Array<RouteRecordRaw> = [
{
path: "",
name: "SelfObservability",
redirect: "/self/skyWalkingServer",
meta: {
title: "selfObservability",
icon: "logo",
hasGroup: true,
},
component: Layout,
children: [
{
path: "/self/skyWalkingServer",
name: "SkyWalkingServer",
meta: {
title: "skyWalkingServer",
headPath: "/mesh/services",
},
component: () => import("@/views/Layer.vue"),
},
{
path: "/self/satellite",
name: "Satellite",
meta: {
title: "satellite",
headPath: "/mesh/controlPanel",
},
component: () => import("@/views/Layer.vue"),
},
],
},
];

View File

@@ -24,7 +24,7 @@ export const routesMesh: Array<RouteRecordRaw> = [
redirect: "/mesh/services",
meta: {
title: "serviceMesh",
icon: "bar_chart",
icon: "epic",
hasGroup: true,
},
component: Layout,