UI server: add basic authentication support
[e-mobility-charging-stations-simulator.git] / src / ui / web / src / views / ChargingStationsView.vue
index bf11e1a450effb6bd886b74fd04f23658578a90b..25ea51d9bc02549c1526725e9f5e92b9fde96e5e 100644 (file)
@@ -33,21 +33,22 @@ onMounted(() => {
 
 type State = {
   isLoading: boolean;
-  chargingStations: Record<string, ChargingStationData>;
+  chargingStations: ChargingStationData[];
   idTag: string;
 };
 
 const state: State = reactive({
   isLoading: false,
-  chargingStations: {},
+  chargingStations: [],
   idTag: '',
 });
 
 async function load(): Promise<void> {
   if (state.isLoading === true) return;
   state.isLoading = true;
-  const chargingStationsList = await UIClientInstance.listChargingStations();
-  state.chargingStations = chargingStationsList as unknown as Record<string, ChargingStationData>;
+  const listChargingStationsPayload = await UIClientInstance.listChargingStations();
+  state.chargingStations =
+    listChargingStationsPayload.chargingStations as unknown as ChargingStationData[];
   state.isLoading = false;
 }
 
@@ -77,10 +78,9 @@ function stopSimulator(): void {
 
 #reload-button {
   flex: auto;
-  padding: 6px 14px;
+  padding: 5px 15px;
   background-color: rgb(25, 118, 210);
   border-radius: 5px;
-
   color: white;
   font-size: 35px;
   font-weight: bold;