From: Jérôme Benoit Date: Sat, 17 Feb 2024 22:57:02 +0000 (+0100) Subject: refactor(ui): cleanup CSS styles namespace X-Git-Tag: v1.2.37~18 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ca1e5439d7a19520d752a8c60513d4229b118e35;p=e-mobility-charging-stations-simulator.git refactor(ui): cleanup CSS styles namespace Signed-off-by: Jérôme Benoit --- diff --git a/ui/web/src/App.vue b/ui/web/src/App.vue index 1f2dcf85..ab08dea6 100644 --- a/ui/web/src/App.vue +++ b/ui/web/src/App.vue @@ -1,6 +1,6 @@ @@ -22,7 +22,7 @@ import Container from '@/components/Container.vue' background-color: white; } -#action { +#action-container { min-width: max-content; display: flex; flex-direction: column; diff --git a/ui/web/src/composables/UIClient.ts b/ui/web/src/composables/UIClient.ts index 536b6e84..c5f20ce0 100644 --- a/ui/web/src/composables/UIClient.ts +++ b/ui/web/src/composables/UIClient.ts @@ -33,8 +33,11 @@ export class UIClient { return UIClient.instance } - public registerWSonOpenListener(listener: (event: Event) => void) { - this.ws.addEventListener('open', listener) + public registerWSEventListener( + event: K, + listener: (event: WebSocketEventMap[K]) => void + ) { + this.ws.addEventListener(event, listener) } public async startSimulator(): Promise { diff --git a/ui/web/src/main.ts b/ui/web/src/main.ts index 7b36de58..18186e16 100644 --- a/ui/web/src/main.ts +++ b/ui/web/src/main.ts @@ -13,7 +13,7 @@ const initializeApp = (config: ConfigurationData) => { // TODO: add code for UI notifications or other error handling logic } app.config.globalProperties.$uiClient = UIClient.getInstance(config) - app.config.globalProperties.$uiClient.registerWSonOpenListener(() => { + app.config.globalProperties.$uiClient.registerWSEventListener('open', () => { app.config.globalProperties.$uiClient .listChargingStations() .then((response: ResponsePayload) => { diff --git a/ui/web/src/views/ChargingStationsView.vue b/ui/web/src/views/ChargingStationsView.vue index 5e0ce534..c2e12cb5 100644 --- a/ui/web/src/views/ChargingStationsView.vue +++ b/ui/web/src/views/ChargingStationsView.vue @@ -1,5 +1,5 @@