Commit | Line | Data |
---|---|---|
32de5a57 LM |
1 | <template> |
2 | <td class="cs-table__action-col"> | |
8fc2e5cc JB |
3 | <Button @click="startChargingStation()">Start Charging Station</Button> |
4 | <Button @click="stopChargingStation()">Stop Charging Station</Button> | |
5 | <Button @click="openConnection()">Open Connection</Button> | |
6 | <Button @click="closeConnection()">Close Connection</Button> | |
32de5a57 | 7 | <Button @click="startTransaction()">Start Transaction</Button> |
5a010bf0 JB |
8 | <!-- <IdTagInputModal |
9 | :visibility="state.isIdTagModalVisible" | |
01ff4231 | 10 | :id-tag="state.idTag" |
5a010bf0 | 11 | @close="hideIdTagModal()" |
f568f368 | 12 | @done="compose(state.transaction, hideIdTagModal)()" |
32de5a57 | 13 | > |
5a010bf0 JB |
14 | Start Transaction |
15 | </IdTagInputModal> --> | |
16 | <Button @click="stopTransaction()">Stop Transaction</Button> | |
757b2ecf JB |
17 | <Button @click="startAutomaticTransactionGenerator()">Start ATG</Button> |
18 | <Button @click="stopAutomaticTransactionGenerator()">Stop ATG</Button> | |
32de5a57 LM |
19 | </td> |
20 | <td class="cs-table__connector-col">{{ connectorId }}</td> | |
5a010bf0 | 21 | <td class="cs-table__status-col">{{ connector.status }}</td> |
8fc2e5cc | 22 | <td class="cs-table__transaction-col">{{ connector.transactionStarted ? 'Yes' : 'No' }}</td> |
32de5a57 LM |
23 | </template> |
24 | ||
25 | <script setup lang="ts"> | |
66a7748d JB |
26 | // import { reactive } from 'vue' |
27 | import Button from '../buttons/Button.vue' | |
28 | // import IdTagInputModal from './IdTagInputModal.vue' | |
29 | import type { ConnectorStatus } from '@/types' | |
30 | import { UIClient } from '@/composables/UIClient' | |
31 | // import { compose } from '@/composables/Utils' | |
32de5a57 LM |
32 | |
33 | const props = defineProps<{ | |
66a7748d JB |
34 | hashId: string |
35 | connector: ConnectorStatus | |
36 | connectorId: number | |
37 | transactionId?: number | |
38 | idTag?: string | |
39 | }>() | |
32de5a57 | 40 | |
5a010bf0 | 41 | // type State = { |
66a7748d JB |
42 | // isIdTagModalVisible: boolean |
43 | // idTag: string | |
44 | // transaction: () => void | |
45 | // } | |
32de5a57 | 46 | |
5a010bf0 JB |
47 | // const state: State = reactive({ |
48 | // isIdTagModalVisible: false, | |
49 | // idTag: '', | |
66a7748d JB |
50 | // transaction: startTransaction |
51 | // }) | |
32de5a57 | 52 | |
5a010bf0 | 53 | // function getIdTag(transaction: () => void): void { |
66a7748d JB |
54 | // state.transaction = transaction |
55 | // showTagModal() | |
5a010bf0 JB |
56 | // } |
57 | ||
58 | // function showTagModal(): void { | |
66a7748d | 59 | // state.isIdTagModalVisible = true |
5a010bf0 JB |
60 | // } |
61 | // function hideIdTagModal(): void { | |
66a7748d | 62 | // state.isIdTagModalVisible = false |
5a010bf0 | 63 | // } |
32de5a57 | 64 | |
8fc2e5cc | 65 | function startChargingStation(): void { |
66a7748d | 66 | UIClient.getInstance().startChargingStation(props.hashId) |
32de5a57 | 67 | } |
8fc2e5cc | 68 | function stopChargingStation(): void { |
66a7748d | 69 | UIClient.getInstance().stopChargingStation(props.hashId) |
32de5a57 | 70 | } |
5a010bf0 | 71 | function openConnection(): void { |
66a7748d | 72 | UIClient.getInstance().openConnection(props.hashId) |
5a010bf0 JB |
73 | } |
74 | function closeConnection(): void { | |
66a7748d | 75 | UIClient.getInstance().closeConnection(props.hashId) |
5a010bf0 | 76 | } |
8fc2e5cc | 77 | function startTransaction(): void { |
66a7748d | 78 | UIClient.getInstance().startTransaction(props.hashId, props.connectorId, props.idTag) |
8fc2e5cc JB |
79 | } |
80 | function stopTransaction(): void { | |
66a7748d | 81 | UIClient.getInstance().stopTransaction(props.hashId, props.transactionId) |
8fc2e5cc | 82 | } |
757b2ecf | 83 | function startAutomaticTransactionGenerator(): void { |
66a7748d | 84 | UIClient.getInstance().startAutomaticTransactionGenerator(props.hashId, props.connectorId) |
757b2ecf JB |
85 | } |
86 | function stopAutomaticTransactionGenerator(): void { | |
66a7748d | 87 | UIClient.getInstance().stopAutomaticTransactionGenerator(props.hashId, props.connectorId) |
757b2ecf | 88 | } |
32de5a57 | 89 | </script> |