Visual improvements
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { useAuthStore } from 'src/stores/auth';
|
||||
|
||||
export const links = [
|
||||
{
|
||||
name: 'Home',
|
||||
@@ -81,11 +83,20 @@ export const links = [
|
||||
},
|
||||
];
|
||||
|
||||
const authStore = useAuthStore();
|
||||
|
||||
function hasRole(roles: string[] | undefined) {
|
||||
if (roles === undefined) return true;
|
||||
const hasRole = authStore.hasRequiredRole(roles);
|
||||
return hasRole;
|
||||
}
|
||||
export const enabledLinks = links
|
||||
.filter((link) => link.enabled)
|
||||
.map((link) => {
|
||||
if (link.sublinks) {
|
||||
link.sublinks = link.sublinks.filter((sublink) => sublink.enabled);
|
||||
link.sublinks = link.sublinks.filter(
|
||||
(sublink) => sublink.enabled && hasRole(sublink.requiredRoles)
|
||||
);
|
||||
}
|
||||
return link;
|
||||
});
|
||||
|
||||
@@ -124,6 +124,22 @@ const routes: RouteRecordRaw[] = [
|
||||
publicRoute: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/pwreset',
|
||||
component: () => import('pages/ResetPassword.vue'),
|
||||
name: 'pwreset',
|
||||
meta: {
|
||||
publicRoute: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
component: () => import('pages/LoginPage.vue'),
|
||||
name: 'login',
|
||||
meta: {
|
||||
publicRoute: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/terms-of-service',
|
||||
component: () => import('pages/TermsOfServicePage.vue'),
|
||||
|
||||
Reference in New Issue
Block a user