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 type { ChargingStationData, ConnectorStatus, Status } from '@/types'
62 const props = defineProps<{
63 chargingStation: ChargingStationData
67 function getConnectors(): ConnectorStatus[] {
68 if (Array.isArray(props.chargingStation.evses) && props.chargingStation.evses.length > 0) {
69 const connectorsStatus: ConnectorStatus[] = []
70 for (const [evseId, evseStatus] of props.chargingStation.evses.entries()) {
71 if (evseId > 0 && Array.isArray(evseStatus.connectors) && evseStatus.connectors.length > 0) {
72 for (const connectorStatus of evseStatus.connectors) {
73 connectorsStatus.push(connectorStatus)
77 return connectorsStatus
79 return props.chargingStation.connectors?.slice(1)
81 function getATGStatus(connectorId: number): Status | undefined {
82 return props.chargingStation.automaticTransactionGenerator
83 ?.automaticTransactionGeneratorStatuses?.[connectorId - 1]
85 function getSupervisionUrl(): string {
86 const supervisionUrl = new URL(props.chargingStation.supervisionUrl)
87 return `${supervisionUrl.protocol}//${supervisionUrl.host.split('.').join('.\u200b')}`
89 function getWsState(): string {
90 switch (props.chargingStation?.wsState) {
91 case WebSocket.CONNECTING:
95 case WebSocket.CLOSING:
97 case WebSocket.CLOSED:
104 const UIClient = getCurrentInstance()?.appContext.config.globalProperties.$UIClient
106 function startChargingStation(): void {
107 UIClient.startChargingStation(props.chargingStation.stationInfo.hashId)
109 function stopChargingStation(): void {
110 UIClient.stopChargingStation(props.chargingStation.stationInfo.hashId)
112 function openConnection(): void {
113 UIClient.openConnection(props.chargingStation.stationInfo.hashId)
115 function closeConnection(): void {
116 UIClient.closeConnection(props.chargingStation.stationInfo.hashId)
118 function deleteChargingStation(): void {
119 UIClient.deleteChargingStation(props.chargingStation.stationInfo.hashId)
126 flex-direction: column;
127 background-color: white;
128 overflow: auto hidden;
129 border-collapse: collapse;
133 #connectors-table__body {
135 flex-direction: column;
138 .connectors-table__row {
141 justify-content: center;
145 .connectors-table__row:nth-of-type(even) {
146 background-color: whitesmoke;
149 #connectors-table__head .connectors-table__row {
150 background-color: lightgrey;
153 .connectors-table__column {
154 width: calc(100% / 5);