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