routes.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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: false,
  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: 'Public.AllClassrooms', path: 'all-classrooms', component: () => import('src/pages/Public/classrooms.vue') },
  85. { name: 'Public.ShowClassroomInfo', path: 'classroom/:id', component: () => import('src/pages/Public/ShowClassroomInfo.vue') }
  86. ]
  87. },
  88. {
  89. path: 'panel',
  90. name: 'UserPanel',
  91. layoutConfig: {
  92. layoutView: 'hHh LpR fFf',
  93. layoutHeaderType: 'admin',
  94. layoutHeaderBordered: true,
  95. layoutLeftDrawer: true,
  96. layoutLeftDrawerVisible: true,
  97. layoutLeftSideBarType: 'admin',
  98. layoutLeftDrawerBordered: true,
  99. layoutLeftDrawerWidth: 240,
  100. layoutFooter: false
  101. },
  102. meta: { middlewares: [Authenticated, canSeeUserProfilePanel] },
  103. component: () => import('src/layouts/bareLayout.vue'),
  104. children: [
  105. {
  106. name: 'UserPanel.ShopCompleteInfo',
  107. path: 'shop/completeInfo',
  108. layoutConfig: {
  109. layoutView: 'hHh LpR fFf',
  110. layoutHeaderType: 'admin',
  111. layoutHeaderBordered: true,
  112. layoutLeftDrawer: false,
  113. layoutLeftDrawerVisible: false,
  114. layoutLeftSideBarType: 'admin',
  115. layoutLeftDrawerBordered: true,
  116. layoutLeftDrawerWidth: 240,
  117. layoutFooter: false
  118. },
  119. meta: { middlewares: [Authenticated] },
  120. component: () => import('src/pages/User/Shop/completeInfo.vue')
  121. },
  122. {
  123. name: 'UserPanel.ShopPaymentFromWallet',
  124. path: 'shop/payment-from-wallet',
  125. meta: { middlewares: [Authenticated] },
  126. component: () => import('src/pages/User/Shop/paymentFromWallet.vue')
  127. },
  128. {
  129. name: 'UserPanel.PaymentResult',
  130. path: 'shop/payment-result',
  131. meta: { middlewares: [Authenticated] },
  132. component: () => import('src/pages/User/Shop/paymentResult.vue')
  133. },
  134. {
  135. path: 'profile',
  136. name: 'UserPanel.Profile',
  137. component: () => import('src/layouts/UserPanelLayout.vue'),
  138. meta: { middlewares: [Authenticated] },
  139. children: [
  140. { name: 'UserPanel.Profile.AllClassrooms', path: 'all-classrooms', component: () => import('src/pages/User/Profile/classrooms.vue') },
  141. { name: 'UserPanel.Profile.ClassroomInfo', path: 'classroom/:id', component: () => import('src/pages/User/Profile/classroomInfo.vue') },
  142. { name: 'UserPanel.Profile.SessionInfo', path: 'session/:id', component: () => import('src/pages/User/Profile/sessionInfo.vue') },
  143. { name: 'UserPanel.Profile.UserInfo', path: 'user-info', component: () => import('src/pages/User/Profile/profile.vue') }
  144. ]
  145. }
  146. ]
  147. },
  148. {
  149. path: 'admin',
  150. name: 'Admin',
  151. layoutConfig: {
  152. layoutView: 'hHh LpR fFf',
  153. layoutHeaderType: 'admin',
  154. layoutHeaderBordered: true,
  155. layoutLeftDrawer: true,
  156. layoutLeftDrawerVisible: true,
  157. layoutLeftSideBarType: 'admin',
  158. layoutLeftDrawerBordered: true,
  159. layoutLeftDrawerWidth: 240,
  160. layoutFooter: false
  161. },
  162. meta: { middlewares: [Authenticated, canSeeAdminPanel] },
  163. component: () => import('src/layouts/AdminLayout.vue'),
  164. children: [
  165. {
  166. name: 'Admin.Settings',
  167. path: 'settings',
  168. component: () => import('src/pages/Admin/Settings.vue'),
  169. breadcrumbs: { title: 'تنظیمات' }
  170. },
  171. {
  172. name: 'Admin.User',
  173. path: 'users',
  174. component: () => import('layouts/bareLayout.vue'),
  175. breadcrumbs: { title: 'کاربران' },
  176. children: [
  177. { name: 'Admin.User.Index', path: '', component: () => import('src/pages/Admin/User/index.vue') },
  178. { name: 'Admin.User.Show', path: ':id', component: () => import('src/pages/Admin/User/show.vue'), breadcrumbs: { title: 'اطلاعات کاربری' } }
  179. ]
  180. },
  181. {
  182. name: 'Admin.Category',
  183. path: 'categories',
  184. component: () => import('layouts/bareLayout.vue'),
  185. breadcrumbs: { title: 'دسته بندی ها' },
  186. children: [
  187. { name: 'Admin.Category.Index', path: '', component: () => import('src/pages/Admin/Category/index.vue') },
  188. { name: 'Admin.Category.Create', path: 'create', component: () => import('src/pages/Admin/Category/create.vue') },
  189. { name: 'Admin.Category.Show', path: ':id', component: () => import('src/pages/Admin/Category/show.vue') }
  190. ]
  191. },
  192. {
  193. name: 'Admin.Unit',
  194. path: 'units',
  195. component: () => import('src/layouts/bareLayout.vue'),
  196. breadcrumbs: { title: 'طلیعه حکمت' },
  197. children: [
  198. // { name: 'Admin.Category.Index', path: '', component: () => import('src/pages/Admin/Category/index.vue') },
  199. // { name: 'Admin.Category.Create', path: 'create', component: () => import('src/pages/Admin/Category/create.vue') },
  200. { name: 'Admin.Unit.Show', path: ':id', component: () => import('src/pages/Admin/Unit/show.vue'), breadcrumbs: { title: 'درس' } }
  201. ]
  202. },
  203. {
  204. name: 'Admin.SessionTemplate',
  205. path: 'sessionTemplates',
  206. component: () => import('layouts/bareLayout.vue'),
  207. breadcrumbs: { title: 'طلیعه حکمت' },
  208. children: [
  209. { name: 'Admin.SessionTemplate.Index', path: '', component: () => import('src/pages/Admin/SessionTemplate/index.vue') },
  210. { name: 'Admin.SessionTemplate.Create', path: 'create', component: () => import('src/pages/Admin/SessionTemplate/create.vue') },
  211. { name: 'Admin.SessionTemplate.Show', path: ':id', component: () => import('src/pages/Admin/SessionTemplate/show.vue') }
  212. ]
  213. },
  214. {
  215. name: 'Admin.Classroom',
  216. path: 'classrooms',
  217. component: () => import('layouts/bareLayout.vue'),
  218. breadcrumbs: { title: 'دوره های آموزشی', route: { name: 'Admin.Classroom.Index' } },
  219. children: [
  220. { name: 'Admin.Classroom.Index', path: '', component: () => import('src/pages/Admin/Classroom/index.vue') },
  221. { name: 'Admin.Classroom.Create', path: 'create', component: () => import('src/pages/Admin/Classroom/create.vue'), breadcrumbs: { title: 'ساخت دوره آموزشی' } },
  222. { name: 'Admin.Classroom.Show', path: ':id', component: () => import('src/pages/Admin/Classroom/show.vue'), breadcrumbs: { title: 'مشاهده اطلاعات دوره آموزشی' } }
  223. ]
  224. },
  225. {
  226. name: 'Admin.Session',
  227. path: 'session',
  228. component: () => import('layouts/bareLayout.vue'),
  229. breadcrumbs: { title: 'طلیعه حکمت' },
  230. children: [
  231. { name: 'Admin.Session.Index', path: '', component: () => import('src/pages/Admin/Session/index.vue') },
  232. { name: 'Admin.Session.Create', path: 'create', component: () => import('src/pages/Admin/Session/create.vue') },
  233. { name: 'Admin.Session.Show', path: ':id', component: () => import('src/pages/Admin/Session/show.vue') }
  234. ]
  235. }
  236. ]
  237. },
  238. {
  239. path: 'document',
  240. name: 'Document',
  241. component: () => import('layouts/bareLayout.vue'),
  242. children: [
  243. {
  244. path: 'component',
  245. name: 'component',
  246. component: () => import('src/pages/Document/component.vue'),
  247. breadcrumbs: { title: 'component' },
  248. meta: {
  249. middlewares: [Authenticated]
  250. }
  251. },
  252. {
  253. path: 'theme',
  254. name: 'Document.Theme',
  255. component: () => import('layouts/bareLayout.vue'),
  256. breadcrumbs: { title: 'Theme' },
  257. children: [
  258. {
  259. path: 'controls',
  260. name: 'Document.Theme.Controls',
  261. component: () => import('src/pages/Document/Theme/Controls.vue'),
  262. breadcrumbs: { title: 'Controls' }
  263. }
  264. ]
  265. },
  266. {
  267. path: 'debug',
  268. name: 'Document.Debug',
  269. component: () => import('src/pages/Document/debug.vue')
  270. },
  271. {
  272. path: 'icon-sax',
  273. name: 'Document.IconSax',
  274. component: () => import('src/pages/Document/IconSax.vue')
  275. },
  276. {
  277. path: '/form-generator',
  278. name: 'formGenerator',
  279. component: () => import('src/pages/Document/formGenerator.vue')
  280. }
  281. ]
  282. }
  283. ]
  284. }
  285. // must status 404
  286. // Always leave this as last one,
  287. // but you can also remove it
  288. // {
  289. // path: '/404/:catchAll(.*)*',
  290. // name: 'NotFound',
  291. // component:
  292. // () => import('src/pages/Error404.vue')
  293. // }
  294. ]
  295. export default routes