diff --git a/client/src/Components/MonitorStatusHeader/index.jsx b/client/src/Components/MonitorStatusHeader/index.jsx index 14ae39b8a..7ea95410b 100644 --- a/client/src/Components/MonitorStatusHeader/index.jsx +++ b/client/src/Components/MonitorStatusHeader/index.jsx @@ -7,14 +7,22 @@ import { formatDurationRounded } from "../../Utils/timeUtils"; import ConfigButton from "./ConfigButton"; import SkeletonLayout from "./skeleton"; import PropTypes from "prop-types"; +import { useTranslation } from "react-i18next"; const MonitorStatusHeader = ({ path, isLoading = false, isAdmin, monitor }) => { const theme = useTheme(); + const { t } = useTranslation(); const { statusColor, determineState } = useUtils(); if (isLoading) { return ; } + const intervalText = t("monitorStatus.checkingEvery", { + interval: formatDurationRounded(monitor?.interval), + }); + + const captureVersion = monitor?.stats?.aggregateData?.latestCheck?.capture?.version; + return ( { - Checking every {formatDurationRounded(monitor?.interval)}. + {intervalText} + {captureVersion && ( + <> + {" "} + {t("monitorStatus.withCaptureAgent", { + version: captureVersion, + })} + + )} + . diff --git a/client/src/Pages/Infrastructure/Details/Hooks/useHardwareMonitorsFetch.jsx b/client/src/Pages/Infrastructure/Details/Hooks/useHardwareMonitorsFetch.jsx index 30a54eef0..f7cb2abb1 100644 --- a/client/src/Pages/Infrastructure/Details/Hooks/useHardwareMonitorsFetch.jsx +++ b/client/src/Pages/Infrastructure/Details/Hooks/useHardwareMonitorsFetch.jsx @@ -17,7 +17,6 @@ const useHardwareMonitorsFetch = ({ monitorId, dateRange }) => { monitorId: monitorId, dateRange: dateRange, }); - response.data.data; setMonitor(response.data.data); } catch (error) { setNetworkError(true); diff --git a/client/src/locales/en.json b/client/src/locales/en.json index 63802c7dc..5b593bd4b 100644 --- a/client/src/locales/en.json +++ b/client/src/locales/en.json @@ -649,5 +649,9 @@ "ping": "Enter the IP address or hostname to ping (e.g., 192.168.1.100 or example.com) and add a clear display name that appears on the dashboard.", "docker": "Enter the Docker ID of your container. Docker IDs must be the full 64 char Docker ID. You can run docker inspect to get the full container ID.", "port": "Enter the URL or IP of the server, the port number and a clear display name that appears on the dashboard." + }, + "monitorStatus": { + "checkingEvery": "Checking every {{interval}}", + "withCaptureAgent": "with Capture agent {{version}}" } } diff --git a/server/db/models/HardwareCheck.js b/server/db/models/HardwareCheck.js index 76b9dfc2e..bda9f693c 100755 --- a/server/db/models/HardwareCheck.js +++ b/server/db/models/HardwareCheck.js @@ -35,6 +35,11 @@ const errorSchema = mongoose.Schema({ err: { type: String, default: "" }, }); +const captureSchema = mongoose.Schema({ + version: { type: String, default: "" }, + mode: { type: String, default: "" }, +}); + const HardwareCheckSchema = mongoose.Schema( { ...BaseCheckSchema.obj, @@ -59,6 +64,11 @@ const HardwareCheckSchema = mongoose.Schema( type: [errorSchema], default: () => [], }, + + capture: { + type: captureSchema, + default: () => ({}), + }, }, { timestamps: true } ); diff --git a/server/service/statusService.js b/server/service/statusService.js index 0b555439d..3d7bb4543 100755 --- a/server/service/statusService.js +++ b/server/service/statusService.js @@ -243,6 +243,7 @@ class StatusService { check.disk = disk ?? {}; check.host = host ?? {}; check.errors = errors ?? []; + check.capture = payload?.capture ?? {}; } return check; };