Mercurial > gemma
comparison client/src/router.js @ 1671:89b38d7e7b6a
included bundleanalyzer buildstep
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Mon, 24 Dec 2018 13:58:01 +0100 |
parents | 2ee243f9a7ee |
children | 68bd990dd8e5 |
comparison
equal
deleted
inserted
replaced
1670:c344849538c0 | 1671:89b38d7e7b6a |
---|---|
18 import store from "./store"; | 18 import store from "./store"; |
19 import { sessionStillActive, toMillisFromString } from "./lib/session"; | 19 import { sessionStillActive, toMillisFromString } from "./lib/session"; |
20 | 20 |
21 /* facilitate codesplitting */ | 21 /* facilitate codesplitting */ |
22 const Login = () => import("./components/Login.vue"); | 22 const Login = () => import("./components/Login.vue"); |
23 const Main = () => import("./components/Main.vue"); | |
24 const Usermanagement = () => | |
25 import("./components/usermanagement/Usermanagement.vue"); | |
26 const Logs = () => import("./components/Logs.vue"); | |
27 const Importqueue = () => import("./components/importqueue/Importqueue.vue"); | |
28 const Importschedule = () => | |
29 import("./components/importschedule/Importschedule.vue"); | |
30 const Systemconfiguration = () => | |
31 import("./components/Systemconfiguration.vue"); | |
32 const Importsoundingresults = () => | |
33 import("./components/ImportSoundingresults.vue"); | |
34 | |
35 const Importstretches = () => import("./components/ImportStretches.vue"); | |
36 | 23 |
37 Vue.use(Router); | 24 Vue.use(Router); |
38 | 25 |
39 const router = new Router({ | 26 const router = new Router({ |
40 routes: [ | 27 routes: [ |
44 component: Login | 31 component: Login |
45 }, | 32 }, |
46 { | 33 { |
47 path: "/usermanagement", | 34 path: "/usermanagement", |
48 name: "usermanagement", | 35 name: "usermanagement", |
49 component: Usermanagement, | 36 component: () => import("./components/usermanagement/Usermanagement.vue"), |
50 meta: { | 37 meta: { |
51 requiresAuth: true | 38 requiresAuth: true |
52 }, | 39 }, |
53 beforeEnter: (to, from, next) => { | 40 beforeEnter: (to, from, next) => { |
54 const isSysadmin = store.getters["user/isSysAdmin"]; | 41 const isSysadmin = store.getters["user/isSysAdmin"]; |
60 } | 47 } |
61 }, | 48 }, |
62 { | 49 { |
63 path: "/logs", | 50 path: "/logs", |
64 name: "logs", | 51 name: "logs", |
65 component: Logs, | 52 component: () => import("./components/Logs.vue"), |
66 meta: { | 53 meta: { |
67 requiresAuth: true | 54 requiresAuth: true |
68 }, | 55 }, |
69 beforeEnter: (to, from, next) => { | 56 beforeEnter: (to, from, next) => { |
70 const isSysadmin = store.getters["user/isSysAdmin"]; | 57 const isSysadmin = store.getters["user/isSysAdmin"]; |
76 } | 63 } |
77 }, | 64 }, |
78 { | 65 { |
79 path: "/systemconfiguration", | 66 path: "/systemconfiguration", |
80 name: "systemconfiguration", | 67 name: "systemconfiguration", |
81 component: Systemconfiguration, | 68 component: () => import("./components/Systemconfiguration.vue"), |
82 meta: { | 69 meta: { |
83 requiresAuth: true | 70 requiresAuth: true |
84 }, | 71 }, |
85 beforeEnter: (to, from, next) => { | 72 beforeEnter: (to, from, next) => { |
86 const isSysadmin = store.getters["user/isSysAdmin"]; | 73 const isSysadmin = store.getters["user/isSysAdmin"]; |
92 } | 79 } |
93 }, | 80 }, |
94 { | 81 { |
95 path: "/importqueue", | 82 path: "/importqueue", |
96 name: "importqueue", | 83 name: "importqueue", |
97 component: Importqueue, | 84 component: () => import("./components/importqueue/Importqueue.vue"), |
98 meta: { | 85 meta: { |
99 requiresAuth: true | 86 requiresAuth: true |
100 }, | 87 }, |
101 beforeEnter: (to, from, next) => { | 88 beforeEnter: (to, from, next) => { |
102 const isWaterwayAdmin = store.getters["user/isWaterwayAdmin"]; | 89 const isWaterwayAdmin = store.getters["user/isWaterwayAdmin"]; |
108 } | 95 } |
109 }, | 96 }, |
110 { | 97 { |
111 path: "/importsoundingresults", | 98 path: "/importsoundingresults", |
112 name: "importsoundingresults", | 99 name: "importsoundingresults", |
113 component: Importsoundingresults, | 100 component: () => import("./components/ImportSoundingresults.vue"), |
114 meta: { | 101 meta: { |
115 requiresAuth: true | 102 requiresAuth: true |
116 }, | 103 }, |
117 beforeEnter: (to, from, next) => { | 104 beforeEnter: (to, from, next) => { |
118 const isWaterwayAdmin = store.getters["user/isWaterwayAdmin"]; | 105 const isWaterwayAdmin = store.getters["user/isWaterwayAdmin"]; |
124 } | 111 } |
125 }, | 112 }, |
126 { | 113 { |
127 path: "/importstretches", | 114 path: "/importstretches", |
128 name: "importstretches", | 115 name: "importstretches", |
129 component: Importstretches, | 116 component: () => import("./components/ImportStretches.vue"), |
130 meta: { | 117 meta: { |
131 requiresAuth: true | 118 requiresAuth: true |
132 }, | 119 }, |
133 beforeEnter: (to, from, next) => { | 120 beforeEnter: (to, from, next) => { |
134 const isWaterwayAdmin = store.getters["user/isWaterwayAdmin"]; | 121 const isWaterwayAdmin = store.getters["user/isWaterwayAdmin"]; |
140 } | 127 } |
141 }, | 128 }, |
142 { | 129 { |
143 path: "/importschedule", | 130 path: "/importschedule", |
144 name: "importschedule", | 131 name: "importschedule", |
145 component: Importschedule, | 132 component: () => import("./components/importschedule/Importschedule.vue"), |
146 meta: { | 133 meta: { |
147 requiresAuth: true | 134 requiresAuth: true |
148 }, | 135 }, |
149 beforeEnter: (to, from, next) => { | 136 beforeEnter: (to, from, next) => { |
150 const isWaterwayAdmin = store.getters["user/isWaterwayAdmin"]; | 137 const isWaterwayAdmin = store.getters["user/isWaterwayAdmin"]; |
156 } | 143 } |
157 }, | 144 }, |
158 { | 145 { |
159 path: "/", | 146 path: "/", |
160 name: "mainview", | 147 name: "mainview", |
161 component: Main, | 148 component: () => import("./components/Main.vue"), |
162 meta: { | 149 meta: { |
163 requiresAuth: true | 150 requiresAuth: true |
164 }, | 151 }, |
165 beforeEnter: (to, from, next) => { | 152 beforeEnter: (to, from, next) => { |
166 const expiresFromPastSession = toMillisFromString( | 153 const expiresFromPastSession = toMillisFromString( |