Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions packages/modules/web_themes/standard_legacy/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ <h3 class="mb-0">Termine Zeitladen</h3>
<div class="form-row mb-1 charge-point-time-charge-plan charge-point-time-charge-plan-template hide"
data-plan-type="time_charging"
data-plan=""
data-index=""
>
<div class="col">
<span class="charge-point-time-charge-name">--</span>
Expand Down Expand Up @@ -995,7 +996,9 @@ <h3 class="mb-0">Einstellungen für "Ziel"</h3>
Es wurden noch keine Zeitpläne eingerichtet!
</div>
<div class="form-row mb-1 charge-point-schedule-plan charge-point-schedule-plan-template hide"
data-plan="">
data-plan=""
data-index=""
>
<div class="col">
<span class="charge-point-schedule-name">--</span>
</div>
Expand Down Expand Up @@ -1549,7 +1552,7 @@ <h4 class="modal-title">
// some helper functions
'helperFunctions.js?ver=20250217',
// functions for processing messages
'processAllMqttMsg.js?ver=20250731',
'processAllMqttMsg.js?ver=20250801',
// respective Chart.js definition live
'livechart.js?ver=20250404',
// respective Chart.js definition price based charging
Expand Down Expand Up @@ -1632,12 +1635,13 @@ <h4 class="modal-title">
const parentChargePoint = $(this).closest('[data-cp]');
const chargePointIndex = parseInt(parentChargePoint.data('cp'));
const planId = parseInt($(this).closest('.charge-point-time-charge-plan').data('plan'));
if (!isNaN(chargePointIndex) && !isNaN(planId)) {
console.log('toggle time charge plan', chargePointIndex, planId);
const planIndex = parseInt($(this).closest('.charge-point-time-charge-plan').data('plan-index'));
if (!isNaN(chargePointIndex) && !isNaN(planId) && !isNaN(planIndex)) {
const object = "chargeTemplate";
const objectPath = "time_charging.plans." + planId + ".active";
const objectPath = "time_charging.plans." + planIndex + ".active";
const topic = "openWB/set/chargepoint/" + chargePointIndex + "/set/charge_template";
const option = !$(this).hasClass('charge-point-plan-pill-active');
console.log('toggle time charge plan', chargePointIndex, planId, planIndex, option);
if (typeof window[object] !== undefined && window[object][chargePointIndex] !== undefined) {
let currentObjectState = JSON.parse(JSON.stringify(window[object][chargePointIndex]));
currentObjectState = updateObject(currentObjectState, objectPath, option);
Expand Down Expand Up @@ -1665,12 +1669,13 @@ <h4 class="modal-title">
const parentChargePoint = $(this).closest('[data-cp]');
const chargePointIndex = parseInt(parentChargePoint.data('cp'));
const planId = parseInt($(this).closest('.charge-point-schedule-plan').data('plan'));
if (!isNaN(chargePointIndex) && !isNaN(planId)) {
console.log('toggle schedule plan', chargePointIndex, planId);
const planIndex = parseInt($(this).closest('.charge-point-schedule-plan').data('plan-index'));
if (!isNaN(chargePointIndex) && !isNaN(planId) && !isNaN(planIndex)) {
const object = "chargeTemplate";
const objectPath = "chargemode.scheduled_charging.plans." + planId + ".active";
const objectPath = "chargemode.scheduled_charging.plans." + planIndex + ".active";
const topic = "openWB/set/chargepoint/" + chargePointIndex + "/set/charge_template";
const option = !$(this).hasClass('charge-point-plan-pill-active');
console.log('toggle schedule plan', chargePointIndex, planId, planIndex, option);
if (typeof window[object] !== undefined && window[object][chargePointIndex] !== undefined) {
let currentObjectState = JSON.parse(JSON.stringify(window[object][chargePointIndex]));
currentObjectState = updateObject(currentObjectState, objectPath, option);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,15 @@ function refreshChargeTemplate(chargePointIndex) {
chargeTemplate[chargePointIndex].chargemode.scheduled_charging.plans.length > 0
) {
chargePoint.find(".charge-point-schedule-plan-missing").addClass("hide");
for (const value of chargeTemplate[chargePointIndex].chargemode.scheduled_charging.plans) {
for (const [index, value] of chargeTemplate[chargePointIndex].chargemode.scheduled_charging.plans.entries()) {
const key = value.id;
// console.debug("schedule", key, value);
if (chargePoint.find('.charge-point-schedule-plan[data-plan=' + key + ']').length == 0) {
// console.log('creating schedule plan with id "'+key+'"');
var clonedElement = sourceElement.clone();
// update all data referencing the old index in our clone
clonedElement.attr('data-plan', key).data('plan', key);
clonedElement.attr('data-plan-index', index).data('plan-index', index);
// insert after last existing plan to honor sorting from the array
target = chargePoint.find('.charge-point-schedule-plan').last();
// console.log("target: "+target.data('plan')+" index: "+key);
Expand Down Expand Up @@ -360,14 +361,15 @@ function refreshChargeTemplate(chargePointIndex) {
chargeTemplate[chargePointIndex].time_charging.plans.length > 0
) {
chargePoint.find(".charge-point-time-charge-plan-missing").addClass("hide");
for (const value of chargeTemplate[chargePointIndex].time_charging.plans) {
for (const [index, value] of chargeTemplate[chargePointIndex].time_charging.plans.entries()) {
const key = value.id;
// console.debug("schedule", key, value);
if (chargePoint.find('.charge-point-time-charge-plan[data-plan=' + key + ']').length == 0) {
// console.log('creating time charge plan with id "'+key+'"');
var clonedElement = sourceElement.clone();
// update all data referencing the old index in our clone
clonedElement.attr('data-plan', key).data('plan', key);
clonedElement.attr('data-plan-index', index).data('plan-index', index);
// insert after last existing plan to honor sorting from the array
target = chargePoint.find('.charge-point-time-charge-plan').last();
// console.log("target: "+target.data('plan')+" index: "+key);
Expand Down