-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrouter.js
94 lines (89 loc) · 2.15 KB
/
router.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import Vue from 'vue';
import Router from 'vue-router';
import Index from '@/pages/index.vue';
import BuildingsList from '@/pages/buildings.vue';
import ConsumptionReport from '@/pages/report.vue';
import UsersList from '@/pages/users.vue';
import ServersList from '@/pages/servers.vue';
import LoginPage from '@/pages/login.vue';
import AccessDenied from '@/pages/denied.vue';
import SingleBuilding from '@/components/SingleBuilding.vue';
import ScadaServer from '@/components/ScadaServer.vue';
import ScadaComm from '@/components/ScadaComm.vue';
import CommLine from '@/components/CommLine.vue';
Vue.use(Router);
export const appRoutes = [{
path: '/',
component: Index,
meta: { title: 'Index', icon: 'mdi-apps', showInNav: true },
}, {
path: '/login',
component: LoginPage
}, {
path: '/denied',
component: AccessDenied
}, {
path: '/buildings',
component: BuildingsList,
meta: {
title: 'Buildings',
icon: 'mdi-city',
showInNav: true,
roles: ['Admin', 'Operator'],
},
}, {
path: '/report',
component: ConsumptionReport,
meta: {
title: 'Report',
icon: 'mdi-table-large',
showInNav: true,
roles: ['Admin', 'Operator'],
},
}, {
path: '/users',
component: UsersList,
meta: {
title: 'Users',
icon: 'mdi-account-multiple',
showInNav: true,
roles: ['Admin'],
},
}, {
path: '/building/:id/:mode?',
component: SingleBuilding,
name: 'building-route',
props: true,
meta: { roles: ['Admin', 'Operator'] },
}, {
path: '/servers',
component: ServersList,
meta: {
title: 'Servers',
icon: 'mdi-file-tree-outline',
showInNav: true,
roles: ['Admin'],
},
}, {
path: '/server/:id',
component: ScadaServer,
props: true,
meta: { roles: ['Admin'] }
}, {
path: '/comm/:id',
component: ScadaComm,
props: true,
meta: { roles: ['Admin'] }
}, {
path: '/commLine/:id',
component: CommLine,
props: true,
meta: { roles: ['Admin'] }
},
];
export function createRouter() {
return new Router({
mode: 'history',
routes: appRoutes,
});
}