routes.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. let sub_routes = [];
  2. const modules = import.meta.glob("./routes/*.route.js", { eager: true });
  3. // eslint-disable-next-line no-unused-vars
  4. Object.entries(modules).forEach(([path, definition]) => {
  5. sub_routes = sub_routes.concat(definition.default);
  6. });
  7. const routes = [
  8. {
  9. path: "/",
  10. component: () => import("layouts/MainLayout.vue"),
  11. meta: { requireAuth: true },
  12. children: [
  13. {
  14. path: "",
  15. name: "DashboardPage",
  16. component: () => import("src/pages/dashboard/DashboardPage.vue"),
  17. meta: {
  18. title: "ui.navigation.dashboard",
  19. requireAuth: true,
  20. requiredPermission: "dashboard",
  21. breadcrumbs: [
  22. {
  23. name: "DashboardPage",
  24. title: "ui.navigation.dashboard",
  25. },
  26. ],
  27. },
  28. },
  29. {
  30. path: "pagamentos",
  31. name: "PagamentosPage",
  32. component: () => import("src/pages/search/PagamentosPage.vue"),
  33. meta: {
  34. title: "Busca",
  35. requireAuth: true,
  36. breadcrumbs: [
  37. {
  38. name: "DashboardPage",
  39. title: "ui.navigation.dashboard",
  40. },
  41. {
  42. name: "PagamentosPage",
  43. title: "Busca",
  44. },
  45. ],
  46. },
  47. },
  48. {
  49. path: "agenda",
  50. name: "AgendaPage",
  51. component: () => import("src/pages/agenda/AgendaPage.vue"),
  52. meta: {
  53. title: "Agenda",
  54. requireAuth: true,
  55. breadcrumbs: [
  56. {
  57. name: "DashboardPage",
  58. title: "ui.navigation.dashboard",
  59. },
  60. {
  61. name: "AgendaPage",
  62. title: "Agenda",
  63. },
  64. ],
  65. },
  66. },
  67. {
  68. path: "perfil",
  69. name: "ProfilePage",
  70. component: () => import("src/pages/profile/ProfilePage.vue"),
  71. meta: {
  72. title: "Perfil",
  73. requireAuth: true,
  74. breadcrumbs: [
  75. {
  76. name: "DashboardPage",
  77. title: "ui.navigation.dashboard",
  78. },
  79. {
  80. name: "ProfilePage",
  81. title: "Perfil",
  82. },
  83. ],
  84. },
  85. },
  86. ...sub_routes,
  87. ],
  88. },
  89. {
  90. path: "/login",
  91. component: () => import("layouts/LoginLayout.vue"),
  92. children: [
  93. {
  94. path: "",
  95. name: "LoginPage",
  96. component: () => import("pages/LoginPage.vue"),
  97. meta: {
  98. title: "Login",
  99. },
  100. },
  101. ],
  102. },
  103. // Always leave this as last one,
  104. // but you can also remove it
  105. {
  106. path: "/:catchAll(.*)*",
  107. component: () => import("pages/ErrorNotFound.vue"),
  108. },
  109. ];
  110. export default routes;