X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=ui%2Fweb%2Fsrc%2Fcomposables%2FUIClient.ts;h=51d61f263f7788adcd45e930ef79103dbd92d883;hb=0344ad2b24f8b043b5848a0fea8b5a120d6781db;hp=d569b93b09719e91cd8536a4ac5f315ddc5e4417;hpb=427a497022f0a5ff9454c618b6d3620521625923;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`) } }