From 12e1ff08f51040f15a1e6377ddb2f5bc11e0eec0 Mon Sep 17 00:00:00 2001 From: DmitriyA Date: Wed, 4 Jun 2025 08:37:45 -0400 Subject: [PATCH] status color fix --- src/Charts2/PrometheusChart.jsx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Charts2/PrometheusChart.jsx b/src/Charts2/PrometheusChart.jsx index a0be805..8bbce1f 100644 --- a/src/Charts2/PrometheusChart.jsx +++ b/src/Charts2/PrometheusChart.jsx @@ -39,18 +39,18 @@ const PrometheusChart = ({ metricInfo, chartHeight = 560 }) => { const formatMetricData = (dataArray) => { return dataArray - .map(item => ({ - ...item, - timestamp: item.timestamp, - value: parseFloat(item.value), - name: item.__name__ || metricName, - status: item.status?.toString() || '0', - device: item.device?.trim() || null, - source_id: item.source_id || null, - description: item.description || description - })) - .sort((a, b) => a.timestamp - b.timestamp); - }; + .map(item => ({ + ...item, + timestamp: item.timestamp, + value: parseFloat(item.value), + name: item.__name__ || metricName, + status: parseInt(item.status) || 0, + device: item.device?.trim() || null, + source_id: item.source_id || null, + description: item.description || description + })) + .sort((a, b) => a.timestamp - b.timestamp); + }; // Обновляем логи при изменении данных useEffect(() => {