7 :key="state.renderTemplates"
8 v-model="state.template"
14 Please select a template
17 v-for="template in $templates!.value"
18 v-show="Array.isArray($templates?.value) && $templates.value.length > 0"
24 <p>Number of stations:</p>
26 id="number-of-stations"
27 v-model="state.numberOfStations"
29 name="number-of-stations"
30 placeholder="number of stations"
33 <p>Template options overrides:</p>
34 <ul id="template-options">
39 v-model.trim="state.supervisionUrl"
40 name="supervision-url"
48 v-model="state.autoStart"
55 Persistent configuration:
57 v-model="state.persistentConfiguration"
64 OCPP strict compliance:
66 v-model="state.ocppStrictCompliance"
73 Performance statistics:
75 v-model="state.enableStatistics"
88 ?.addChargingStations(state.template, state.numberOfStations, {
89 supervisionUrls: state.supervisionUrl.length > 0 ? state.supervisionUrl : undefined,
90 autoStart: convertToBoolean(state.autoStart),
91 persistentConfiguration: convertToBoolean(state.persistentConfiguration),
92 ocppStrictCompliance: convertToBoolean(state.ocppStrictCompliance),
93 enableStatistics: convertToBoolean(state.enableStatistics),
96 $toast.success('Charging stations successfully added')
98 .catch((error: Error) => {
99 $toast.error('Error at adding charging stations')
100 console.error('Error at adding charging stations:', error)
103 $router.push({ name: 'charging-stations' })
108 Add Charging Stations
112 <script setup lang="ts">
113 import Button from '@/components/buttons/Button.vue'
114 import { convertToBoolean, randomUUID } from '@/composables'
115 import { getCurrentInstance, ref, watch } from 'vue'
119 enableStatistics: boolean
120 numberOfStations: number
121 ocppStrictCompliance: boolean
122 persistentConfiguration: boolean
123 renderTemplates: `${string}-${string}-${string}-${string}-${string}`
124 supervisionUrl: string
128 enableStatistics: false,
130 ocppStrictCompliance: true,
131 persistentConfiguration: true,
132 renderTemplates: randomUUID(),
137 watch(getCurrentInstance()!.appContext.config.globalProperties!.$templates, () => {
138 state.value.renderTemplates = randomUUID()
143 #number-of-stations {
154 list-style: circle inside;