Add metric value to tooltip, disable standard tooltip

This commit is contained in:
mirivlad 2026-02-14 18:27:59 +00:00
parent 015084211a
commit 49ed17c2c1
1 changed files with 2 additions and 1 deletions

View File

@ -497,7 +497,7 @@ new Chart(ctx{{ metricName|replace({'-': '_', '.': '_'}) }}, {
},
plugins: {
tooltip: {
enabled: true,
enabled: false,
mode: 'index',
intersect: false,
{% set metricType = metricName %}
@ -532,6 +532,7 @@ new Chart(ctx{{ metricName|replace({'-': '_', '.': '_'}) }}, {
.then(data => {
var lines = [];
lines.push('Время: ' + time);
lines.push('Значение: ' + data{{ metricName }}[dataIndex]);
{% if metricName == 'cpu_load' %}
// Показываем только top_cpu
if (data.top_cpu && data.top_cpu.length > 0) {