+ <Container id="charging-stations-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 }
+ )
+ }
+ }
+ "
+ >
+ <option
+ v-for="uiServerConfiguration in uiServerConfigurations"
+ :value="uiServerConfiguration.index"
+ >
+ {{ uiServerConfiguration.configuration.name ?? uiServerConfiguration.configuration.host }}
+ </option>
+ </select>
+ </Container>
+ <Container id="buttons-container">
+ <ToggleButton
+ :id="'simulator'"
+ :key="state.renderSimulator"
+ :status="state.simulatorState?.started"
+ :on="() => startSimulator()"
+ :off="() => stopSimulator()"
+ >
+ {{ state.simulatorState?.started === true ? 'Stop' : 'Start' }} Simulator
+ </ToggleButton>
+ <ToggleButton
+ :id="'add-charging-stations'"
+ :key="state.renderAddChargingStations"
+ :shared="true"
+ :on="
+ () => {
+ $router.push({ name: 'add-charging-stations' })
+ }
+ "
+ :off="
+ () => {
+ $router.push({ name: 'charging-stations' })
+ }
+ "
+ @clicked="
+ () => {
+ state.renderChargingStations = randomUUID()
+ }
+ "
+ >
+ Add Charging Stations
+ </ToggleButton>
+ <ReloadButton
+ id="reload-button"
+ :loading="state.loading"
+ @click="loadChargingStations(() => (state.renderChargingStations = randomUUID()))"