Fix network/temp charts - use displayMetrics for selection
- Network: iterate over displayMetrics to find interfaces - Temperature: filter by displayMetrics before rendering - Show all selected temps on single chart
This commit is contained in:
parent
53ecf8bc9a
commit
fb6c7d544f
|
|
@ -806,8 +806,16 @@ document.addEventListener('mousemove', function(e) {
|
|||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% for iface in net_interfaces %}
|
||||
{% if metrics['net_in_' ~ iface] is defined and metrics['net_out_' ~ iface] is defined %}
|
||||
{% set net_interfaces_js = [] %}
|
||||
{% for m in displayMetrics %}
|
||||
{% if m starts with 'net_in_' %}
|
||||
{% set iface = m|replace({'net_in_': ''}) %}
|
||||
{% set net_interfaces_js = net_interfaces_js|merge([iface]) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% for iface in net_interfaces_js %}
|
||||
{% if ('net_in_' ~ iface) in displayMetrics and ('net_out_' ~ iface) in displayMetrics and metrics['net_in_' ~ iface] is defined and metrics['net_out_' ~ iface] is defined %}
|
||||
(function() {
|
||||
var ctx = document.getElementById('chart-net-{{ iface }}');
|
||||
if (!ctx) return;
|
||||
|
|
@ -899,7 +907,7 @@ document.addEventListener('mousemove', function(e) {
|
|||
var colorIdx = 0;
|
||||
|
||||
{% for mn, md in metrics %}
|
||||
{% if mn starts with 'temp_' %}
|
||||
{% if mn in displayMetrics and mn starts with 'temp_' %}
|
||||
if (!labelsFilled) {
|
||||
{% for p in md|slice(-1000) %}
|
||||
labels.push('{{ p.time_bucket|default(p.created_at)|date("d.m H:i") }}');
|
||||
|
|
|
|||
Loading…
Reference in New Issue