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