refactor(ui): refine input type
[e-mobility-charging-stations-simulator.git] / ui / web / src / components / actions / SetSupervisionUrl.vue
index 00f4ef3d4ebcf40d1d23ecabf9db18aceacb168b..d9de85d8951a11d5390bd5469724aa051a93be16 100644 (file)
@@ -4,8 +4,8 @@
   <p>Supervision Url:</p>
   <input
     id="supervision-url"
-    v-model="state.supervisionUrl"
-    type="text"
+    v-model.trim="state.supervisionUrl"
+    type="url"
     name="supervision-url"
     placeholder="supervision url"
   />
       () => {
         uiClient
           .setSupervisionUrl(props.hashId, state.supervisionUrl)
+          .then(() => {
+            $toast.success('Supervision url successfully set')
+          })
           .catch((error: Error) => {
-            // TODO: add code for UI notifications or other error handling logic
+            $toast.error('Error at setting supervision url')
             console.error('Error at setting supervision url:', error)
           })
           .finally(() => {
@@ -39,7 +42,7 @@ const props = defineProps<{
 }>()
 
 const state = reactive({
-  supervisionUrl: ''
+  supervisionUrl: 'ws://'
 })
 
 const uiClient = getCurrentInstance()?.appContext.config.globalProperties.$uiClient
@@ -47,6 +50,7 @@ const uiClient = getCurrentInstance()?.appContext.config.globalProperties.$uiCli
 
 <style>
 #supervision-url {
-  text-align: center;
+  width: 90%;
+  text-align: left;
 }
 </style>