-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1301 from benderl/rename-rfid
Rename rfid
- Loading branch information
Showing
17 changed files
with
431 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
packages/modules/display_themes/cards/source/src/components/ChargePointCodeButton.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
<script> | ||
/* fontawesome */ | ||
import { library } from "@fortawesome/fontawesome-svg-core"; | ||
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; | ||
import { | ||
faCalculator as fasCalculator, | ||
} from "@fortawesome/free-solid-svg-icons"; | ||
/* add icons to the library */ | ||
library.add(fasCalculator); | ||
import { useMqttStore } from "@/stores/mqtt.js"; | ||
import CodeInputModal from "./CodeInputModal.vue" | ||
export default { | ||
name: "ChargePointCodeButton", | ||
props: { | ||
chargePointId: { type: Number, required: true }, | ||
}, | ||
data() { | ||
return { | ||
mqttStore: useMqttStore(), | ||
modalIdTagEntryVisible: false, | ||
modalIdTagEntryColor: "warning", | ||
code: "", | ||
}; | ||
}, | ||
components: { | ||
FontAwesomeIcon, | ||
CodeInputModal, | ||
}, | ||
computed: { | ||
tagState() { | ||
return this.mqttStore.getChargepointTagState(this.chargePointId); | ||
}, | ||
tagButtonColor() { | ||
switch (this.tagState) { | ||
case 2: | ||
return "success"; | ||
case 1: | ||
return "warning"; | ||
default: | ||
return ""; | ||
} | ||
}, | ||
tagClass() { | ||
switch (this.tagState) { | ||
case 2: | ||
return "_color:success-80"; | ||
case 1: | ||
return "_color:warning-80"; | ||
default: | ||
return ""; | ||
} | ||
} | ||
}, | ||
methods: { | ||
toggleIdTagModal() { | ||
this.modalIdTagEntryVisible = !this.modalIdTagEntryVisible; | ||
}, | ||
sendIdTag(event) { | ||
this.$root.sendTopicToBroker( | ||
`openWB/chargepoint/${this.chargePointId}/get/rfid`, | ||
event | ||
); | ||
this.modalIdTagEntryVisible = false; | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<template> | ||
<i-button | ||
@click="toggleIdTagModal()" | ||
class="_margin-right:1" | ||
size="lg" | ||
:color="tagButtonColor" | ||
:disabled="tagState == 2" | ||
> | ||
<FontAwesomeIcon | ||
fixed-width | ||
:icon="['fas', 'fa-calculator']" | ||
:class="tagClass" | ||
/> | ||
</i-button> | ||
<!-- modals --> | ||
<CodeInputModal | ||
v-model="modalIdTagEntryVisible" | ||
@update:input-value="sendIdTag" | ||
ref="lockInput" | ||
:minLength="4" | ||
:maxLength="20" | ||
> | ||
<template #header> | ||
Bitte einen ID-Tag eingeben. | ||
</template> | ||
</CodeInputModal> | ||
</template> | ||
|
||
<style scoped> | ||
</style> |
Oops, something went wrong.