Plan: add power to preview (#11038)

This commit is contained in:
Michael Geers 2023-12-07 18:07:27 +01:00 • committed by GitHub
parent f3c814a51b
commit 13c8f6337e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 6 deletions

View file

@ -3,7 +3,12 @@
<div class="justify-content-between mb-2 d-flex justify-content-between">
<div class="text-start">
<div class="label">{{ $t("main.targetChargePlan.chargeDuration") }}</div>
<div class="value text-primary">{{ planDuration }}</div>
<div class="value text-primary d-sm-flex align-items-baseline">
<div>{{ planDuration }}</div>
<div v-if="fmtPower" class="extraValue text-nowrap ms-sm-1">
{{ fmtPower }}
</div>
</div>
</div>
<div v-if="hasTariff" class="text-end">
<div class="label">
@ -45,6 +50,12 @@ export default {
planDuration() {
return this.fmtDuration(this.duration);
},
fmtPower() {
if (this.duration > 0 && this.power > 0) {
return `@ ${this.fmtKw(this.power)}`;
}
return null;
},
isCo2() {
return this.smartCostType === CO2_TYPE;
},
@ -145,6 +156,10 @@ export default {
font-size: 18px;
font-weight: bold;
}
.extraValue {
color: var(--evcc-gray);
font-size: 14px;
}
.label {
color: var(--evcc-gray);
text-transform: uppercase;

View file

@ -28,7 +28,9 @@
<div v-if="plans.length > 0">
<ChargingPlanWarnings v-bind="chargingPlanWarningsProps" class="mb-4" />
<hr />
<h5>PREVIEW</h5>
<h5>
<div class="inner">{{ $t("main.targetCharge.preview") }}</div>
</h5>
<ChargingPlanPreview
v-if="chargingPlanPreviewProps"
v-bind="chargingPlanPreviewProps"
@ -164,13 +166,17 @@ export default {
<style scoped>
h5 {
position: relative;
display: inline-block;
background-color: var(--evcc-box);
display: flex;
top: -25px;
left: calc(50% - 50px);
padding: 0 0.5rem;
justify-content: center;
}
h5 .inner {
padding: 0 0.5rem;
background-color: var(--evcc-box);
font-weight: normal;
color: var(--evcc-gray);
margin-bottom: -4rem;
text-transform: uppercase;
text-align: center;
}
</style>

View file

@ -252,6 +252,7 @@ planDuration = "Ladedauer"
planPeriodLabel = "Zeitraum"
planPeriodValue = "{start} bis {end}"
planUnknown = "noch unbekannt"
preview = "Vorschau"
priceLimit = "Preisgrenze von {price}"
remove = "Entfernen"
setPlan = "Ladeplan festlegen"

View file

@ -253,6 +253,7 @@ planDuration = "Charging time"
planPeriodLabel = "Period"
planPeriodValue = "{start} to {end}"
planUnknown = "not known yet"
preview = "Preview"
priceLimit = "price limit of {price}"
remove = "Remove"
setPlan = "Set a charging plan"