Planner: faster loading (#12673)

This commit is contained in:
Michael Geers 2024-03-05 09:19:54 +01:00 • committed by GitHub
parent 7e59b889b0
commit f41901baf6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 4 deletions

View file

@ -23,7 +23,7 @@
{{ $t(`main.targetCharge.${isPreview ? "preview" : "currentPlan"}`) }}
</div>
</h5>
<ChargingPlanPreview v-if="chargingPlanPreviewProps" v-bind="chargingPlanPreviewProps" />
<ChargingPlanPreview v-bind="chargingPlanPreviewProps" />
</div>
</template>
@ -136,6 +136,10 @@ export default {
}
},
fetchPlanDebounced: async function (preview) {
if (!this.debounceTimer) {
await this.fetchPlan(preview);
return;
}
clearTimeout(this.debounceTimer);
this.debounceTimer = setTimeout(async () => await this.fetchPlan(preview), 1000);
},

View file

@ -90,9 +90,9 @@ export default {
priceStyle(price) {
const value = price === undefined ? this.avgPrice : price;
const height =
value !== undefined
value !== undefined && !isNaN(value)
? `${10 + (90 / this.priceInfo.range) * (value - this.priceInfo.min)}%`
: "100%";
: "75%";
return { height };
},
},
@ -116,7 +116,9 @@ export default {
flex-direction: column;
position: relative;
opacity: 1;
transition: opacity var(--evcc-transition-fast) linear;
transition-property: opacity, background, color;
transition-duration: var(--evcc-transition-fast);
transition-timing-function: ease-in;
}
@media (max-width: 991px) {
.chart {
@ -148,6 +150,7 @@ export default {
display: flex;
justify-content: center;
color: var(--bs-white);
transition: height var(--evcc-transition-fast) ease-in;
}
.slot-label {
color: var(--bs-gray-light);