routes.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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: "HomePage",
  16. component: () => import("src/pages/home/HomePage.vue"),
  17. meta: {
  18. requireAuth: true,
  19. },
  20. },
  21. {
  22. path: "/dashboard",
  23. name: "DashboardPage",
  24. component: () => import("pages/dashboard/DashboardPage.vue"),
  25. meta: {
  26. title: { value: "Dashboard" },
  27. description: {
  28. value: "page.system-dashboard.description",
  29. translate: true,
  30. },
  31. requireAuth: true,
  32. requiredPermission: "dashboard",
  33. breadcrumbs: [
  34. {
  35. name: "DashboardPage",
  36. title: "Dashboard",
  37. },
  38. ],
  39. },
  40. },
  41. {
  42. path: "/versions",
  43. name: "SystemVersionsPage",
  44. component: () => import("pages/version/SystemVersionsPage.vue"),
  45. meta: {
  46. title: {
  47. value: "ui.navigation.versions",
  48. translate: true,
  49. },
  50. description: {
  51. value: "page.versions.description",
  52. translate: true,
  53. },
  54. requireAuth: true,
  55. breadcrumbs: [
  56. {
  57. name: "SystemVersionsPage",
  58. title: "ui.navigation.versions",
  59. translate: true,
  60. },
  61. ],
  62. },
  63. },
  64. ...sub_routes,
  65. ],
  66. },
  67. {
  68. path: "/login",
  69. component: () => import("layouts/LoginLayout.vue"),
  70. children: [
  71. {
  72. path: "",
  73. name: "LoginPage",
  74. component: () => import("pages/login/LoginPage.vue"),
  75. meta: {
  76. title: "Login",
  77. },
  78. },
  79. ],
  80. },
  81. {
  82. path: "/forgot-my-password",
  83. component: () => import("layouts/LoginLayout.vue"),
  84. children: [
  85. {
  86. path: "",
  87. name: "ForgotMyPasswordPage",
  88. component: () => import("pages/ForgotMyPasswordPage.vue")
  89. }
  90. ]
  91. },
  92. // Always leave this as last one,
  93. // but you can also remove it
  94. {
  95. path: "/:catchAll(.*)*",
  96. component: () => import("pages/ErrorNotFound.vue"),
  97. },
  98. ];
  99. export default routes;