diff --git a/assets/css/app.css b/assets/css/app.css index d1fa6fee7..79011c50c 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -428,3 +428,10 @@ input[type="time"]::-webkit-calendar-picker-indicator { .table { --bs-table-bg: transparent; } + +/* larger check switch */ +.form-switch .form-check-input { + height: 1.1rem; + width: calc(1.2rem + 0.75rem); + border-radius: 3rem; +} diff --git a/assets/js/components/ChargingPlanPreview.vue b/assets/js/components/ChargingPlanPreview.vue index f8023fd3f..9478348ac 100644 --- a/assets/js/components/ChargingPlanPreview.vue +++ b/assets/js/components/ChargingPlanPreview.vue @@ -75,6 +75,9 @@ export default { return hourSum ? priceSum / hourSum : undefined; }, fmtAvgPrice() { + if (!this.targetTime) { + return "—"; + } let price = this.activeSlot ? this.activeSlot.price : this.avgPrice; if (price === undefined) { return this.$t("main.targetChargePlan.unknownPrice"); @@ -109,7 +112,7 @@ export default { end.setHours(startHour + 1); const endHour = end.getHours(); const day = this.weekdayShort(start); - const toLate = this.targetTime.getTime() <= start.getTime(); + const toLate = this.targetTime && this.targetTime.getTime() <= start.getTime(); // TODO: handle multiple matching time slots const price = this.findSlotInRange(start, end, rates)?.price; const charging = this.findSlotInRange(start, end, plan) != null; diff --git a/assets/js/components/ChargingPlanSettings.vue b/assets/js/components/ChargingPlanSettings.vue index 14911a80f..511b48361 100644 --- a/assets/js/components/ChargingPlanSettings.vue +++ b/assets/js/components/ChargingPlanSettings.vue @@ -1,41 +1,28 @@ @@ -86,11 +73,8 @@ export default { chargingPlanWarningsProps: function () { return this.collectProps(ChargingPlanWarnings); }, - selectedTargetTime: function () { - return new Date(this.effectivePlanTime); - }, chargingPlanPreviewProps: function () { - const targetTime = this.selectedTargetTime; + const targetTime = this.effectivePlanTime ? new Date(this.effectivePlanTime) : null; const { rates } = this.tariff; const { duration, plan, power } = this.plan; const { currency, smartCostType } = this; @@ -112,7 +96,7 @@ export default { }, methods: { fetchPlan: async function () { - if (this.plans.length > 0 && !this.loading) { + if (!this.loading) { try { this.loading = true; this.plan = (await api.get(`loadpoints/${this.id}/plan`)).data.result; @@ -168,6 +152,7 @@ h5 { position: relative; display: flex; top: -25px; + margin-bottom: -0.5rem; padding: 0 0.5rem; justify-content: center; } diff --git a/assets/js/components/ChargingPlanSettingsEntry.vue b/assets/js/components/ChargingPlanSettingsEntry.vue index b2fa44c60..f3270fe75 100644 --- a/assets/js/components/ChargingPlanSettingsEntry.vue +++ b/assets/js/components/ChargingPlanSettingsEntry.vue @@ -6,7 +6,7 @@ {{ $t("main.chargingPlan.day") }} -
+
@@ -16,7 +16,9 @@ {{ $t("main.chargingPlan.goal") }}
-
+
+ +
@@ -41,7 +43,7 @@ {{ $t("main.chargingPlan.time") }}
-
+
-
+
+ +
+
+
+ +
+

+ + {{ $t("main.targetCharge.targetIsInThePast") }} + +