Hide proc metrics from HTML output

This commit is contained in:
mirivlad 2026-02-14 19:02:21 +00:00
parent cd14d8438a
commit 70393075cb
1 changed files with 15 additions and 7 deletions

View File

@ -108,6 +108,7 @@
<div class="row"> <div class="row">
{% for metricName, metricData in metrics %} {% for metricName, metricData in metrics %}
{% if metricName != 'top_cpu_proc' and metricName != 'top_ram_proc' %}
<div class="col-12 mb-4"> <div class="col-12 mb-4">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
@ -133,7 +134,8 @@
</div> </div>
</div> </div>
</div> </div>
{% endfor %} {% endif %}
{% if metrics|length == 0 %} {% if metrics|length == 0 %}
<div class="col-12"> <div class="col-12">
@ -218,7 +220,8 @@
</div> </div>
</div> </div>
</div> </div>
{% endfor %} {% endif %}
{% for service in stoppedServices %} {% for service in stoppedServices %}
<div class="col-md-4 col-lg-3 mb-2"> <div class="col-md-4 col-lg-3 mb-2">
@ -249,7 +252,8 @@
</div> </div>
</div> </div>
</div> </div>
{% endfor %} {% endif %}
{% for service in unknownServices %} {% for service in unknownServices %}
<div class="col-md-4 col-lg-3 mb-2"> <div class="col-md-4 col-lg-3 mb-2">
@ -280,7 +284,8 @@
</div> </div>
</div> </div>
</div> </div>
{% endfor %} {% endif %}
{% else %} {% else %}
<div class="col-12"> <div class="col-12">
<div class="alert alert-warning text-center"> <div class="alert alert-warning text-center">
@ -364,7 +369,8 @@
</div> </div>
</div> </div>
</div> </div>
{% endfor %} {% endif %}
<div class="d-grid gap-2 d-md-flex justify-content-md-end"> <div class="d-grid gap-2 d-md-flex justify-content-md-end">
<button type="submit" class="btn btn-primary"> <button type="submit" class="btn btn-primary">
@ -465,6 +471,7 @@ document.addEventListener('DOMContentLoaded', function() {
// Графики метрик // Графики метрик
{% for metricName, metricData in metrics %} {% for metricName, metricData in metrics %}
{% if metricName != 'top_cpu_proc' and metricName != 'top_ram_proc' %} {% if metricName != 'top_cpu_proc' and metricName != 'top_ram_proc' %}
{% if metricName != 'top_cpu_proc' and metricName != 'top_ram_proc' %}
const ctx{{ metricName|replace({'-': '_', '.': '_'}) }} = document.getElementById('chart-{{ metricName }}').getContext('2d'); const ctx{{ metricName|replace({'-': '_', '.': '_'}) }} = document.getElementById('chart-{{ metricName }}').getContext('2d');
// Подготовка данных для графика // Подготовка данных для графика
@ -474,7 +481,8 @@ var data{{ metricName }} = [];
{% for metric in metricData|slice(0, 20)|reverse %} {% for metric in metricData|slice(0, 20)|reverse %}
labels{{ metricName }}.push('{{ metric.created_at|date('H:i') }}'); labels{{ metricName }}.push('{{ metric.created_at|date('H:i') }}');
data{{ metricName }}.push({{ metric.value|raw }}); data{{ metricName }}.push({{ metric.value|raw }});
{% endfor %} {% endif %}
new Chart(ctx{{ metricName|replace({'-': '_', '.': '_'}) }}, { new Chart(ctx{{ metricName|replace({'-': '_', '.': '_'}) }}, {
type: 'line', type: 'line',
@ -574,6 +582,6 @@ new Chart(ctx{{ metricName|replace({'-': '_', '.': '_'}) }}, {
} }
}); });
{% endif %} {% endif %}
{% endfor %}
</script> </script>
{% endblock %} {% endblock %}