mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-13 08:17:33 +00:00
feat: update menus
This commit is contained in:
parent
5781948ada
commit
861ab093cc
@ -36,14 +36,14 @@ limitations under the License. -->
|
|||||||
<Icon size="lg" :iconName="menu.meta.icon" />
|
<Icon size="lg" :iconName="menu.meta.icon" />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<span class="title" :class="isCollapse ? 'collapse' : ''">
|
<span class="title" :class="isCollapse ? 'collapse' : ''">
|
||||||
{{ menu.meta.title }}
|
{{ t(menu.meta.i18nKey) }}
|
||||||
</span>
|
</span>
|
||||||
</router-link>
|
</router-link>
|
||||||
</template>
|
</template>
|
||||||
<el-menu-item-group>
|
<el-menu-item-group>
|
||||||
<el-menu-item v-for="(m, idx) in filterMenus(menu.children)" :index="m.name" :key="idx">
|
<el-menu-item v-for="(m, idx) in filterMenus(menu.children)" :index="m.name" :key="idx">
|
||||||
<router-link class="items" :to="m.path">
|
<router-link class="items" :to="m.path">
|
||||||
<span class="title">{{ m.meta && m.meta.title }}</span>
|
<span class="title">{{ t(m.meta && m.meta.i18nKey) }}</span>
|
||||||
</router-link>
|
</router-link>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</el-menu-item-group>
|
</el-menu-item-group>
|
||||||
@ -56,7 +56,7 @@ limitations under the License. -->
|
|||||||
</el-icon>
|
</el-icon>
|
||||||
<template #title>
|
<template #title>
|
||||||
<router-link class="items menu-title" :to="menu.children[0].path">
|
<router-link class="items menu-title" :to="menu.children[0].path">
|
||||||
<span class="title">{{ menu.meta.title }}</span>
|
<span class="title">{{ t(menu.meta.i18nKey) }}</span>
|
||||||
</router-link>
|
</router-link>
|
||||||
</template>
|
</template>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
@ -70,10 +70,12 @@ limitations under the License. -->
|
|||||||
import { ref, watch } from "vue";
|
import { ref, watch } from "vue";
|
||||||
import type { RouteRecordRaw } from "vue-router";
|
import type { RouteRecordRaw } from "vue-router";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRouter, useRoute } from "vue-router";
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
import Icon from "@/components/Icon.vue";
|
import Icon from "@/components/Icon.vue";
|
||||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||||
|
|
||||||
/*global Recordable*/
|
/*global Recordable*/
|
||||||
|
const { t } = useI18n();
|
||||||
const appStore = useAppStoreWithOut();
|
const appStore = useAppStoreWithOut();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const name = ref<string>(String(router.currentRoute.value.name));
|
const name = ref<string>(String(router.currentRoute.value.name));
|
||||||
|
@ -22,7 +22,7 @@ export const routesAlarm: Array<RouteRecordRaw> = [
|
|||||||
path: "",
|
path: "",
|
||||||
name: "Alarm",
|
name: "Alarm",
|
||||||
meta: {
|
meta: {
|
||||||
title: "Alerting",
|
i18nKey: "alarm",
|
||||||
icon: "spam",
|
icon: "spam",
|
||||||
hasGroup: false,
|
hasGroup: false,
|
||||||
activate: true,
|
activate: true,
|
||||||
|
@ -23,7 +23,7 @@ export const routesDashboard: Array<RouteRecordRaw> = [
|
|||||||
component: Layout,
|
component: Layout,
|
||||||
name: "Dashboard",
|
name: "Dashboard",
|
||||||
meta: {
|
meta: {
|
||||||
title: "Dashboards",
|
i18nKey: "dashboards",
|
||||||
icon: "dashboard_customize",
|
icon: "dashboard_customize",
|
||||||
hasGroup: true,
|
hasGroup: true,
|
||||||
activate: true,
|
activate: true,
|
||||||
@ -34,7 +34,7 @@ export const routesDashboard: Array<RouteRecordRaw> = [
|
|||||||
component: () => import("@/views/dashboard/List.vue"),
|
component: () => import("@/views/dashboard/List.vue"),
|
||||||
name: "List",
|
name: "List",
|
||||||
meta: {
|
meta: {
|
||||||
title: "Dashboard List",
|
i18nKey: "dashboardList",
|
||||||
activate: true,
|
activate: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -43,7 +43,7 @@ export const routesDashboard: Array<RouteRecordRaw> = [
|
|||||||
component: () => import("@/views/dashboard/New.vue"),
|
component: () => import("@/views/dashboard/New.vue"),
|
||||||
name: "New",
|
name: "New",
|
||||||
meta: {
|
meta: {
|
||||||
title: "New Dashboard",
|
i18nKey: "dashboardNew",
|
||||||
activate: true,
|
activate: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -31,6 +31,8 @@ async function layerDashboards() {
|
|||||||
title: item.title,
|
title: item.title,
|
||||||
hasGroup: item.hasGroup,
|
hasGroup: item.hasGroup,
|
||||||
activate: item.activate,
|
activate: item.activate,
|
||||||
|
descKey: item.descKey,
|
||||||
|
i18nKey: item.i18nKey,
|
||||||
},
|
},
|
||||||
children: item.subItems && item.subItems.length ? [] : undefined,
|
children: item.subItems && item.subItems.length ? [] : undefined,
|
||||||
};
|
};
|
||||||
@ -43,6 +45,8 @@ async function layerDashboards() {
|
|||||||
layer: child.layer,
|
layer: child.layer,
|
||||||
icon: child.icon || "cloud_queue",
|
icon: child.icon || "cloud_queue",
|
||||||
activate: child.activate,
|
activate: child.activate,
|
||||||
|
descKey: child.descKey,
|
||||||
|
i18nKey: child.i18nKey,
|
||||||
},
|
},
|
||||||
component: () => import("@/views/Layer.vue"),
|
component: () => import("@/views/Layer.vue"),
|
||||||
};
|
};
|
||||||
@ -68,6 +72,8 @@ async function layerDashboards() {
|
|||||||
layer: item.layer,
|
layer: item.layer,
|
||||||
icon: item.icon,
|
icon: item.icon,
|
||||||
activate: item.activate,
|
activate: item.activate,
|
||||||
|
descKey: item.descKey,
|
||||||
|
i18nKey: item.i18nKey,
|
||||||
},
|
},
|
||||||
component: () => import("@/views/Layer.vue"),
|
component: () => import("@/views/Layer.vue"),
|
||||||
},
|
},
|
||||||
|
@ -22,7 +22,7 @@ export const routesMarketplace: Array<RouteRecordRaw> = [
|
|||||||
path: "",
|
path: "",
|
||||||
name: "Marketplace",
|
name: "Marketplace",
|
||||||
meta: {
|
meta: {
|
||||||
title: "Marketplace",
|
i18nKey: "marketplace",
|
||||||
icon: "marketplace",
|
icon: "marketplace",
|
||||||
hasGroup: false,
|
hasGroup: false,
|
||||||
activate: true,
|
activate: true,
|
||||||
|
@ -22,7 +22,7 @@ export const routesSettings: Array<RouteRecordRaw> = [
|
|||||||
path: "",
|
path: "",
|
||||||
name: "Settings",
|
name: "Settings",
|
||||||
meta: {
|
meta: {
|
||||||
title: "Settings",
|
i18nKey: "settings",
|
||||||
icon: "settings",
|
icon: "settings",
|
||||||
hasGroup: false,
|
hasGroup: false,
|
||||||
activate: true,
|
activate: true,
|
||||||
|
@ -175,6 +175,7 @@ export const appStore = defineStore({
|
|||||||
const id = `${item.title.replace(/\s+/g, "-")}`;
|
const id = `${item.title.replace(/\s+/g, "-")}`;
|
||||||
item.name = `${id}-${index}${sub}`;
|
item.name = `${id}-${index}${sub}`;
|
||||||
item.path = `/${t}/${id}`;
|
item.path = `/${t}/${id}`;
|
||||||
|
item.descKey = `${item.i18nKey}_desc`;
|
||||||
return item;
|
return item;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -25,10 +25,10 @@ limitations under the License. -->
|
|||||||
>
|
>
|
||||||
<router-link :to="menu.hasGroup ? '' : menu.path || ''">
|
<router-link :to="menu.hasGroup ? '' : menu.path || ''">
|
||||||
<div class="title" :class="menu.activate ? (menu.hasGroup ? '' : 'actived-font') : 'disabled'">
|
<div class="title" :class="menu.activate ? (menu.hasGroup ? '' : 'actived-font') : 'disabled'">
|
||||||
{{ menu.title }}
|
{{ t(menu.i18nKey) }}
|
||||||
</div>
|
</div>
|
||||||
</router-link>
|
</router-link>
|
||||||
<div class="mt-10"> {{ menu.description }} </div>
|
<div class="mt-10"> {{ t(menu.descKey) }} </div>
|
||||||
<el-link :href="menu.documentLink" target="_blank" class="link" v-show="menu.documentLink">
|
<el-link :href="menu.documentLink" target="_blank" class="link" v-show="menu.documentLink">
|
||||||
<el-button class="mt-10" size="small" type="primary"> {{ t("document") }} </el-button>
|
<el-button class="mt-10" size="small" type="primary"> {{ t("document") }} </el-button>
|
||||||
</el-link>
|
</el-link>
|
||||||
@ -37,9 +37,9 @@ limitations under the License. -->
|
|||||||
<div class="mt-10 cards">
|
<div class="mt-10 cards">
|
||||||
<el-card shadow="hover" v-for="(item, index) in currentItems.subItems || []" :key="index" class="card">
|
<el-card shadow="hover" v-for="(item, index) in currentItems.subItems || []" :key="index" class="card">
|
||||||
<router-link :to="item.path || ''">
|
<router-link :to="item.path || ''">
|
||||||
<div class="title" :class="item.activate ? 'actived-font' : 'disabled'"> {{ item.title }}</div>
|
<div class="title" :class="item.activate ? 'actived-font' : 'disabled'"> {{ t(item.i18nKey) }}</div>
|
||||||
</router-link>
|
</router-link>
|
||||||
<div class="mt-10"> {{ item.description }} </div>
|
<div class="mt-10"> {{ t(item.descKey) }} </div>
|
||||||
<el-link :href="item.documentLink" target="_blank" class="link" v-show="item.documentLink">
|
<el-link :href="item.documentLink" target="_blank" class="link" v-show="item.documentLink">
|
||||||
<el-button class="mt-10" size="small" type="primary"> {{ t("document") }} </el-button>
|
<el-button class="mt-10" size="small" type="primary"> {{ t("document") }} </el-button>
|
||||||
</el-link>
|
</el-link>
|
||||||
|
Loading…
Reference in New Issue
Block a user