<template>
<router-view />
- <Container v-show="$route.path !== '/'" id="action-container">
+ <Container
+ v-show="$route.name !== 'charging-stations' && $route.name !== 'not-found'"
+ id="action-container"
+ >
<router-view name="action" />
</Container>
</template>
import StartTransaction from '@/components/actions/StartTransaction.vue'
import AddChargingStations from '@/components/actions/AddChargingStations.vue'
import SetSupervisionUrl from '@/components/actions/SetSupervisionUrl.vue'
+import NotFoundView from '@/views/NotFoundView.vue'
export const router = createRouter({
history: createWebHistory(),
action: StartTransaction
},
props: { default: false, action: true }
+ },
+ {
+ name: 'not-found',
+ path: '/:pathMatch(.*)*',
+ components: {
+ default: NotFoundView
+ }
}
]
})
() => {
setToLocalStorage<number>('uiServerConfigurationIndex', state.uiServerIndex)
clearToggleButtons()
- $router.currentRoute.value.name !== 'charging-stations' &&
+ $route.name !== 'charging-stations' &&
$router.push({ name: 'charging-stations' })
},
{ once: true }
--- /dev/null
+<template><Container id="not-found">404 - Not found</Container></template>
+
+<script setup lang="ts">
+import Container from '@/components/Container.vue'
+</script>
+
+<style>
+#not-found {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-size: 2rem;
+ font-weight: bold;
+}
+</style>