Fix JS syntax in temperature chart loop

This commit is contained in:
mirivlad 2026-04-26 18:24:41 +08:00
parent 3f94d84d7c
commit 08a137fdf0
1 changed files with 2 additions and 3 deletions

View File

@ -760,7 +760,6 @@ chart{{ metricName|replace({'-': '_', '.': '_'}) }}.canvas.addEventListener('mou
{% endif %} {% endif %}
{% endfor %} {% endfor %}
});
@ -874,7 +873,7 @@ chart{{ metricName|replace({'-': '_', '.': '_'}) }}.canvas.addEventListener('mou
var colorIdx = 0; var colorIdx = 0;
{% for mn, md in metrics %} {% for mn, md in metrics %}
{% if mn in displayMetrics and mn starts with 'temp_' %} {% if mn in displayMetrics and mn starts with 'temp_' %}
if (!labelsFilled) { if (!labelsFilled) {
{% for p in md|slice(-1000) %} {% for p in md|slice(-1000) %}
labels.push('{{ p.time_bucket|default(p.created_at)|date("d.m H:i") }}'); labels.push('{{ p.time_bucket|default(p.created_at)|date("d.m H:i") }}');
@ -902,7 +901,7 @@ chart{{ metricName|replace({'-': '_', '.': '_'}) }}.canvas.addEventListener('mou
borderWidth: 2 borderWidth: 2
}); });
})(); })();
{% endif %} {% endif %}
{% endfor %} {% endfor %}
var chart = new Chart(ctx.getContext('2d'), { var chart = new Chart(ctx.getContext('2d'), {