repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor(ui): cleanup UI client instance getter
[e-mobility-charging-stations-simulator.git]
/
ui
/
web
/
src
/
components
/
actions
/
StartTransaction.vue
diff --git
a/ui/web/src/components/actions/StartTransaction.vue
b/ui/web/src/components/actions/StartTransaction.vue
index b887357bf81761ee33e76c9bcde418b224dde7eb..18145d8d8fad25fbc7467f2acca80aeb9fe33670 100644
(file)
--- a/
ui/web/src/components/actions/StartTransaction.vue
+++ b/
ui/web/src/components/actions/StartTransaction.vue
@@
-1,7
+1,7
@@
<template>
<template>
- <h1 id="action">
A
ction</h1>
- <h2>
Start Transaction
</h2>
- <h3>Connector {{ connectorId }}
on {{ chargingStationId }}
</h3>
+ <h1 id="action">
Start Transa
ction</h1>
+ <h2>
{{ chargingStationId }}
</h2>
+ <h3>Connector {{ connectorId }}</h3>
<p>Scan RFID tag:</p>
<input id="idtag" v-model.trim="state.idTag" type="text" name="idtag" placeholder="RFID tag" />
<br />
<p>Scan RFID tag:</p>
<input id="idtag" v-model.trim="state.idTag" type="text" name="idtag" placeholder="RFID tag" />
<br />
@@
-9,8
+9,8
@@
id="action-button"
@click="
() => {
id="action-button"
@click="
() => {
- uiClient
- .startTransaction(
props.hashId, parseInt(props.
connectorId), state.idTag)
+
$
uiClient
+ .startTransaction(
hashId, convertToInt(
connectorId), state.idTag)
.then(() => {
$toast.success('Transaction successfully started')
})
.then(() => {
$toast.success('Transaction successfully started')
})
@@
-26,24
+26,22
@@
>
Start Transaction
</Button>
>
Start Transaction
</Button>
- <Button id="action-button" @click="$router.push({ name: 'charging-stations' })">Cancel</Button>
</template>
<script setup lang="ts">
</template>
<script setup lang="ts">
-import {
defineProps, getCurrentInstance, reactive
} from 'vue'
+import {
ref
} from 'vue'
import Button from '@/components/buttons/Button.vue'
import Button from '@/components/buttons/Button.vue'
+import { convertToInt } from '@/composables'
-
const props =
defineProps<{
+defineProps<{
hashId: string
chargingStationId: string
connectorId: string
}>()
hashId: string
chargingStationId: string
connectorId: string
}>()
-const state = re
active
({
+const state = re
f<{ idTag: string }>
({
idTag: ''
})
idTag: ''
})
-
-const uiClient = getCurrentInstance()?.appContext.config.globalProperties.$uiClient
</script>
<style>
</script>
<style>