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 { 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';
25 import UIClient from '@/composables/UIClient';
27 const UIClientInstance = UIClient.getInstance();
30 UIClientInstance.registerWSonOpenListener(load);
35 chargingStations: ChargingStationData[];
39 const state: State = reactive({
45 async function load(): Promise<void> {
46 if (state.isLoading === true) return;
47 state.isLoading = true;
48 const listChargingStationsPayload = await UIClientInstance.listChargingStations();
49 state.chargingStations =
50 listChargingStationsPayload.chargingStations as unknown as ChargingStationData[];
51 state.isLoading = false;
54 function startSimulator(): void {
55 UIClientInstance.startSimulator();
57 function stopSimulator(): void {
58 UIClientInstance.stopSimulator();
67 background-color: rgb(233, 227, 227);
69 flex-direction: column;
75 justify-content: space-between;
81 background-color: rgb(25, 118, 210);
88 #reload-button:hover {
89 background-color: rgb(10, 113, 195);
92 #reload-button:active {
93 background-color: rgb(255, 113, 195);