--- /dev/null
+<template>
+ <h2>Action Set Supervision Url</h2>
+ <h3>Charging Station {{ chargingStationId }}</h3>
+ <p>Supervision Url:</p>
+ <input
+ id="supervision-url"
+ v-model="state.supervisionUrl"
+ type="text"
+ name="supervision-url"
+ placeholder="supervision url"
+ />
+ <br />
+ <Button
+ @click="
+ () => {
+ uiClient
+ .setSupervisionUrl(props.hashId, state.supervisionUrl)
+ .catch((error: Error) => {
+ // TODO: add code for UI notifications or other error handling logic
+ console.error('Error at setting supervision url:', error)
+ })
+ .finally(() => {
+ $router.push({ name: 'charging-stations' })
+ })
+ }
+ "
+ >Set Supervision Url</Button
+ >
+ <Button @click="$router.push({ name: 'charging-stations' })">Cancel</Button>
+</template>
+
+<script setup lang="ts">
+import { getCurrentInstance, reactive } from 'vue'
+import Button from '@/components/buttons/Button.vue'
+
+const props = defineProps<{
+ hashId: string
+ chargingStationId: string
+}>()
+
+const state = reactive({
+ supervisionUrl: ''
+})
+
+const uiClient = getCurrentInstance()?.appContext.config.globalProperties.$uiClient
+</script>
+
+<style>
+#supervision-url {
+ text-align: center;
+}
+</style>
<td class="cs-table__column">
<Button @click="startChargingStation()">Start Charging Station</Button>
<Button @click="stopChargingStation()">Stop Charging Station</Button>
+ <Button
+ @click="
+ $router.push({
+ name: 'set-supervision-url',
+ params: {
+ hashId: props.chargingStation.stationInfo.hashId,
+ chargingStationId: props.chargingStation.stationInfo.chargingStationId
+ }
+ })
+ "
+ >Set Supervision Url</Button
+ >
<Button @click="openConnection()">Open Connection</Button>
<Button @click="closeConnection()">Close Connection</Button>
<Button @click="deleteChargingStation()">Delete Charging Station</Button>
return this.sendRequest(ProcedureName.DELETE_CHARGING_STATIONS, { hashIds: [hashId] })
}
+ public async setSupervisionUrl(hashId: string, supervisionUrl: string): Promise<ResponsePayload> {
+ return this.sendRequest(ProcedureName.SET_SUPERVISION_URL, {
+ hashIds: [hashId],
+ url: supervisionUrl
+ })
+ }
+
public async startChargingStation(hashId: string): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.START_CHARGING_STATION, { hashIds: [hashId] })
}
import ChargingStationsView from '@/views/ChargingStationsView.vue'
import StartTransaction from '@/components/actions/StartTransaction.vue'
import AddChargingStations from '@/components/actions/AddChargingStations.vue'
+import SetSupervisionUrl from '@/components/actions/SetSupervisionUrl.vue'
export const router = createRouter({
history: createWebHistory(),
action: AddChargingStations
}
},
+ {
+ path: '/set-supervision-url/:hashId/:chargingStationId',
+ name: 'set-supervision-url',
+ components: {
+ default: ChargingStationsView,
+ action: SetSupervisionUrl
+ },
+ props: { default: false, action: true }
+ },
{
path: '/start-transaction/:hashId/:chargingStationId/:connectorId',
name: 'start-transaction',
LIST_CHARGING_STATIONS = 'listChargingStations',
ADD_CHARGING_STATIONS = 'addChargingStations',
DELETE_CHARGING_STATIONS = 'deleteChargingStations',
+ SET_SUPERVISION_URL = 'setSupervisionUrl',
START_CHARGING_STATION = 'startChargingStation',
STOP_CHARGING_STATION = 'stopChargingStation',
OPEN_CONNECTION = 'openConnection',