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>
28 name: 'set-supervision-url',
30 hashId: props.chargingStation.stationInfo.hashId,
31 chargingStationId: props.chargingStation.stationInfo.chargingStationId
35 >Set Supervision Url</Button
37 <Button @click="openConnection()">Open Connection</Button>
38 <Button @click="closeConnection()">Close Connection</Button>
39 <Button @click="deleteChargingStation()">Delete Charging Station</Button>
41 <td class="cs-table__connectors-column">
42 <table id="connectors-table">
43 <thead id="connectors-table__head">
44 <tr class="connectors-table__row">
45 <th scope="col" class="connectors-table__column">Identifier</th>
46 <th scope="col" class="connectors-table__column">Status</th>
47 <th scope="col" class="connectors-table__column">Transaction</th>
48 <th scope="col" class="connectors-table__column">ATG Started</th>
49 <th scope="col" class="connectors-table__column">Actions</th>
52 <tbody id="connectors-table__body">
53 <!-- eslint-disable-next-line vue/valid-v-for -->
55 v-for="(connector, index) in getConnectors()"
56 :hash-id="props.chargingStation.stationInfo.hashId"
57 :charging-station-id="props.chargingStation.stationInfo.chargingStationId"
58 :connector-id="index + 1"
59 :connector="connector"
60 :atg-status="getATGStatus(index + 1)"
68 <script setup lang="ts">
69 import { getCurrentInstance } from 'vue'
70 import CSConnector from '@/components/charging-stations/CSConnector.vue'
71 import Button from '@/components/buttons/Button.vue'
72 import type { ChargingStationData, ConnectorStatus, Status } from '@/types'
74 const props = defineProps<{
75 chargingStation: ChargingStationData
78 function getConnectors(): ConnectorStatus[] {
79 if (Array.isArray(props.chargingStation.evses) && props.chargingStation.evses.length > 0) {
80 const connectorsStatus: ConnectorStatus[] = []
81 for (const [evseId, evseStatus] of props.chargingStation.evses.entries()) {
82 if (evseId > 0 && Array.isArray(evseStatus.connectors) && evseStatus.connectors.length > 0) {
83 for (const connectorStatus of evseStatus.connectors) {
84 connectorsStatus.push(connectorStatus)
88 return connectorsStatus
90 return props.chargingStation.connectors?.slice(1)
92 function getATGStatus(connectorId: number): Status | undefined {
93 return props.chargingStation.automaticTransactionGenerator
94 ?.automaticTransactionGeneratorStatuses?.[connectorId - 1]
96 function getSupervisionUrl(): string {
97 const supervisionUrl = new URL(props.chargingStation.supervisionUrl)
98 return `${supervisionUrl.protocol}//${supervisionUrl.host.split('.').join('.\u200b')}`
100 function getWsState(): string {
101 switch (props.chargingStation?.wsState) {
102 case WebSocket.CONNECTING:
106 case WebSocket.CLOSING:
108 case WebSocket.CLOSED:
115 const uiClient = getCurrentInstance()?.appContext.config.globalProperties.$uiClient
117 function startChargingStation(): void {
118 uiClient.startChargingStation(props.chargingStation.stationInfo.hashId)
120 function stopChargingStation(): void {
121 uiClient.stopChargingStation(props.chargingStation.stationInfo.hashId)
123 function openConnection(): void {
124 uiClient.openConnection(props.chargingStation.stationInfo.hashId)
126 function closeConnection(): void {
127 uiClient.closeConnection(props.chargingStation.stationInfo.hashId)
129 function deleteChargingStation(): void {
130 uiClient.deleteChargingStation(props.chargingStation.stationInfo.hashId)
137 flex-direction: column;
138 background-color: white;
139 overflow: auto hidden;
140 border-collapse: collapse;
144 #connectors-table__body {
146 flex-direction: column;
149 .connectors-table__row {
152 justify-content: center;
156 .connectors-table__row:nth-of-type(even) {
157 background-color: whitesmoke;
160 #connectors-table__head .connectors-table__row {
161 background-color: lightgrey;
164 .connectors-table__column {
165 width: calc(100% / 5);