2 <Container id="charging-stations">
3 <Button id="simulator-button" @click="startSimulator()">Start Simulator</Button>
4 <Button id="simulator-button" @click="stopSimulator()">Stop Simulator</Button>
5 <Container id="inputs-container">
11 placeholder="RFID tag"
13 <ReloadButton id="reload-button" :loading="state.isLoading" @click="load()" />
15 <CSTable :charging-stations="state.chargingStations" :id-tag="state.idTag" />
19 <script setup lang="ts">
20 import { getCurrentInstance, onMounted, reactive } from 'vue'
21 import CSTable from '@/components/charging-stations/CSTable.vue'
22 import type { ChargingStationData } from '@/types'
23 import Container from '@/components/Container.vue'
24 import ReloadButton from '@/components/buttons/ReloadButton.vue'
26 const UIClient = getCurrentInstance()?.appContext.config.globalProperties.$UIClient
29 UIClient.registerWSonOpenListener(load)
34 chargingStations: ChargingStationData[]
38 const state: State = reactive({
44 async function load(): Promise<void> {
45 if (state.isLoading === false) {
46 state.isLoading = true
47 state.chargingStations = (await UIClient.listChargingStations())
48 .chargingStations as ChargingStationData[]
49 state.isLoading = false
53 function startSimulator(): void {
54 UIClient.startSimulator()
56 function stopSimulator(): void {
57 UIClient.stopSimulator()
65 background-color: rgb(233, 227, 227);
67 flex-direction: column;
72 justify-content: space-between;
77 background-color: rgb(25, 118, 210);
83 #reload-button:hover {
84 background-color: rgb(10, 113, 195);
87 #reload-button:active {
88 background-color: rgb(255, 113, 195);