- app.config.globalProperties.$UIClient = UIClient.getInstance(config)
- app.config.globalProperties.$UIClient.openWS()
- app.use(router).mount('#app')
+ app.config.globalProperties.$configuration = config
+ app.config.globalProperties.$chargingStations = []
+ app.config.globalProperties.$uiClient = UIClient.getInstance(
+ app.config.globalProperties.$configuration.uiServer
+ )
+ app.config.globalProperties.$uiClient.registerWSEventListener('open', () => {
+ app.config.globalProperties.$uiClient
+ .listChargingStations()
+ .then((response: ResponsePayload) => {
+ app.config.globalProperties.$chargingStations = response.chargingStations
+ })
+ .catch((error: Error) => {
+ // TODO: add code for UI notifications or other error handling logic
+ console.error('Error at fetching charging stations:', error)
+ })
+ .finally(() => {
+ app.use(router).use(ToastPlugin).mount('#app')
+ })
+ })