await this.workerImplementation?.stop()
delete this.workerImplementation
this.removeAllListeners()
+ this.uiServer?.chargingStations.clear()
await this.storage?.close()
delete this.storage
this.started = false
private async onOpen (): Promise<void> {
if (this.isWebSocketConnectionOpened()) {
+ this.emit(ChargingStationEvents.updated)
logger.info(
`${this.logPrefix()} Connection to OCPP server through ${this.wsConnectionUrl.href} succeeded`
)
private onClose (code: WebSocketCloseEventStatusCode, reason: Buffer): void {
this.emit(ChargingStationEvents.disconnected)
+ this.emit(ChargingStationEvents.updated)
switch (code) {
// Normal close
case WebSocketCloseEventStatusCode.CLOSE_NORMAL:
)}' and reason '${reason.toString()}'`
)
this.started &&
- this.reconnect().catch(error =>
- logger.error(`${this.logPrefix()} Error while reconnecting:`, error)
- )
+ this.reconnect()
+ .then(() => {
+ this.emit(ChargingStationEvents.updated)
+ })
+ .catch(error => logger.error(`${this.logPrefix()} Error while reconnecting:`, error))
break
}
- this.emit(ChargingStationEvents.updated)
}
private getCachedRequest (
@click="loadChargingStations(() => $router.go(0))"
/>
</Container>
- <CSTable :charging-stations="app?.appContext.config.globalProperties.$chargingStations" />
+ <CSTable
+ v-if="
+ Array.isArray(app?.appContext.config.globalProperties.$chargingStations) &&
+ app?.appContext.config.globalProperties.$chargingStations.length > 0
+ "
+ :charging-stations="app?.appContext.config.globalProperties.$chargingStations"
+ />
</Container>
</template>
uiClient
.stopSimulator()
.then(() => {
+ if (app != null) {
+ app.appContext.config.globalProperties.$chargingStations = []
+ }
$toast.success('Simulator successfully stopped')
})
.catch((error: Error) => {
#charging-stations-container {
height: fit-content;
width: 100%;
+ position: absolute;
display: flex;
flex-direction: column;
}