Please select a template
</option>
<option
- v-for="template in $templates.value"
- v-show="Array.isArray($templates.value) && $templates.value.length > 0"
+ v-for="template in $templates!.value"
+ v-show="Array.isArray($templates?.value) && $templates.value.length > 0"
:key="template"
>
{{ template }}
@click="
() => {
$uiClient
- .addChargingStations(state.template, state.numberOfStations, {
+ ?.addChargingStations(state.template, state.numberOfStations, {
supervisionUrls: state.supervisionUrl.length > 0 ? state.supervisionUrl : undefined,
autoStart: convertToBoolean(state.autoStart),
persistentConfiguration: convertToBoolean(state.persistentConfiguration),
enableStatistics: false,
})
-watch(getCurrentInstance()!.appContext.config.globalProperties.$templates, () => {
+watch(getCurrentInstance()!.appContext.config.globalProperties!.$templates, () => {
state.value.renderTemplates = randomUUID()
})
</script>
if (
getFromLocalStorage<number>('uiServerConfigurationIndex', 0) !== state.uiServerIndex
) {
- $uiClient.setConfiguration(
- ($configuration.value.uiServer as UIServerConfigurationSection[])[
+ $uiClient?.setConfiguration(
+ ($configuration!.value.uiServer as UIServerConfigurationSection[])[
state.uiServerIndex
]
)
registerWSEventListeners()
- $uiClient.registerWSEventListener(
+ $uiClient?.registerWSEventListener(
'open',
() => {
setToLocalStorage<number>('uiServerConfigurationIndex', state.uiServerIndex)
},
{ once: true }
)
- $uiClient.registerWSEventListener(
+ $uiClient?.registerWSEventListener(
'error',
() => {
state.uiServerIndex = getFromLocalStorage<number>(
'uiServerConfigurationIndex',
0
)
- $uiClient.setConfiguration(
- ($configuration.value.uiServer as UIServerConfigurationSection[])[
+ $uiClient?.setConfiguration(
+ ($configuration!.value.uiServer as UIServerConfigurationSection[])[
getFromLocalStorage<number>('uiServerConfigurationIndex', 0)
]
)
/>
</Container>
<CSTable
- v-show="Array.isArray($chargingStations.value) && $chargingStations.value.length > 0"
+ v-show="Array.isArray($chargingStations?.value) && $chargingStations.value.length > 0"
:key="state.renderChargingStations"
- :charging-stations="$chargingStations.value"
+ :charging-stations="$chargingStations!.value"
@need-refresh="
() => {
state.renderAddChargingStations = randomUUID()
const app = getCurrentInstance()
-watch(app!.appContext.config.globalProperties.$chargingStations, () => {
+watch(app!.appContext.config.globalProperties!.$chargingStations, () => {
state.value.renderChargingStations = randomUUID()
})
const clearTemplates = (): void => {
if (app != null) {
- app.appContext.config.globalProperties.$templates.value = []
+ app.appContext.config.globalProperties.$templates!.value = []
}
}
const clearChargingStations = (): void => {
if (app != null) {
- app.appContext.config.globalProperties.$chargingStations.value = []
+ app.appContext.config.globalProperties.$chargingStations!.value = []
}
}
.listTemplates()
.then((response: ResponsePayload) => {
if (app != null) {
- app.appContext.config.globalProperties.$templates.value = response.templates as string[]
+ app.appContext.config.globalProperties.$templates!.value = response.templates as string[]
}
return undefined
})
.listChargingStations()
.then((response: ResponsePayload) => {
if (app != null) {
- app.appContext.config.globalProperties.$chargingStations.value =
+ app.appContext.config.globalProperties.$chargingStations!.value =
response.chargingStations as ChargingStationData[]
}
return undefined
index: number
configuration: UIServerConfigurationSection
}[] = (
- app?.appContext.config.globalProperties.$configuration.value
+ app!.appContext.config.globalProperties.$configuration!.value
.uiServer as UIServerConfigurationSection[]
).map((configuration: UIServerConfigurationSection, index: number) => ({
index,