refactor(ui): resize buttons bar
[e-mobility-charging-stations-simulator.git] / ui / web / src / router / index.ts
index b58a4d2a506d7e5f9c9f94a153bd1d7a7d0061ee..cee4f416eb51cf9c5659bcd150bed263a7bfef7f 100644 (file)
@@ -1,17 +1,53 @@
-import { type RouteRecordRaw, createRouter, createWebHistory } from 'vue-router'
-import ChargingStationsView from '@/views/ChargingStationsView.vue'
+import { createRouter, createWebHistory } from 'vue-router'
 
-const routes: RouteRecordRaw[] = [
-  {
-    path: '/',
-    name: 'charging-stations',
-    component: ChargingStationsView,
-  },
-]
+import AddChargingStations from '@/components/actions/AddChargingStations.vue'
+import SetSupervisionUrl from '@/components/actions/SetSupervisionUrl.vue'
+import StartTransaction from '@/components/actions/StartTransaction.vue'
+import ChargingStationsView from '@/views/ChargingStationsView.vue'
+import NotFoundView from '@/views/NotFoundView.vue'
 
-const router = createRouter({
+export const router = createRouter({
   history: createWebHistory(),
-  routes,
+  routes: [
+    {
+      path: '/',
+      name: 'charging-stations',
+      components: {
+        default: ChargingStationsView
+      }
+    },
+    {
+      path: '/add-charging-stations',
+      name: 'add-charging-stations',
+      components: {
+        default: ChargingStationsView,
+        action: AddChargingStations
+      }
+    },
+    {
+      path: '/set-supervision-url/:hashId/:chargingStationId',
+      name: 'set-supervision-url',
+      components: {
+        default: ChargingStationsView,
+        action: SetSupervisionUrl
+      },
+      props: { default: false, action: true }
+    },
+    {
+      path: '/start-transaction/:hashId/:chargingStationId/:connectorId',
+      name: 'start-transaction',
+      components: {
+        default: ChargingStationsView,
+        action: StartTransaction
+      },
+      props: { default: false, action: true }
+    },
+    {
+      name: 'not-found',
+      path: '/:pathMatch(.*)*',
+      components: {
+        default: NotFoundView
+      }
+    }
+  ]
 })
-
-export default router