+ <h1 id="action">Action</h1>
+ <h2>Add Charging Stations</h2>
+ <p>Template:</p>
+ <select v-if="state.ready" v-model="state.template">
+ <option disabled value="">Please select a template</option>
+ <option v-for="template in app?.appContext.config.globalProperties.$templates">
+ {{ template }}
+ </option>
+ </select>
+ <p>Number of stations:</p>
+ <input
+ id="number-of-stations"
+ v-model="state.numberOfStations"
+ type="number"
+ min="1"
+ name="number-of-stations"
+ placeholder="number of stations"
+ />
+ <br />
+ <Button
+ id="action-button"
+ @click="
+ () => {
+ uiClient
+ .addChargingStations(state.template, state.numberOfStations)
+ .then(() => {
+ $toast.success('Charging stations successfully added')
+ })
+ .catch((error: Error) => {
+ $toast.error('Error at adding charging stations')
+ console.error('Error at adding charging stations:', error)
+ })
+ .finally(() => {
+ $router.push({ name: 'charging-stations' })
+ })
+ }
+ "
+ >
+ Add Charging Stations
+ </Button>
+ <Button id="action-button" @click="$router.push({ name: 'charging-stations' })">Cancel</Button>