From 98214ff578d7ccdcd650bd047fcea54b38b03f8f Mon Sep 17 00:00:00 2001 From: antoplt Date: Tue, 18 Nov 2025 12:06:22 +0100 Subject: [PATCH] Add disk device as third metric value --- .../Details/Components/GaugeBoxes/Gauge.jsx | 13 ++++++++++++- .../Details/Components/GaugeBoxes/index.jsx | 6 +++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/client/src/Pages/v1/Infrastructure/Details/Components/GaugeBoxes/Gauge.jsx b/client/src/Pages/v1/Infrastructure/Details/Components/GaugeBoxes/Gauge.jsx index cd61b7109..8ef24a9b6 100644 --- a/client/src/Pages/v1/Infrastructure/Details/Components/GaugeBoxes/Gauge.jsx +++ b/client/src/Pages/v1/Infrastructure/Details/Components/GaugeBoxes/Gauge.jsx @@ -6,7 +6,7 @@ import { Stack, Typography, Box } from "@mui/material"; import { useTheme } from "@emotion/react"; import PropTypes from "prop-types"; -const Gauge = ({ value, heading, metricOne, valueOne, metricTwo, valueTwo }) => { +const Gauge = ({ value, heading, metricOne, valueOne, metricTwo, valueTwo, metricThree, valueThree }) => { const theme = useTheme(); const valueStyle = { @@ -19,6 +19,8 @@ const Gauge = ({ value, heading, metricOne, valueOne, metricTwo, valueTwo }) => textAlign: "right", }; + const isThirdMetric = metricThree !== undefined && valueThree !== undefined; + return ( {metricTwo} {valueTwo} + + {metricThree} + {valueThree} + diff --git a/client/src/Pages/v1/Infrastructure/Details/Components/GaugeBoxes/index.jsx b/client/src/Pages/v1/Infrastructure/Details/Components/GaugeBoxes/index.jsx index 432881e7e..d3e866bb1 100644 --- a/client/src/Pages/v1/Infrastructure/Details/Components/GaugeBoxes/index.jsx +++ b/client/src/Pages/v1/Infrastructure/Details/Components/GaugeBoxes/index.jsx @@ -10,7 +10,7 @@ import { useTheme } from "@emotion/react"; import { useTranslation } from "react-i18next"; const Gauges = ({ isLoading = false, monitor }) => { - const { decimalToPercentage, formatBytes } = useHardwareUtils(); + const { decimalToPercentage, formatBytes, formatDeviceName } = useHardwareUtils(); const theme = useTheme(); const { t } = useTranslation(); @@ -55,6 +55,8 @@ const Gauges = ({ isLoading = false, monitor }) => { valueOne: formatBytes(disk.total_bytes - disk.free_bytes, true), metricTwo: t("total"), valueTwo: formatBytes(disk.total_bytes, true), + metricThree: t("device"), + valueThree: formatDeviceName(disk.device), })), ]; @@ -74,6 +76,8 @@ const Gauges = ({ isLoading = false, monitor }) => { valueOne={gauge.valueOne} metricTwo={gauge.metricTwo} valueTwo={gauge.valueTwo} + metricThree={gauge.metricThree} + valueThree={gauge.valueThree} /> ); })}