routes.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. import { notLogedIn, Authenticated, canSeeAdminPanel, canSeeUserProfilePanel } from './middleware/middleware.js'
  2. const routes = [
  3. {
  4. path: '',
  5. layoutConfig: {
  6. layoutView: 'lHh Lpr fff',
  7. layoutHeader: true,
  8. layoutHeaderType: 'main',
  9. layoutHeaderVisible: true,
  10. layoutHeaderReveal: false,
  11. layoutHeaderElevated: false,
  12. layoutHeaderBordered: false,
  13. layoutLeftDrawer: true,
  14. layoutLeftSideBarType: 'main',
  15. layoutLeftDrawerVisible: false,
  16. layoutLeftDrawerOverlay: false,
  17. layoutLeftDrawerElevated: false,
  18. layoutLeftDrawerBordered: false,
  19. layoutLeftDrawerWidth: 325,
  20. layoutLeftDrawerBehavior: 'default',
  21. layoutRightDrawer: false,
  22. layoutFooter: true,
  23. showHamburgerBtn: true,
  24. layoutFooterVisible: true,
  25. layoutFooterType: 'main',
  26. layoutHeaderCustomClass: '',
  27. layoutBreadcrumbsElements: [],
  28. layoutBreadcrumbs: {
  29. separator: 'home'
  30. },
  31. layoutLeftDrawerCustomClass: 'main-layout-left-drawer',
  32. layoutPageContainerCustomClass: 'main-layout-container'
  33. },
  34. component: () => import('layouts/MainLayout.vue'),
  35. children: [
  36. {
  37. path: '/auth',
  38. name: 'Auth',
  39. layoutConfig: {
  40. layoutHeaderVisible: false,
  41. layoutHeader: false,
  42. layoutLeftDrawer: false,
  43. layoutFooter: false,
  44. layoutFooterVisible: false
  45. },
  46. component: () => import('layouts/bareLayout.vue'),
  47. children: [
  48. {
  49. path: '/login/admin',
  50. name: 'AdminLogin',
  51. meta: {
  52. middlewares: [notLogedIn]
  53. },
  54. component: () => import('src/pages/Auth/Login.vue')
  55. },
  56. {
  57. path: '/login',
  58. name: 'Login',
  59. meta: {
  60. middlewares: [notLogedIn]
  61. },
  62. component: () => import('src/pages/Auth/Login.vue')
  63. }
  64. ]
  65. },
  66. {
  67. path: '',
  68. name: 'Public',
  69. layoutConfig: {
  70. layoutView: 'lhh Lpr fff'
  71. },
  72. component: () => import('layouts/bareLayout.vue'),
  73. meta: { middlewares: [canSeeUserProfilePanel] },
  74. children: [
  75. // {
  76. // path: '',
  77. // name: 'Public.Home',
  78. // meta: {
  79. // hasDynamicSetting: true
  80. // },
  81. // component: () => import('src/pages/Public/Home.vue')
  82. // },
  83. { name: 'Public.Home', path: '', component: () => import('src/pages/Public/index.vue') },
  84. { name: 'UserPanel.AllClassrooms', path: 'all-classrooms', component: () => import('src/pages/Public/classrooms.vue') },
  85. { name: 'UserPanel.ShowClassroomInfo', path: 'classroom/:id', component: () => import('src/pages/Public/ShowClassroomInfo.vue') }
  86. ]
  87. },
  88. {
  89. path: 'panel',
  90. name: 'UserPanel',
  91. layoutConfig: {
  92. showHamburgerBtn: false,
  93. layoutHeaderType: 'user-panel',
  94. layoutLeftSideBarType: 'user-panel'
  95. },
  96. meta: { middlewares: [Authenticated, canSeeUserProfilePanel] },
  97. component: () => import('src/layouts/bareLayout.vue'),
  98. children: [
  99. {
  100. name: 'UserPanel.ShopCompleteInfo',
  101. path: 'shop/completeInfo',
  102. meta: { middlewares: [Authenticated] },
  103. component: () => import('src/pages/User/Shop/completeInfo.vue')
  104. },
  105. {
  106. name: 'UserPanel.ShopPaymentFromWallet',
  107. path: 'shop/payment-from-wallet',
  108. meta: { middlewares: [Authenticated] },
  109. component: () => import('src/pages/User/Shop/paymentFromWallet.vue')
  110. },
  111. {
  112. name: 'UserPanel.PaymentResult',
  113. path: 'shop/payment-result',
  114. meta: { middlewares: [Authenticated] },
  115. component: () => import('src/pages/User/Shop/paymentResult.vue')
  116. },
  117. {
  118. path: 'profile',
  119. name: 'UserPanel.Profile',
  120. component: () => import('src/layouts/UserPanelLayout.vue'),
  121. meta: { middlewares: [Authenticated] },
  122. children: [
  123. { name: 'UserPanel.Profile.AllClassrooms', path: 'all-classrooms', component: () => import('src/pages/User/Profile/classrooms.vue') },
  124. { name: 'UserPanel.Profile.ClassroomInfo', path: 'classroom/:id', component: () => import('src/pages/User/Profile/classroomInfo.vue') },
  125. { name: 'UserPanel.Profile.SessionInfo', path: 'session/:id', component: () => import('src/pages/User/Profile/sessionInfo.vue') },
  126. { name: 'UserPanel.Profile.UserInfo', path: 'user-info', component: () => import('src/pages/User/Profile/profile.vue') }
  127. ]
  128. }
  129. ]
  130. },
  131. {
  132. path: 'admin',
  133. name: 'Admin',
  134. layoutConfig: {
  135. layoutView: 'hHh LpR fFf',
  136. layoutHeaderType: 'admin',
  137. layoutHeaderBordered: true,
  138. layoutLeftDrawer: true,
  139. layoutLeftDrawerVisible: true,
  140. layoutLeftSideBarType: 'admin',
  141. layoutLeftDrawerBordered: true,
  142. layoutLeftDrawerWidth: 240,
  143. layoutFooter: false
  144. },
  145. meta: { middlewares: [Authenticated, canSeeAdminPanel] },
  146. component: () => import('src/layouts/AdminLayout.vue'),
  147. children: [
  148. {
  149. name: 'Admin.Settings',
  150. path: 'settings',
  151. component: () => import('src/pages/Admin/Settings.vue'),
  152. breadcrumbs: { title: 'تنظیمات' }
  153. },
  154. {
  155. name: 'Admin.User',
  156. path: 'users',
  157. component: () => import('layouts/bareLayout.vue'),
  158. breadcrumbs: { title: 'کاربران' },
  159. children: [
  160. { name: 'Admin.User.Index', path: '', component: () => import('src/pages/Admin/User/index.vue') },
  161. { name: 'Admin.User.Show', path: ':id', component: () => import('src/pages/Admin/User/show.vue'), breadcrumbs: { title: 'اطلاعات کاربری' } }
  162. ]
  163. },
  164. {
  165. name: 'Admin.Category',
  166. path: 'categories',
  167. component: () => import('layouts/bareLayout.vue'),
  168. breadcrumbs: { title: 'دسته بندی ها' },
  169. children: [
  170. { name: 'Admin.Category.Index', path: '', component: () => import('src/pages/Admin/Category/index.vue') },
  171. { name: 'Admin.Category.Create', path: 'create', component: () => import('src/pages/Admin/Category/create.vue') },
  172. { name: 'Admin.Category.Show', path: ':id', component: () => import('src/pages/Admin/Category/show.vue') }
  173. ]
  174. },
  175. {
  176. name: 'Admin.Unit',
  177. path: 'units',
  178. component: () => import('src/layouts/bareLayout.vue'),
  179. breadcrumbs: { title: 'طلیعه حکمت' },
  180. children: [
  181. // { name: 'Admin.Category.Index', path: '', component: () => import('src/pages/Admin/Category/index.vue') },
  182. // { name: 'Admin.Category.Create', path: 'create', component: () => import('src/pages/Admin/Category/create.vue') },
  183. { name: 'Admin.Unit.Show', path: ':id', component: () => import('src/pages/Admin/Unit/show.vue'), breadcrumbs: { title: 'درس' } }
  184. ]
  185. },
  186. {
  187. name: 'Admin.SessionTemplate',
  188. path: 'sessionTemplates',
  189. component: () => import('layouts/bareLayout.vue'),
  190. breadcrumbs: { title: 'طلیعه حکمت' },
  191. children: [
  192. { name: 'Admin.SessionTemplate.Index', path: '', component: () => import('src/pages/Admin/SessionTemplate/index.vue') },
  193. { name: 'Admin.SessionTemplate.Create', path: 'create', component: () => import('src/pages/Admin/SessionTemplate/create.vue') },
  194. { name: 'Admin.SessionTemplate.Show', path: ':id', component: () => import('src/pages/Admin/SessionTemplate/show.vue') }
  195. ]
  196. },
  197. {
  198. name: 'Admin.Classroom',
  199. path: 'classrooms',
  200. component: () => import('layouts/bareLayout.vue'),
  201. breadcrumbs: { title: 'دوره های آموزشی', route: { name: 'Admin.Classroom.Index' } },
  202. children: [
  203. { name: 'Admin.Classroom.Index', path: '', component: () => import('src/pages/Admin/Classroom/index.vue') },
  204. { name: 'Admin.Classroom.Create', path: 'create', component: () => import('src/pages/Admin/Classroom/create.vue'), breadcrumbs: { title: 'ساخت دوره آموزشی' } },
  205. { name: 'Admin.Classroom.Show', path: ':id', component: () => import('src/pages/Admin/Classroom/show.vue'), breadcrumbs: { title: 'مشاهده اطلاعات دوره آموزشی' } }
  206. ]
  207. },
  208. {
  209. name: 'Admin.Session',
  210. path: 'session',
  211. component: () => import('layouts/bareLayout.vue'),
  212. breadcrumbs: { title: 'طلیعه حکمت' },
  213. children: [
  214. { name: 'Admin.Session.Index', path: '', component: () => import('src/pages/Admin/Session/index.vue') },
  215. { name: 'Admin.Session.Create', path: 'create', component: () => import('src/pages/Admin/Session/create.vue') },
  216. { name: 'Admin.Session.Show', path: ':id', component: () => import('src/pages/Admin/Session/show.vue') }
  217. ]
  218. }
  219. ]
  220. },
  221. {
  222. path: 'document',
  223. name: 'Document',
  224. component: () => import('layouts/bareLayout.vue'),
  225. children: [
  226. {
  227. path: 'component',
  228. name: 'component',
  229. component: () => import('src/pages/Document/component.vue'),
  230. breadcrumbs: { title: 'component' },
  231. meta: {
  232. middlewares: [Authenticated]
  233. }
  234. },
  235. {
  236. path: 'theme',
  237. name: 'Document.Theme',
  238. component: () => import('layouts/bareLayout.vue'),
  239. breadcrumbs: { title: 'Theme' },
  240. children: [
  241. {
  242. path: 'controls',
  243. name: 'Document.Theme.Controls',
  244. component: () => import('src/pages/Document/Theme/Controls.vue'),
  245. breadcrumbs: { title: 'Controls' }
  246. }
  247. ]
  248. },
  249. {
  250. path: 'debug',
  251. name: 'Document.Debug',
  252. component: () => import('src/pages/Document/debug.vue')
  253. },
  254. {
  255. path: 'icon-sax',
  256. name: 'Document.IconSax',
  257. component: () => import('src/pages/Document/IconSax.vue')
  258. },
  259. {
  260. path: '/form-generator',
  261. name: 'formGenerator',
  262. component: () => import('src/pages/Document/formGenerator.vue')
  263. }
  264. ]
  265. }
  266. ]
  267. }
  268. // must status 404
  269. // Always leave this as last one,
  270. // but you can also remove it
  271. // {
  272. // path: '/404/:catchAll(.*)*',
  273. // name: 'NotFound',
  274. // component:
  275. // () => import('src/pages/Error404.vue')
  276. // }
  277. ]
  278. export default routes