Fix proc metrics hide - proper Twig syntax
This commit is contained in:
parent
9117f19c4d
commit
cd14d8438a
|
|
@ -408,7 +408,6 @@ function fetchProcesses(serverId, time) {
|
|||
data.top_cpu.forEach(function(proc) {
|
||||
lines.push(' ' + proc.name + ': ' + proc.value + '%');
|
||||
});
|
||||
{% endif %}
|
||||
}
|
||||
|
||||
// Добавляем топ-процессы RAM
|
||||
|
|
@ -418,7 +417,6 @@ function fetchProcesses(serverId, time) {
|
|||
data.top_ram.forEach(function(proc) {
|
||||
lines.push(' ' + proc.name + ': ' + proc.value + '%');
|
||||
});
|
||||
{% endif %}
|
||||
}
|
||||
|
||||
resolve(lines);
|
||||
|
|
@ -426,9 +424,7 @@ function fetchProcesses(serverId, time) {
|
|||
.catch(function() {
|
||||
resolve([]);
|
||||
});
|
||||
{% endif %}
|
||||
});
|
||||
{% endif %}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -444,7 +440,6 @@ function requestServices() {
|
|||
.catch(error => {
|
||||
alert('Ошибка получения списка сервисов: ' + error);
|
||||
});
|
||||
{% endif %}
|
||||
}
|
||||
|
||||
// Обработчик кнопки "Выбрать все"
|
||||
|
|
@ -453,9 +448,7 @@ document.getElementById('selectAllServices').addEventListener('change', function
|
|||
checkboxes.forEach(checkbox => {
|
||||
checkbox.checked = this.checked;
|
||||
});
|
||||
{% endif %}
|
||||
});
|
||||
{% endif %}
|
||||
|
||||
// Активация нужной вкладки при загрузке
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
|
@ -468,7 +461,6 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
tabButton.click();
|
||||
}
|
||||
});
|
||||
{% endif %}
|
||||
|
||||
// Графики метрик
|
||||
{% for metricName, metricData in metrics %}
|
||||
|
|
@ -482,7 +474,6 @@ var data{{ metricName }} = [];
|
|||
{% for metric in metricData|slice(0, 20)|reverse %}
|
||||
labels{{ metricName }}.push('{{ metric.created_at|date('H:i') }}');
|
||||
data{{ metricName }}.push({{ metric.value|raw }});
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
new Chart(ctx{{ metricName|replace({'-': '_', '.': '_'}) }}, {
|
||||
|
|
@ -554,7 +545,6 @@ new Chart(ctx{{ metricName|replace({'-': '_', '.': '_'}) }}, {
|
|||
data.top_cpu.forEach(function(proc) {
|
||||
lines.push(' ' + proc.name + ': ' + proc.value + '%');
|
||||
});
|
||||
{% endif %}
|
||||
}
|
||||
{% elseif metricName == 'ram_used' %}
|
||||
// Показываем только top_ram
|
||||
|
|
@ -564,9 +554,7 @@ new Chart(ctx{{ metricName|replace({'-': '_', '.': '_'}) }}, {
|
|||
data.top_ram.forEach(function(proc) {
|
||||
lines.push(' ' + proc.name + ': ' + proc.value + '%');
|
||||
});
|
||||
{% endif %}
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
// Show tooltip
|
||||
var position = context.chart.canvas.getBoundingClientRect();
|
||||
|
|
@ -580,7 +568,6 @@ new Chart(ctx{{ metricName|replace({'-': '_', '.': '_'}) }}, {
|
|||
// tooltipEl.style.opacity = 0;
|
||||
// }, 3000);
|
||||
});
|
||||
{% endif %}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue