|
|
|
|
@ -157,12 +157,12 @@
|
|
|
|
|
|
|
|
|
|
// Define Menu Items
|
|
|
|
|
menuItems = [
|
|
|
|
|
{label: $t('nav.dashboard'), icon: "<i class='fas fa-tachometer-alt'></i>", path: "/"},
|
|
|
|
|
{label: $t('nav.org'), icon: "<i class='fas fa-sitemap'></i>", path: "/org"},
|
|
|
|
|
{label: $t('nav.profile'), icon: "<i class='fas fa-user'></i>", path: "/profile"},
|
|
|
|
|
{label: () => $t('nav.dashboard'), icon: "<i class='fas fa-tachometer-alt'></i>", path: "/"},
|
|
|
|
|
{label: () => $t('nav.org'), icon: "<i class='fas fa-sitemap'></i>", path: "/org"},
|
|
|
|
|
{label: () => $t('nav.profile'), icon: "<i class='fas fa-user'></i>", path: "/profile"},
|
|
|
|
|
// Admin only items would be filtered here ideally
|
|
|
|
|
{label: $t('nav.users'), icon: "<i class='fas fa-users-cog'></i>", path: "/users"},
|
|
|
|
|
{label: $t('nav.oauth'), icon: "<i class='fas fa-key'></i>", path: "/oauth/apps"},
|
|
|
|
|
{label: () => $t('nav.users'), icon: "<i class='fas fa-users-cog'></i>", path: "/users"},
|
|
|
|
|
{label: () => $t('nav.oauth'), icon: "<i class='fas fa-key'></i>", path: "/oauth/apps"},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
currentRouteName = "";
|
|
|
|
|
@ -186,34 +186,12 @@
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<script>
|
|
|
|
|
$watch(() => $env.$route.path, () => {
|
|
|
|
|
// Update breadcrumb or active item
|
|
|
|
|
// v-sidebar handles active state via path matching usually
|
|
|
|
|
// We can update title based on route name
|
|
|
|
|
// For now just simple mapping or rely on $route
|
|
|
|
|
// $data.currentRouteName = $env.$route.name || $env.$route.path
|
|
|
|
|
// Simple implementation:
|
|
|
|
|
const path = $env.$route.path;
|
|
|
|
|
$router.onChange(() => {
|
|
|
|
|
const path = $router.current.path;
|
|
|
|
|
console.log(path)
|
|
|
|
|
const item = $data.menuItems.find(i => i.path === path);
|
|
|
|
|
$data.currentRouteName = item ? item.label : path;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Watch global state for user/org changes
|
|
|
|
|
$watch(() => [$env.$vbase.user, $env.$i18n.locale], () => {
|
|
|
|
|
$data.user = $env.$vbase.user;
|
|
|
|
|
// Re-generate menu items when locale changes
|
|
|
|
|
$data.menuItems = [
|
|
|
|
|
{label: $t('nav.dashboard'), icon: "<i class='fas fa-tachometer-alt'></i>", path: "/"},
|
|
|
|
|
{label: $t('nav.org'), icon: "<i class='fas fa-sitemap'></i>", path: "/org"},
|
|
|
|
|
{label: $t('nav.profile'), icon: "<i class='fas fa-user'></i>", path: "/profile"},
|
|
|
|
|
// Admin only items would be filtered here ideally
|
|
|
|
|
{label: $t('nav.users'), icon: "<i class='fas fa-users-cog'></i>", path: "/users"},
|
|
|
|
|
{label: $t('nav.oauth'), icon: "<i class='fas fa-key'></i>", path: "/oauth/apps"},
|
|
|
|
|
];
|
|
|
|
|
});
|
|
|
|
|
$watch(() => $env.$vbase.currentOrg, () => {
|
|
|
|
|
$data.currentOrg = $env.$vbase.currentOrg;
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
</html>
|
|
|
|
|
|