PluginProbe
The Innovative Form Builder – IvyForms / 0.1.2
The Innovative Form Builder – IvyForms v0.1.2
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / frontend / src / router / index.ts

index.ts in The Innovative Form Builder – IvyForms 0.1.2, at frontend/src/router/index.ts

92 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import type { RouteRecordRaw } from 'vue-router'
2 import { createWebHashHistory, createRouter } from 'vue-router'
3 import DashboardPage from '../views/admin/dashboard/dashboard-page/DashboardPage.vue'
4 import FormsPage from '../views/admin/forms/forms-page/FormsPage.vue'
5 import FormBuilderPage from '../views/admin/form-builder/form-builder-page/FormBuilderPage.vue'
6 import FormBuilderSettingsPage from '../views/admin/form-builder/form-builder-page/FormBuilderSettingsPage.vue'
7 import FormBuilderManageNotification from '../views/admin/form-builder/form-builder-page/form-settings-notification/FormBuilderManageNotification.vue'
8 import FormBuilderSettings from '../views/admin/form-builder/form-builder-page/form-settings/FormBuilderSettings.vue'
9 import FormBuilderNotificationTable from '../views/admin/form-builder/form-builder-page/form-settings-notification/FormBuilderNotificationTable.vue'
10 import FormBuilderConfirmation from '../views/admin/form-builder/form-builder-page/form-settings-confirmations/FormBuilderConfirmation.vue'
11
12 const currentPage = new URLSearchParams(window.location.search).get('page')
13
14 let routes: RouteRecordRaw[] = []
15
16 if (currentPage === 'ivyforms-dashboard') {
17 routes = [{ path: '/', name: 'Dashboard', component: DashboardPage }]
18 }
19
20 if (currentPage === 'ivyforms-forms') {
21 routes = [{ path: '/', name: 'AllForms', component: FormsPage }]
22 }
23
24 if (currentPage === 'ivyforms-builder') {
25 routes = [
26 {
27 path: '/',
28 name: 'AddForm',
29 component: FormBuilderPage,
30 children: [
31 {
32 path: '/manage/:id(\\d+)',
33 name: 'EditForm',
34 component: FormBuilderPage,
35 },
36 ],
37 },
38
39 {
40 path: '/settings',
41 name: 'Settings',
42 component: FormBuilderSettingsPage,
43 children: [
44 {
45 path: 'general',
46 name: 'FormSettings',
47 component: FormBuilderSettings,
48 },
49 {
50 path: 'general/manage/:id(\\d+)',
51 name: 'FormSetting',
52 component: FormBuilderSettings,
53 },
54 {
55 path: 'notification/:id(\\d+)',
56 name: 'FormNotifications',
57 component: FormBuilderNotificationTable,
58 },
59 {
60 path: 'notification/manage',
61 name: 'NewNotifications',
62 component: FormBuilderManageNotification,
63 },
64 {
65 path: 'notification/manage/:id(\\d+)?',
66 name: 'EditNotifications',
67 component: FormBuilderManageNotification,
68 },
69 {
70 path: 'confirmation/manage/:id(\\d+)',
71 name: 'FormConfirmation',
72 component: FormBuilderConfirmation,
73 },
74 ],
75 },
76 ]
77 }
78
79 // if (currentPage === 'ivyforms-settings') {
80 // routes = [{ path: '/', name: 'Settings', component: SettingsPage }]
81 // }
82 //
83 // if (currentPage === 'ivyforms-testing') {
84 // routes = [{ path: '/', name: 'Testing', component: TestingPage }]
85 // }
86
87 const router = createRouter({
88 history: createWebHashHistory(),
89 routes,
90 })
91 export default router
92