- <Container
- v-show="Array.isArray(uiServerConfigurations) && uiServerConfigurations.length > 1"
- id="ui-server-container"
- >
- <select
- id="ui-server-selector"
- v-model="state.uiServerIndex"
- @change="
- () => {
- if (
- getFromLocalStorage<number>('uiServerConfigurationIndex', 0) !== state.uiServerIndex
- ) {
- app?.appContext.config.globalProperties.$uiClient.setConfiguration(
- app?.appContext.config.globalProperties.$configuration.uiServer[state.uiServerIndex]
- )
- initializeWSEventListeners()
- app?.appContext.config.globalProperties.$uiClient.registerWSEventListener(
- 'open',
- () => {
- setToLocalStorage<number>('uiServerConfigurationIndex', state.uiServerIndex)
- delete app?.appContext.config.globalProperties.$templates
- $router.currentRoute.value.name !== 'charging-stations' &&
- $router.push({ name: 'charging-stations' })
- },
- { once: true }
- )
- app?.appContext.config.globalProperties.$uiClient.registerWSEventListener(
- 'error',
- () => {
- state.uiServerIndex = getFromLocalStorage<number>('uiServerConfigurationIndex', 0)
- app?.appContext.config.globalProperties.$uiClient.setConfiguration(
- app?.appContext.config.globalProperties.$configuration.uiServer[
- getFromLocalStorage<number>('uiServerConfigurationIndex', 0)
- ]
- )
- initializeWSEventListeners()
- },
- { once: true }
- )
+ <Container id="buttons-container">
+ <Container
+ v-show="Array.isArray(uiServerConfigurations) && uiServerConfigurations.length > 1"
+ id="ui-server-container"
+ >
+ <select
+ id="ui-server-selector"
+ v-model="state.uiServerIndex"
+ @change="
+ () => {
+ if (
+ getFromLocalStorage<number>('uiServerConfigurationIndex', 0) !== state.uiServerIndex
+ ) {
+ app?.appContext.config.globalProperties.$uiClient.setConfiguration(
+ app?.appContext.config.globalProperties.$configuration.uiServer[
+ state.uiServerIndex
+ ]
+ )
+ initializeWSEventListeners()
+ app?.appContext.config.globalProperties.$uiClient.registerWSEventListener(
+ 'open',
+ () => {
+ setToLocalStorage<number>('uiServerConfigurationIndex', state.uiServerIndex)
+ clearToggleButtons()
+ $router.currentRoute.value.name !== 'charging-stations' &&
+ $router.push({ name: 'charging-stations' })
+ },
+ { once: true }
+ )
+ app?.appContext.config.globalProperties.$uiClient.registerWSEventListener(
+ 'error',
+ () => {
+ state.uiServerIndex = getFromLocalStorage<number>(
+ 'uiServerConfigurationIndex',
+ 0
+ )
+ app?.appContext.config.globalProperties.$uiClient.setConfiguration(
+ app?.appContext.config.globalProperties.$configuration.uiServer[
+ getFromLocalStorage<number>('uiServerConfigurationIndex', 0)
+ ]
+ )
+ initializeWSEventListeners()
+ },
+ { once: true }
+ )
+ }