2 <tr class="cs-table__row">
3 <td class="cs-table__column">
4 {{ props.chargingStation.stationInfo.chargingStationId ?? 'Ø' }}
6 <td class="cs-table__column">{{ props.chargingStation.started === true ? 'Yes' : 'No' }}</td>
7 <td class="cs-table__column">
8 {{ getSupervisionUrl() }}
10 <td class="cs-table__column">{{ getWsState() }}</td>
11 <td class="cs-table__column">
12 {{ props.chargingStation?.bootNotificationResponse?.status ?? 'Ø' }}
14 <td class="cs-table__column">
15 {{ props.chargingStation.stationInfo.templateName }}
17 <td class="cs-table__column">{{ props.chargingStation.stationInfo.chargePointVendor }}</td>
18 <td class="cs-table__column">{{ props.chargingStation.stationInfo.chargePointModel }}</td>
19 <td class="cs-table__column">
20 {{ props.chargingStation.stationInfo.firmwareVersion ?? 'Ø' }}
22 <td class="cs-table__column">
23 <Button @click="startChargingStation()">Start Charging Station</Button>
24 <Button @click="stopChargingStation()">Stop Charging Station</Button>
25 <Button @click="openConnection()">Open Connection</Button>
26 <Button @click="closeConnection()">Close Connection</Button>
27 <Button @click="deleteChargingStation()">Delete Charging Station</Button>
29 <td class="cs-table__connectors-column">
30 <table id="connectors-table">
31 <thead id="connectors-table__head">
32 <tr class="connectors-table__row">
33 <th scope="col" class="connectors-table__column">Identifier</th>
34 <th scope="col" class="connectors-table__column">Status</th>
35 <th scope="col" class="connectors-table__column">Transaction</th>
36 <th scope="col" class="connectors-table__column">ATG Started</th>
37 <th scope="col" class="connectors-table__column">Actions</th>
40 <tbody id="connectors-table__body">
41 <!-- eslint-disable-next-line vue/valid-v-for -->
43 v-for="(connector, index) in getConnectors()"
44 :hash-id="props.chargingStation.stationInfo.hashId"
45 :connector-id="index + 1"
46 :connector="connector"
47 :atg-status="getATGStatus(index + 1)"
48 :transaction-id="connector.transactionId"
57 <script setup lang="ts">
58 import { getCurrentInstance } from 'vue'
59 import CSConnector from '@/components/charging-stations/CSConnector.vue'
60 import Button from '@/components/buttons/Button.vue'
61 import type { ChargingStationData, ConnectorStatus, Status } from '@/types'
63 const props = defineProps<{
64 chargingStation: ChargingStationData
68 function getConnectors(): ConnectorStatus[] {
69 if (Array.isArray(props.chargingStation.evses) && props.chargingStation.evses.length > 0) {
70 const connectorsStatus: ConnectorStatus[] = []
71 for (const [evseId, evseStatus] of props.chargingStation.evses.entries()) {
72 if (evseId > 0 && Array.isArray(evseStatus.connectors) && evseStatus.connectors.length > 0) {
73 for (const connectorStatus of evseStatus.connectors) {
74 connectorsStatus.push(connectorStatus)
78 return connectorsStatus
80 return props.chargingStation.connectors?.slice(1)
82 function getATGStatus(connectorId: number): Status | undefined {
83 return props.chargingStation.automaticTransactionGenerator
84 ?.automaticTransactionGeneratorStatuses?.[connectorId - 1]
86 function getSupervisionUrl(): string {
87 const supervisionUrl = new URL(props.chargingStation.supervisionUrl)
88 return `${supervisionUrl.protocol}//${supervisionUrl.host.split('.').join('.\u200b')}`
90 function getWsState(): string {
91 switch (props.chargingStation?.wsState) {
92 case WebSocket.CONNECTING:
96 case WebSocket.CLOSING:
98 case WebSocket.CLOSED:
105 const uiClient = getCurrentInstance()?.appContext.config.globalProperties.$uiClient
107 function startChargingStation(): void {
108 uiClient.startChargingStation(props.chargingStation.stationInfo.hashId)
110 function stopChargingStation(): void {
111 uiClient.stopChargingStation(props.chargingStation.stationInfo.hashId)
113 function openConnection(): void {
114 uiClient.openConnection(props.chargingStation.stationInfo.hashId)
116 function closeConnection(): void {
117 uiClient.closeConnection(props.chargingStation.stationInfo.hashId)
119 function deleteChargingStation(): void {
120 uiClient.deleteChargingStation(props.chargingStation.stationInfo.hashId)
127 flex-direction: column;
128 background-color: white;
129 overflow: auto hidden;
130 border-collapse: collapse;
134 #connectors-table__body {
136 flex-direction: column;
139 .connectors-table__row {
142 justify-content: center;
146 .connectors-table__row:nth-of-type(even) {
147 background-color: whitesmoke;
150 #connectors-table__head .connectors-table__row {
151 background-color: lightgrey;
154 .connectors-table__column {
155 width: calc(100% / 5);