X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=ui%2Fweb%2Fsrc%2Fcomposables%2FUIClient.ts;h=51d61f263f7788adcd45e930ef79103dbd92d883;hb=47521384ba9d093d453f8a71b847afcac37d68e4;hp=d569b93b09719e91cd8536a4ac5f315ddc5e4417;hpb=093ca832a5c03ea03f32368b4bf13c1d08ef3a54;p=e-mobility-charging-stations-simulator.git diff --git a/ui/web/src/composables/UIClient.ts b/ui/web/src/composables/UIClient.ts index d569b93b..51d61f26 100644 --- a/ui/web/src/composables/UIClient.ts +++ b/ui/web/src/composables/UIClient.ts @@ -1,3 +1,4 @@ +import { useToast } from 'vue-toast-notification' import { ApplicationProtocol, AuthenticationType, @@ -161,15 +162,21 @@ export class UIClient { `${this.uiServerConfiguration.secure === true ? ApplicationProtocol.WSS : ApplicationProtocol.WS}://${this.uiServerConfiguration.host}:${this.uiServerConfiguration.port}`, protocols ) - this.ws.onopen = openEvent => { - console.info('WebSocket opened', openEvent) + this.ws.onopen = () => { + useToast().success( + `WebSocket to UI server '${this.uiServerConfiguration.host}' successfully opened` + ) } this.ws.onmessage = this.responseHandler.bind(this) this.ws.onerror = errorEvent => { - console.error('WebSocket error: ', errorEvent) + useToast().error(`Error in WebSocket to UI server '${this.uiServerConfiguration.host}'`) + console.error( + `Error in WebSocket to UI server '${this.uiServerConfiguration.host}'`, + errorEvent + ) } - this.ws.onclose = closeEvent => { - console.info('WebSocket closed: ', closeEvent) + this.ws.onclose = () => { + useToast().info(`WebSocket to UI server '${this.uiServerConfiguration.host}' closed`) } }