repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix(ui): move v-show to the UI server container component
[e-mobility-charging-stations-simulator.git]
/
ui
/
web
/
src
/
composables
/
UIClient.ts
diff --git
a/ui/web/src/composables/UIClient.ts
b/ui/web/src/composables/UIClient.ts
index d569b93b09719e91cd8536a4ac5f315ddc5e4417..51d61f263f7788adcd45e930ef79103dbd92d883 100644
(file)
--- 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,
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.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 => {
}
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`
)
}
}
}
}