X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=ui%2Fweb%2Fsrc%2Frouter%2Findex.ts;h=0d250c5101a48e6402934fad6a038f7c64dac78e;hb=c317ae3edbd335e6dc52616df7d702c0d8419fd4;hp=4a52c411a0cbc7ce4cb575414546c6236d07b45c;hpb=0f71040c472ecc24460c7bf791c35a9e9fbef27c;p=e-mobility-charging-stations-simulator.git diff --git a/ui/web/src/router/index.ts b/ui/web/src/router/index.ts index 4a52c411..0d250c51 100644 --- a/ui/web/src/router/index.ts +++ b/ui/web/src/router/index.ts @@ -1,17 +1,34 @@ -import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'; -import ChargingStationsView from '@/views/ChargingStationsView.vue'; +import { createRouter, createWebHistory } from 'vue-router' +import ChargingStationsView from '@/views/ChargingStationsView.vue' +import StartTransaction from '@/components/actions/StartTransaction.vue' +import AddChargingStations from '@/components/actions/AddChargingStations.vue' -const routes: RouteRecordRaw[] = [ - { - path: '/', - name: 'charging-stations', - component: ChargingStationsView, - }, -]; - -const router = createRouter({ - history: createWebHistory(process.env.BASE_URL), - routes, -}); - -export default router; +export const router = createRouter({ + history: createWebHistory(), + routes: [ + { + path: '/', + name: 'charging-stations', + components: { + default: ChargingStationsView + } + }, + { + path: '/add-charging-stations', + name: 'add-charging-stations', + components: { + default: ChargingStationsView, + action: AddChargingStations + } + }, + { + path: '/start-transaction/:hashId/:chargingStationId/:connectorId', + name: 'start-transaction', + components: { + default: ChargingStationsView, + action: StartTransaction + }, + props: { default: false, action: true } + } + ] +})