<script setup lang="ts">
import { getCurrentInstance } from 'vue'
import CSConnector from '@/components/charging-stations/CSConnector.vue'
+import Button from '@/components/buttons/Button.vue'
import type { ChargingStationData, ConnectorStatus, Status } from '@/types'
const props = defineProps<{
import { createApp } from 'vue'
import type { ConfigurationData } from './types'
-import router from '@/router'
+import { router } from '@/router'
import { UIClient } from '@/composables'
import App from '@/App.vue'
-import { type RouteRecordRaw, createRouter, createWebHistory } from 'vue-router'
+import { createRouter, createWebHistory } from 'vue-router'
import ChargingStationsView from '@/views/ChargingStationsView.vue'
-const routes: RouteRecordRaw[] = [
- {
- path: '/',
- name: 'charging-stations',
- component: ChargingStationsView
- }
-]
-
-const router = createRouter({
+export const router = createRouter({
history: createWebHistory(),
- routes
+ routes: [
+ {
+ path: '/',
+ name: 'charging-stations',
+ components: {
+ default: ChargingStationsView
+ }
+ }
+ ]
})
-
-export default router
<template>
<Container id="charging-stations">
- <Button id="simulator-button" @click="startSimulator()">Start Simulator</Button>
- <Button id="simulator-button" @click="stopSimulator()">Stop Simulator</Button>
+ <Container id="buttons-container">
+ <Button id="simulator-button" @click="startSimulator()">Start Simulator</Button>
+ <Button id="simulator-button" @click="stopSimulator()">Stop Simulator</Button>
+ <ReloadButton id="reload-button" :loading="state.isLoading" @click="load()" />
+ </Container>
<Container id="inputs-container">
<input
id="idtag-field"
name="idtag-field"
placeholder="RFID tag"
/>
- <ReloadButton id="reload-button" :loading="state.isLoading" @click="load()" />
</Container>
<CSTable :charging-stations="state.chargingStations" :id-tag="state.idTag" />
</Container>
import type { ChargingStationData } from '@/types'
import Container from '@/components/Container.vue'
import ReloadButton from '@/components/buttons/ReloadButton.vue'
+import Button from '@/components/buttons/Button.vue'
const UIClient = getCurrentInstance()?.appContext.config.globalProperties.$UIClient
flex-direction: column;
}
+#buttons-container {
+ display: flex;
+ flex-direction: row;
+}
+
#inputs-container {
display: flex;
flex-direction: row;
flex: auto;
color: white;
background-color: blue;
- font-size: 2rem;
+ font-size: 1.5rem;
font-weight: bold;
+ text-align: center;
}
#reload-button:hover {
#idtag-field {
flex: auto;
+ font-size: 1.5rem;
text-align: center;
}
</style>