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