feat(ui): add 'Not found' catch all
[e-mobility-charging-stations-simulator.git] / ui / web / src / router / index.ts
CommitLineData
13c19b7b 1import { createRouter, createWebHistory } from 'vue-router'
66a7748d 2import ChargingStationsView from '@/views/ChargingStationsView.vue'
c317ae3e
JB
3import StartTransaction from '@/components/actions/StartTransaction.vue'
4import AddChargingStations from '@/components/actions/AddChargingStations.vue'
f8696170 5import SetSupervisionUrl from '@/components/actions/SetSupervisionUrl.vue'
877b880c 6import NotFoundView from '@/views/NotFoundView.vue'
32de5a57 7
13c19b7b 8export const router = createRouter({
2cddfd51 9 history: createWebHistory(),
13c19b7b
JB
10 routes: [
11 {
12 path: '/',
13 name: 'charging-stations',
14 components: {
15 default: ChargingStationsView
16 }
c317ae3e
JB
17 },
18 {
19 path: '/add-charging-stations',
20 name: 'add-charging-stations',
21 components: {
22 default: ChargingStationsView,
23 action: AddChargingStations
24 }
25 },
f8696170
JB
26 {
27 path: '/set-supervision-url/:hashId/:chargingStationId',
28 name: 'set-supervision-url',
29 components: {
30 default: ChargingStationsView,
31 action: SetSupervisionUrl
32 },
33 props: { default: false, action: true }
34 },
c317ae3e
JB
35 {
36 path: '/start-transaction/:hashId/:chargingStationId/:connectorId',
37 name: 'start-transaction',
38 components: {
39 default: ChargingStationsView,
40 action: StartTransaction
41 },
42 props: { default: false, action: true }
877b880c
JB
43 },
44 {
45 name: 'not-found',
46 path: '/:pathMatch(.*)*',
47 components: {
48 default: NotFoundView
49 }
13c19b7b
JB
50 }
51 ]
66a7748d 52})