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