chore(deps-dev): apply updates
[e-mobility-charging-stations-simulator.git] / ui / web / src / components / actions / SetSupervisionUrl.vue
CommitLineData
f8696170 1<template>
64596c75
JB
2 <h1 id="action">
3 Set Supervision Url
4 </h1>
916f0920 5 <h2>{{ chargingStationId }}</h2>
f8696170
JB
6 <p>Supervision Url:</p>
7 <input
8 id="supervision-url"
d18fc1e3 9 v-model.trim="state.supervisionUrl"
f8696170 10 name="supervision-url"
0475290a 11 placeholder="wss://"
0749233f 12 type="url"
64596c75
JB
13 >
14 <br>
f8696170 15 <Button
14ee627a 16 id="action-button"
f8696170
JB
17 @click="
18 () => {
7e315430 19 $uiClient
df60841b 20 ?.setSupervisionUrl(hashId, state.supervisionUrl)
cea23fa0
JB
21 .then(() => {
22 $toast.success('Supervision url successfully set')
23 })
f8696170 24 .catch((error: Error) => {
cea23fa0 25 $toast.error('Error at setting supervision url')
f8696170
JB
26 console.error('Error at setting supervision url:', error)
27 })
28 .finally(() => {
29 $router.push({ name: 'charging-stations' })
30 })
31 }
32 "
f8696170 33 >
1eb5f592
JB
34 Set Supervision Url
35 </Button>
f8696170
JB
36</template>
37
38<script setup lang="ts">
f8696170 39import Button from '@/components/buttons/Button.vue'
0749233f 40import { ref } from 'vue'
f8696170 41
4b10e4f9 42defineProps<{
f8696170 43 chargingStationId: string
0749233f 44 hashId: string
f8696170
JB
45}>()
46
cf959670 47const state = ref<{ supervisionUrl: string }>({
b015f776 48 supervisionUrl: '',
f8696170 49})
f8696170
JB
50</script>
51
52<style>
53#supervision-url {
b221407f
JB
54 width: 90%;
55 text-align: left;
f8696170
JB
56}
57</style>