forked from openWB/openwb-ui-settings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOpenwbChargePointProxy.vue
65 lines (63 loc) · 1.79 KB
/
OpenwbChargePointProxy.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<template>
<openwb-base-heading>
Einstellungen für Ladepunkt {{ moduleName }}
</openwb-base-heading>
<component
:is="myChargePointSettingsComponent"
:configuration="configuration"
:chargePointId="chargePointId"
:chargePointType="chargePointType"
@update:configuration="updateConfiguration($event)"
/>
<hr />
<openwb-base-heading>
Befehle für Ladepunkt {{ moduleName }}
</openwb-base-heading>
<component
:is="myChargePointCommandsComponent"
:configuration="configuration"
:chargePointId="chargePointId"
:chargePointType="chargePointType"
/>
</template>
<script>
import { defineAsyncComponent } from "vue";
import OpenwbChargePointConfigFallback from "./OpenwbChargePointConfigFallback.vue";
import OpenwbChargePointCommandsFallback from "./OpenwbChargePointCommandsFallback.vue";
export default {
name: "OpenwbChargePointProxy",
emits: ["update:configuration"],
props: {
chargePointId: { required: true },
chargePointType: { type: String, required: true },
configuration: { type: Object, required: true },
moduleName: { type: String, required: false, default: undefined },
},
computed: {
myChargePointSettingsComponent() {
console.debug(
`loading charge point settings: ${this.chargePointType}`,
);
return defineAsyncComponent({
loader: () =>
import(`./${this.chargePointType}/chargePoint.vue`),
errorComponent: OpenwbChargePointConfigFallback,
});
},
myChargePointCommandsComponent() {
console.debug(
`loading charge point commands: ${this.chargePointType}`,
);
return defineAsyncComponent({
loader: () => import(`./${this.chargePointType}/commands.vue`),
errorComponent: OpenwbChargePointCommandsFallback,
});
},
},
methods: {
updateConfiguration(event) {
this.$emit("update:configuration", event);
},
},
};
</script>