Skip to content

Commit

Permalink
Plan: add power to preview (#11038)
Browse files Browse the repository at this point in the history
  • Loading branch information
naltatis authored Dec 7, 2023
1 parent f3c814a commit 13c8f63
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
17 changes: 16 additions & 1 deletion assets/js/components/ChargingPlanPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -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;
},
Expand Down Expand Up @@ -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;
Expand Down
16 changes: 11 additions & 5 deletions assets/js/components/ChargingPlanSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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>
1 change: 1 addition & 0 deletions i18n/de.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 13c8f63

Please sign in to comment.