-
Notifications
You must be signed in to change notification settings - Fork 70
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 #1021 from benderl/display-cards
display theme cards
- Loading branch information
Showing
22 changed files
with
2,695 additions
and
2,091 deletions.
There are no files selected for viewing
2,798 changes: 1,597 additions & 1,201 deletions
2,798
packages/modules/display_themes/cards/source/package-lock.json
Large diffs are not rendered by default.
Oops, something went wrong.
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
184 changes: 184 additions & 0 deletions
184
packages/modules/display_themes/cards/source/src/components/ChargePoints/ManualSocInput.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,184 @@ | ||
<script> | ||
import ExtendedNumberInput from "@/components/ExtendedNumberInput.vue"; | ||
/* fontawesome */ | ||
import { library } from "@fortawesome/fontawesome-svg-core"; | ||
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; | ||
import { | ||
faDeleteLeft as fasDeleteLeft, | ||
faEraser as fasEraser, | ||
} from "@fortawesome/free-solid-svg-icons"; | ||
/* add icons to the library */ | ||
library.add(fasDeleteLeft, fasEraser); | ||
import { useMqttStore } from "@/stores/mqtt.js"; | ||
export default { | ||
name: "ManualSocInput", | ||
props: { | ||
modelValue: { required: true, type: Boolean, default: false }, | ||
vehicleId: { required: true, type: Number, default: 0 }, | ||
}, | ||
data() { | ||
return { | ||
mqttStore: useMqttStore(), | ||
newSoc: 0, | ||
}; | ||
}, | ||
components: { | ||
ExtendedNumberInput, | ||
FontAwesomeIcon, | ||
}, | ||
emits: ["update:modelValue"], | ||
methods: { | ||
enter(digit) { | ||
let tempSoc = this.newSoc * 10 + digit; | ||
if (tempSoc >= 0 && tempSoc <= 100) { | ||
this.newSoc = tempSoc; | ||
} | ||
}, | ||
removeDigit() { | ||
this.newSoc = Math.trunc(this.newSoc / 10); | ||
}, | ||
clear() { | ||
this.newSoc = 0; | ||
}, | ||
close() { | ||
this.$emit("update:modelValue", false); | ||
this.newSoc = 0; | ||
}, | ||
updateManualSoc() { | ||
this.$root.sendTopicToBroker( | ||
`openWB/vehicle/${this.vehicleId}/soc_module/configuration/soc_start`, | ||
this.newSoc | ||
); | ||
this.close(); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<template> | ||
<Teleport to="body"> | ||
<i-modal | ||
:modelValue="modelValue" | ||
@update:modelValue="$emit('update:modelValue', $event)" | ||
size="sm" | ||
> | ||
<template #header> | ||
SoC für Fahrzeug "{{ mqttStore.getVehicleName(vehicleId) }}" | ||
</template> | ||
<i-container> | ||
<i-row center class="_padding-bottom:1"> | ||
<i-column> | ||
<extended-number-input | ||
v-model="newSoc" | ||
unit="%" | ||
:min="0" | ||
:max="100" | ||
:step="1" | ||
size="lg" | ||
class="_text-align:center" | ||
/> | ||
</i-column> | ||
</i-row> | ||
<i-row center class="_padding-bottom:1"> | ||
<i-column class="_flex-grow:0"> | ||
<i-button size="lg" class="numberButton" @click="enter(1)" | ||
>1</i-button | ||
> | ||
</i-column> | ||
<i-column class="_flex-grow:0"> | ||
<i-button size="lg" class="numberButton" @click="enter(2)" | ||
>2</i-button | ||
> | ||
</i-column> | ||
<i-column class="_flex-grow:0"> | ||
<i-button size="lg" class="numberButton" @click="enter(3)" | ||
>3</i-button | ||
> | ||
</i-column> | ||
</i-row> | ||
</i-container> | ||
<i-container> | ||
<i-row center class="_padding-bottom:1"> | ||
<i-column class="_flex-grow:0"> | ||
<i-button size="lg" class="numberButton" @click="enter(4)" | ||
>4</i-button | ||
> | ||
</i-column> | ||
<i-column class="_flex-grow:0"> | ||
<i-button size="lg" class="numberButton" @click="enter(5)" | ||
>5</i-button | ||
> | ||
</i-column> | ||
<i-column class="_flex-grow:0"> | ||
<i-button size="lg" class="numberButton" @click="enter(6)" | ||
>6</i-button | ||
> | ||
</i-column> | ||
</i-row> | ||
</i-container> | ||
<i-container> | ||
<i-row center class="_padding-bottom:1"> | ||
<i-column class="_flex-grow:0"> | ||
<i-button size="lg" class="numberButton" @click="enter(7)" | ||
>7</i-button | ||
> | ||
</i-column> | ||
<i-column class="_flex-grow:0"> | ||
<i-button size="lg" class="numberButton" @click="enter(8)" | ||
>8</i-button | ||
> | ||
</i-column> | ||
<i-column class="_flex-grow:0"> | ||
<i-button size="lg" class="numberButton" @click="enter(9)" | ||
>9</i-button | ||
> | ||
</i-column> | ||
</i-row> | ||
</i-container> | ||
<i-container> | ||
<i-row center class="_padding-bottom:1"> | ||
<i-column class="_flex-grow:0"> | ||
<i-button size="lg" class="numberButton" @click="clear()"> | ||
<FontAwesomeIcon fixed-width :icon="['fas', 'fa-eraser']" /> | ||
</i-button> | ||
</i-column> | ||
<i-column class="_flex-grow:0"> | ||
<i-button size="lg" class="numberButton" @click="enter(0)" | ||
>0</i-button | ||
> | ||
</i-column> | ||
<i-column class="_flex-grow:0"> | ||
<i-button size="lg" class="numberButton" @click="removeDigit()"> | ||
<FontAwesomeIcon fixed-width :icon="['fas', 'fa-delete-left']" /> | ||
</i-button> | ||
</i-column> | ||
</i-row> | ||
</i-container> | ||
<template #footer> | ||
<i-container> | ||
<i-row> | ||
<!-- charge point data on left side --> | ||
<i-column> | ||
<i-button color="danger" @click="close()"> Zurück </i-button> | ||
</i-column> | ||
<i-column class="_text-align:right"> | ||
<i-button color="success" @click="updateManualSoc()"> | ||
OK | ||
</i-button> | ||
</i-column> | ||
</i-row> | ||
</i-container> | ||
</template> | ||
</i-modal> | ||
</Teleport> | ||
</template> | ||
|
||
<style scoped> | ||
.numberButton { | ||
min-width: 3em; | ||
min-height: 3em; | ||
} | ||
</style> |
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
Oops, something went wrong.