refactor(ui): use JSON format as runtime configuration
[e-mobility-charging-stations-simulator.git] / ui / web / src / components / charging-stations / CSConnector.vue
index 29bb07185804be2e641a934c2df1994447d85495..08852683919d87167451d24c402e8866170fbf4e 100644 (file)
 </template>
 
 <script setup lang="ts">
-// import { reactive } from 'vue'
-import Button from '../buttons/Button.vue'
-// import IdTagInputModal from './IdTagInputModal.vue'
+import { getCurrentInstance } from 'vue'
+// import { reactive } from 'vue';
+// import IdTagInputModal from '@/components/charging-stations/IdTagInputModal.vue'
+import Button from '@/components/buttons/Button.vue'
 import type { ConnectorStatus } from '@/types'
-import { UIClient } from '@/composables/UIClient'
-// import { compose } from '@/composables/Utils'
+// import { compose } from '@/composables'
 
 const props = defineProps<{
   hashId: string
@@ -62,28 +62,30 @@ const props = defineProps<{
 //   state.isIdTagModalVisible = false
 // }
 
+const UIClient = getCurrentInstance()?.appContext.config.globalProperties.$UIClient
+
 function startChargingStation(): void {
-  UIClient.getInstance().startChargingStation(props.hashId)
+  UIClient.startChargingStation(props.hashId)
 }
 function stopChargingStation(): void {
-  UIClient.getInstance().stopChargingStation(props.hashId)
+  UIClient.stopChargingStation(props.hashId)
 }
 function openConnection(): void {
-  UIClient.getInstance().openConnection(props.hashId)
+  UIClient.openConnection(props.hashId)
 }
 function closeConnection(): void {
-  UIClient.getInstance().closeConnection(props.hashId)
+  UIClient.closeConnection(props.hashId)
 }
 function startTransaction(): void {
-  UIClient.getInstance().startTransaction(props.hashId, props.connectorId, props.idTag)
+  UIClient.startTransaction(props.hashId, props.connectorId, props.idTag)
 }
 function stopTransaction(): void {
-  UIClient.getInstance().stopTransaction(props.hashId, props.transactionId)
+  UIClient.stopTransaction(props.hashId, props.transactionId)
 }
 function startAutomaticTransactionGenerator(): void {
-  UIClient.getInstance().startAutomaticTransactionGenerator(props.hashId, props.connectorId)
+  UIClient.startAutomaticTransactionGenerator(props.hashId, props.connectorId)
 }
 function stopAutomaticTransactionGenerator(): void {
-  UIClient.getInstance().stopAutomaticTransactionGenerator(props.hashId, props.connectorId)
+  UIClient.stopAutomaticTransactionGenerator(props.hashId, props.connectorId)
 }
 </script>