build: properly workaround Ajv TS type definitions bug
[e-mobility-charging-stations-simulator.git] / ui / web / src / components / charging-stations / CSTable.vue
... / ...
CommitLineData
1<template>
2 <table id="cs-table">
3 <caption>
4 Charging stations
5 </caption>
6 <thead id="cs-table__head">
7 <tr class="cs-table__row">
8 <th scope="col" class="cs-table__action-col">Action</th>
9 <th scope="col" class="cs-table__connector-col">Connector</th>
10 <th scope="col" class="cs-table__status-col">Status</th>
11 <th scope="col" class="cs-table__transaction-col">Transaction</th>
12 <th scope="col" class="cs-table__name-col">Name</th>
13 <th scope="col" class="cs-table__started-col">Started</th>
14 <th scope="col" class="cs-table__wsState-col">WebSocket State</th>
15 <th scope="col" class="cs-table__registration-status-col">Registration Status</th>
16 <th scope="col" class="cs-table__vendor-col">Vendor</th>
17 <th scope="col" class="cs-table__model-col">Model</th>
18 <th scope="col" class="cs-table__firmware-col">Firmware Version</th>
19 </tr>
20 </thead>
21 <tbody id="cs-table__body">
22 <CSData
23 v-for="chargingStation in props.chargingStations"
24 :key="chargingStation.stationInfo?.hashId"
25 :charging-station="chargingStation"
26 :id-tag="props.idTag"
27 />
28 </tbody>
29 </table>
30</template>
31
32<script setup lang="ts">
33import CSData from './CSData.vue';
34import type { ChargingStationData } from '@/types';
35
36const props = defineProps<{
37 chargingStations: ChargingStationData[];
38 idTag: string;
39}>();
40</script>
41
42<style>
43#cs-table {
44 height: 100%;
45 width: 100%;
46 background-color: white;
47 display: flex;
48 flex-grow: 1;
49 flex-direction: column;
50 overflow: auto hidden;
51 border-collapse: collapse;
52 empty-cells: show;
53}
54
55#cs-table__head,
56#cs-table__body {
57 height: fit-content;
58 width: 100%;
59 min-width: 100%;
60 display: block;
61}
62
63#cs-table__body {
64 overflow: visible overlay;
65 flex-grow: 1;
66}
67
68.cs-table__row {
69 width: 100%;
70 display: flex;
71 justify-content: center;
72 align-items: center;
73}
74
75#cs-table__head .cs-table__row {
76 background-color: rgb(194, 188, 188);
77}
78
79.cs-table__row:nth-of-type(even) {
80 background-color: rgb(223, 217, 217);
81}
82
83.cs-table__action-col,
84.cs-table__connector-col,
85.cs-table__status-col,
86.cs-table__transaction-col,
87.cs-table__name-col,
88.cs-table__started-col,
89.cs-table__wsState-col,
90.cs-table__registration-status-col,
91.cs-table__model-col,
92.cs-table__vendor-col,
93.cs-table__firmware-col {
94 height: 0.1%;
95 width: 20%;
96 padding-top: 0.2%;
97 padding-bottom: 0.2%;
98 text-align: center;
99}
100</style>