refactor(ui): refine action bar style
[e-mobility-charging-stations-simulator.git] / ui / web / src / components / actions / SetSupervisionUrl.vue
index 00f4ef3d4ebcf40d1d23ecabf9db18aceacb168b..e50316bf844f57775adb8712865f78adcae997ea 100644 (file)
@@ -1,22 +1,27 @@
 <template>
-  <h2>Action Set Supervision Url</h2>
+  <h1 id="action">Action</h1>
+  <h2>Set Supervision Url</h2>
   <h3>Charging Station {{ chargingStationId }}</h3>
   <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"
+    placeholder="wss://"
   />
   <br />
   <Button
+    id="action-button"
     @click="
       () => {
         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(() => {
           })
       }
     "
-    >Set Supervision Url</Button
   >
-  <Button @click="$router.push({ name: 'charging-stations' })">Cancel</Button>
+    Set Supervision Url
+  </Button>
+  <Button id="action-button" @click="$router.push({ name: 'charging-stations' })">Cancel</Button>
 </template>
 
 <script setup lang="ts">
@@ -47,6 +53,7 @@ const uiClient = getCurrentInstance()?.appContext.config.globalProperties.$uiCli
 
 <style>
 #supervision-url {
-  text-align: center;
+  width: 90%;
+  text-align: left;
 }
 </style>