<template>
- <h2>Action Add Charging Stations</h2>
+ <h1 id="action">Action</h1>
+ <h2>Add Charging Stations</h2>
<p>Template:</p>
- <select v-if="state.ready" v-model="state.template">
+ <select v-show="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 }}
name="number-of-stations"
placeholder="number of stations"
/>
+ <p>Options:</p>
+ <ul>
+ <li>
+ Auto start:
+ <input v-model="state.autoStart" type="checkbox" true-value="true" false-value="false" />
+ </li>
+ </ul>
<br />
<Button
id="action-button"
@click="
() => {
uiClient
- .addChargingStations(state.template, state.numberOfStations)
+ .addChargingStations(state.template, state.numberOfStations, {
+ autoStart: convertToBoolean(state.autoStart)
+ })
.then(() => {
$toast.success('Charging stations successfully added')
})
import { useToast } from 'vue-toast-notification'
import Button from '@/components/buttons/Button.vue'
import type { ResponsePayload } from '@/types'
+import { convertToBoolean } from '@/composables'
const state = reactive({
ready: false,
template: '',
- numberOfStations: 1
+ numberOfStations: 1,
+ autoStart: false
})
const app = getCurrentInstance()