idTag: '',
})
-const uiClient = useUIClient()
+const $uiClient = useUIClient()
const toggleButtonId = computed(
() => `${props.hashId}-${evseId.value ?? 0}-${props.connectorId}-start-transaction`
return
}
try {
- await uiClient.authorize(props.hashId, idTag)
+ await $uiClient.authorize(props.hashId, idTag)
} catch (error) {
$toast.error('Error at authorizing RFID tag')
console.error('Error at authorizing RFID tag:', error)
}
try {
- await uiClient.startTransaction(props.hashId, {
+ await $uiClient.startTransaction(props.hashId, {
connectorId: convertToInt(props.connectorId),
evseId: evseId.value,
idTag,
const $emit = defineEmits(['need-refresh'])
-const uiClient = useUIClient()
+const $uiClient = useUIClient()
const $toast = useToast()
return
}
executeAction(
- uiClient.stopTransaction(props.hashId, {
+ $uiClient.stopTransaction(props.hashId, {
ocppVersion: props.ocppVersion,
transactionId: props.connector.transactionId,
}),
}
const lockConnector = (): void => {
executeAction(
- uiClient.lockConnector(props.hashId, props.connectorId),
+ $uiClient.lockConnector(props.hashId, props.connectorId),
'Connector successfully locked',
'Error at locking connector'
)
}
const unlockConnector = (): void => {
executeAction(
- uiClient.unlockConnector(props.hashId, props.connectorId),
+ $uiClient.unlockConnector(props.hashId, props.connectorId),
'Connector successfully unlocked',
'Error at unlocking connector'
)
}
const startAutomaticTransactionGenerator = (): void => {
executeAction(
- uiClient.startAutomaticTransactionGenerator(props.hashId, props.connectorId),
+ $uiClient.startAutomaticTransactionGenerator(props.hashId, props.connectorId),
'Automatic transaction generator successfully started',
'Error at starting automatic transaction generator'
)
}
const stopAutomaticTransactionGenerator = (): void => {
executeAction(
- uiClient.stopAutomaticTransactionGenerator(props.hashId, props.connectorId),
+ $uiClient.stopAutomaticTransactionGenerator(props.hashId, props.connectorId),
'Automatic transaction generator successfully stopped',
'Error at stopping automatic transaction generator'
)
}
}
-const uiClient = useUIClient()
+const $uiClient = useUIClient()
const $toast = useToast()
const startChargingStation = (): void => {
executeAction(
- uiClient.startChargingStation(props.chargingStation.stationInfo.hashId),
+ $uiClient.startChargingStation(props.chargingStation.stationInfo.hashId),
'Charging station successfully started',
'Error at starting charging station'
)
}
const stopChargingStation = (): void => {
executeAction(
- uiClient.stopChargingStation(props.chargingStation.stationInfo.hashId),
+ $uiClient.stopChargingStation(props.chargingStation.stationInfo.hashId),
'Charging station successfully stopped',
'Error at stopping charging station'
)
}
const openConnection = (): void => {
executeAction(
- uiClient.openConnection(props.chargingStation.stationInfo.hashId),
+ $uiClient.openConnection(props.chargingStation.stationInfo.hashId),
'Connection successfully opened',
'Error at opening connection'
)
}
const closeConnection = (): void => {
executeAction(
- uiClient.closeConnection(props.chargingStation.stationInfo.hashId),
+ $uiClient.closeConnection(props.chargingStation.stationInfo.hashId),
'Connection successfully closed',
'Error at closing connection'
)
}
const deleteChargingStation = (): void => {
- uiClient
+ $uiClient
.deleteChargingStation(props.chargingStation.stationInfo.hashId)
.then(() => {
for (const key in getLocalStorage()) {
}
export const refreshChargingStations = async (): Promise<void> => {
- const ref = useChargingStations()
- if (ref == null) return
+ const $chargingStations = useChargingStations()
+ if ($chargingStations == null) return
const response = await useUIClient().listChargingStations()
- ref.value = response.chargingStations as ChargingStationData[]
+ $chargingStations.value = response.chargingStations as ChargingStationData[]
}
export const useExecuteAction = (emit: (event: 'need-refresh') => void) => {
}
}
-const uiClient = useUIClient()
+const $uiClient = useUIClient()
const $toast = useToast()
const getSimulatorState = (): void => {
if (state.value.gettingSimulatorState === false) {
state.value.gettingSimulatorState = true
- uiClient
+ $uiClient
.simulatorState()
.then((response: ResponsePayload) => {
simulatorState.value = response.state as SimulatorState
const getTemplates = (): void => {
if (state.value.gettingTemplates === false) {
state.value.gettingTemplates = true
- uiClient
+ $uiClient
.listTemplates()
.then((response: ResponsePayload) => {
if (app != null) {
const getChargingStations = (): void => {
if (state.value.gettingChargingStations === false) {
state.value.gettingChargingStations = true
- uiClient
+ $uiClient
.listChargingStations()
.then((response: ResponsePayload) => {
if (chargingStationsRef != null) {
}
const registerWSEventListeners = () => {
- uiClient.registerWSEventListener('open', getData)
- uiClient.registerWSEventListener('error', clearChargingStations)
- uiClient.registerWSEventListener('close', clearChargingStations)
+ $uiClient.registerWSEventListener('open', getData)
+ $uiClient.registerWSEventListener('error', clearChargingStations)
+ $uiClient.registerWSEventListener('close', clearChargingStations)
}
const unregisterWSEventListeners = () => {
- uiClient.unregisterWSEventListener('open', getData)
- uiClient.unregisterWSEventListener('error', clearChargingStations)
- uiClient.unregisterWSEventListener('close', clearChargingStations)
+ $uiClient.unregisterWSEventListener('open', getData)
+ $uiClient.unregisterWSEventListener('error', clearChargingStations)
+ $uiClient.unregisterWSEventListener('close', clearChargingStations)
}
let unsubscribeRefresh: (() => void) | undefined
onMounted(() => {
registerWSEventListeners()
- unsubscribeRefresh = uiClient.onRefresh(() => {
+ unsubscribeRefresh = $uiClient.onRefresh(() => {
getChargingStations()
})
})
}))
const startSimulator = (): void => {
- uiClient
+ $uiClient
.startSimulator()
.then(() => {
return $toast.success('Simulator successfully started')
})
}
const stopSimulator = (): void => {
- uiClient
+ $uiClient
.stopSimulator()
.then(() => {
clearChargingStations()