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(() => {