Merge pull request #2409 from bluewave-labs/Capture-version-on-details-page
Capture version on details page
This commit is contained in:
5 files changed
+33
-2
No files matched your search
@@ -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 <SkeletonLayout />;
|
||||
}
|
||||
|
||||
const intervalText = t("monitorStatus.checkingEvery", {
|
||||
interval: formatDurationRounded(monitor?.interval),
|
||||
});
|
||||
|
||||
const captureVersion = monitor?.stats?.aggregateData?.latestCheck?.capture?.version;
|
||||
|
||||
return (
|
||||
<Stack
|
||||
direction="row"
|
||||
@@ -36,7 +44,16 @@ const MonitorStatusHeader = ({ path, isLoading = false, isAdmin, monitor }) => {
|
||||
</Typography>
|
||||
<Dot />
|
||||
<Typography>
|
||||
Checking every {formatDurationRounded(monitor?.interval)}.
|
||||
{intervalText}
|
||||
{captureVersion && (
|
||||
<>
|
||||
{" "}
|
||||
{t("monitorStatus.withCaptureAgent", {
|
||||
version: captureVersion,
|
||||
})}
|
||||
</>
|
||||
)}
|
||||
.
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
@@ -17,7 +17,6 @@ const useHardwareMonitorsFetch = ({ monitorId, dateRange }) => {
|
||||
monitorId: monitorId,
|
||||
dateRange: dateRange,
|
||||
});
|
||||
response.data.data;
|
||||
setMonitor(response.data.data);
|
||||
} catch (error) {
|
||||
setNetworkError(true);
|
||||
|
||||
@@ -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 <short_id> 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}}"
|
||||
}
|
||||
}
|
||||
@@ -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 }
|
||||
);
|
||||
|
||||
@@ -243,6 +243,7 @@ class StatusService {
|
||||
check.disk = disk ?? {};
|
||||
check.host = host ?? {};
|
||||
check.errors = errors ?? [];
|
||||
check.capture = payload?.capture ?? {};
|
||||
}
|
||||
return check;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user