Merge pull request #3088 from bluewave-labs/fix-traslator-error

fix translator error and add format
This commit is contained in:
Alexander Holliday authored and GitHub committed 2025-12-22 09:41:58 -08:00
commit 668ea7418d
6 files changed
+61 -36

No files matched your search

@@ -26,7 +26,10 @@ const DiskSelection = ({ availableDisks, selectedDisks, onChange }) => {
return (
<ConfigBox>
<Box>
<Typography component="h2" variant="h2">
<Typography
component="h2"
variant="h2"
>
{t("v1.infrastructure.disk_selection_title")}
</Typography>
<Typography component="p">
@@ -35,10 +38,10 @@ const DiskSelection = ({ availableDisks, selectedDisks, onChange }) => {
</Box>
<Stack gap={theme.spacing(6)}>
{(!availableDisks || availableDisks.length === 0) ? (
{!availableDisks || availableDisks.length === 0 ? (
<Typography
variant="body2"
sx={{ fontStyle: 'italic', opacity: 0.8 }}
sx={{ fontStyle: "italic", opacity: 0.8 }}
>
{t("v1.infrastructure.disk_selection_info")}
</Typography>
@@ -66,7 +69,7 @@ const DiskSelection = ({ availableDisks, selectedDisks, onChange }) => {
/>
</Box>
</Stack>
)
);
})
)}
</Stack>
@@ -161,8 +161,6 @@ const CreateInfrastructureMonitor = () => {
isPausing ||
notificationsAreLoading;
return (
<Box className="create-infrastructure-monitor">
<Breadcrumbs list={CRUMBS} />
@@ -6,8 +6,18 @@ 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,
metricThree, valueThree, metricFour, valueFour }) => {
const Gauge = ({
value,
heading,
metricOne,
valueOne,
metricTwo,
valueTwo,
metricThree,
valueThree,
metricFour,
valueFour,
}) => {
const theme = useTheme();
const valueStyle = {
@@ -10,7 +10,8 @@ import { useTheme } from "@emotion/react";
import { useTranslation } from "react-i18next";
const Gauges = ({ isLoading = false, monitor }) => {
const { decimalToPercentage, formatBytes, formatDeviceName, formatMountpoint } = useHardwareUtils();
const { decimalToPercentage, formatBytes, formatDeviceName, formatMountpoint } =
useHardwareUtils();
const theme = useTheme();
const { t } = useTranslation();
@@ -121,10 +121,10 @@ const useHardwareUtils = () => {
};
const formatDeviceName = (device) => {
const deviceStr = String(device || '');
const deviceStr = String(device || "");
// Extract the last part of the path (after last '/')
const parts = deviceStr.split('/');
const parts = deviceStr.split("/");
const lastPart = parts[parts.length - 1];
// If there's more than one part, show with "..." prefix
@@ -132,17 +132,21 @@ const useHardwareUtils = () => {
// Always show tooltip with full device path
return (
<Tooltip title={deviceStr} arrow placement="top">
<Tooltip
title={deviceStr}
arrow
placement="top"
>
<Typography
component="span"
sx={{
cursor: 'default',
display: 'inline-block',
userSelect: 'none',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
maxWidth: '100%'
cursor: "default",
display: "inline-block",
userSelect: "none",
whiteSpace: "nowrap",
overflow: "hidden",
textOverflow: "ellipsis",
maxWidth: "100%",
}}
>
{displayText}
@@ -152,19 +156,23 @@ const useHardwareUtils = () => {
};
const formatMountpoint = (mountpoint) => {
const mountpointStr = String(mountpoint || '');
const mountpointStr = String(mountpoint || "");
if (!mountpointStr) {
return (
<Tooltip title="No mountpoint available" arrow placement="top">
<Tooltip
title="No mountpoint available"
arrow
placement="top"
>
<Typography
component="span"
sx={{
cursor: 'default',
display: 'inline-block',
userSelect: 'none',
color: 'text.secondary',
fontStyle: 'italic'
cursor: "default",
display: "inline-block",
userSelect: "none",
color: "text.secondary",
fontStyle: "italic",
}}
>
N/A
@@ -174,7 +182,7 @@ const useHardwareUtils = () => {
}
// Extract the last part of the path (after last '/')
const parts = mountpointStr.split('/');
const parts = mountpointStr.split("/");
const lastPart = parts[parts.length - 1];
// If there's more than one part, show with "..." prefix
@@ -182,24 +190,28 @@ const useHardwareUtils = () => {
// Always show tooltip with full mountpoint path
return (
<Tooltip title={mountpointStr} arrow placement="top">
<Tooltip
title={mountpointStr}
arrow
placement="top"
>
<Typography
component="span"
sx={{
cursor: 'default',
display: 'inline-block',
userSelect: 'none',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
maxWidth: '100%'
cursor: "default",
display: "inline-block",
userSelect: "none",
whiteSpace: "nowrap",
overflow: "hidden",
textOverflow: "ellipsis",
maxWidth: "100%",
}}
>
{displayText}
</Typography>
</Tooltip>
);
}
};
/**
* Converts a decimal value to a percentage
+1
View File
@@ -1148,6 +1148,7 @@
"disk_selection_info": "No disk detected for the moment.",
"disk_selection_description": "Select the specific disks you want to monitor."
}
},
"incidentsPage": {
"title": "Incidents",
"description": "Manage incidents for your monitors. You can resolve incidents here.",