Merge pull request #1849 from Br0wnHammer/fix/fe/infrastructure-page
Fix: Infrastructure Details Page Design
This commit is contained in:
6 files changed
+43
-15
No files matched your search
@@ -62,6 +62,7 @@ const CustomGauge = ({ progress = 0, radius = 70, strokeWidth = 15, threshold =
|
|||||||
className="radial-chart"
|
className="radial-chart"
|
||||||
width={radius}
|
width={radius}
|
||||||
height={radius}
|
height={radius}
|
||||||
|
sx={{ backgroundColor: theme.palette.primary.main, borderRadius: "50%" }}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
viewBox={`0 0 ${totalSize} ${totalSize}`}
|
viewBox={`0 0 ${totalSize} ${totalSize}`}
|
||||||
@@ -70,7 +71,7 @@ const CustomGauge = ({ progress = 0, radius = 70, strokeWidth = 15, threshold =
|
|||||||
>
|
>
|
||||||
<circle
|
<circle
|
||||||
className="radial-chart-base"
|
className="radial-chart-base"
|
||||||
stroke={theme.palette.primary.lowContrast} // CAIO_REVIEW
|
stroke={theme.palette.secondary.light} // CAIO_REVIEW
|
||||||
strokeWidth={strokeWidth}
|
strokeWidth={strokeWidth}
|
||||||
fill="none"
|
fill="none"
|
||||||
cx={totalSize / 2} // Center the circle
|
cx={totalSize / 2} // Center the circle
|
||||||
@@ -98,8 +99,8 @@ const CustomGauge = ({ progress = 0, radius = 70, strokeWidth = 15, threshold =
|
|||||||
top: "50%",
|
top: "50%",
|
||||||
left: "50%",
|
left: "50%",
|
||||||
transform: "translate(-50%, -50%)",
|
transform: "translate(-50%, -50%)",
|
||||||
...theme.typography.body2,
|
...theme.typography.h2,
|
||||||
fill: theme.typography.body2.color,
|
fill: theme.typography.h2.color,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{`${progressWithinRange.toFixed(1)}%`}
|
{`${progressWithinRange.toFixed(1)}%`}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ const StatBox = ({
|
|||||||
borderColor: theme.palette[themeColor].lowContrast,
|
borderColor: theme.palette[themeColor].lowContrast,
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
background: `linear-gradient(340deg, ${theme.palette.tertiary.main} 20%, ${theme.palette.primary.main} 45%)`,
|
background: `linear-gradient(340deg, ${theme.palette.tertiary.main} 10%, ${theme.palette.primary.main} 45%)`,
|
||||||
borderColor: theme.palette.primary.lowContrast,
|
borderColor: theme.palette.primary.lowContrast,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ const StatBox = ({
|
|||||||
color: theme.palette.primary.contrastTextSecondary,
|
color: theme.palette.primary.contrastTextSecondary,
|
||||||
};
|
};
|
||||||
|
|
||||||
const spanFixedStyles = { marginLeft: theme.spacing(2), fontSize: 15 };
|
const spanFixedStyles = { marginLeft: theme.spacing(2), fontSize: 15, fontWeight: 600};
|
||||||
const detailTextStyles = gradient
|
const detailTextStyles = gradient
|
||||||
? {
|
? {
|
||||||
color: theme.palette[themeColor].contrastText,
|
color: theme.palette[themeColor].contrastText,
|
||||||
@@ -120,7 +120,7 @@ const StatBox = ({
|
|||||||
)}
|
)}
|
||||||
<Stack>
|
<Stack>
|
||||||
<Typography component="h2">{heading}</Typography>
|
<Typography component="h2">{heading}</Typography>
|
||||||
<Typography>{subHeading}</Typography>
|
<Typography sx={{fontWeight: 500}}>{subHeading}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,6 +9,16 @@ import PropTypes from "prop-types";
|
|||||||
const Gauge = ({ value, heading, metricOne, valueOne, metricTwo, valueTwo }) => {
|
const Gauge = ({ value, heading, metricOne, valueOne, metricTwo, valueTwo }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
|
const valueStyle = {
|
||||||
|
borderRadius: theme.spacing(2),
|
||||||
|
backgroundColor: theme.palette.tertiary.main,
|
||||||
|
width: "40%",
|
||||||
|
mb: theme.spacing(2),
|
||||||
|
mt: theme.spacing(2),
|
||||||
|
pr: theme.spacing(2),
|
||||||
|
textAlign: 'right'
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BaseContainer>
|
<BaseContainer>
|
||||||
<Stack
|
<Stack
|
||||||
@@ -16,12 +26,21 @@ const Gauge = ({ value, heading, metricOne, valueOne, metricTwo, valueTwo }) =>
|
|||||||
gap={theme.spacing(2)}
|
gap={theme.spacing(2)}
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
>
|
>
|
||||||
<CustomGauge
|
<Box
|
||||||
progress={value}
|
sx={{
|
||||||
radius={100}
|
display: "flex",
|
||||||
color={theme.palette.primary.main}
|
flexDirection: "column",
|
||||||
/>
|
alignItems: "center",
|
||||||
<Typography component="h2">{heading}</Typography>
|
width: "100%",
|
||||||
|
backgroundColor: theme.palette.gradient.color1
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<CustomGauge
|
||||||
|
progress={value}
|
||||||
|
radius={100}
|
||||||
|
/>
|
||||||
|
<Typography component="h2" sx={{ fontWeight: 600 }}>{heading}</Typography>
|
||||||
|
</Box>
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
@@ -31,18 +50,20 @@ const Gauge = ({ value, heading, metricOne, valueOne, metricTwo, valueTwo }) =>
|
|||||||
<Stack
|
<Stack
|
||||||
justifyContent={"space-between"}
|
justifyContent={"space-between"}
|
||||||
direction="row"
|
direction="row"
|
||||||
|
alignItems="center"
|
||||||
gap={theme.spacing(2)}
|
gap={theme.spacing(2)}
|
||||||
>
|
>
|
||||||
<Typography>{metricOne}</Typography>
|
<Typography>{metricOne}</Typography>
|
||||||
<Typography>{valueOne}</Typography>
|
<Typography sx={valueStyle}>{valueOne}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack
|
<Stack
|
||||||
justifyContent={"space-between"}
|
justifyContent={"space-between"}
|
||||||
direction="row"
|
direction="row"
|
||||||
|
alignItems="center"
|
||||||
gap={theme.spacing(2)}
|
gap={theme.spacing(2)}
|
||||||
>
|
>
|
||||||
<Typography>{metricTwo}</Typography>
|
<Typography>{metricTwo}</Typography>
|
||||||
<Typography>{valueTwo}</Typography>
|
<Typography sx={valueStyle}>{valueTwo}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ const useHardwareUtils = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{Number(MB.toFixed(0))}
|
{Number(MB.toFixed(0))}
|
||||||
|
{space ? " " : ""}
|
||||||
<Typography component="span">MB</Typography>
|
<Typography component="span">MB</Typography>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ const InfrastructureDetails = () => {
|
|||||||
monitor={monitor}
|
monitor={monitor}
|
||||||
/>
|
/>
|
||||||
<GenericFallback>
|
<GenericFallback>
|
||||||
<Typography>No check history for htis monitor yet.</Typography>
|
<Typography>No check history for this monitor yet.</Typography>
|
||||||
</GenericFallback>
|
</GenericFallback>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ const newColors = {
|
|||||||
blueGray800: "#1C2130",
|
blueGray800: "#1C2130",
|
||||||
blueGray900: "#515151",
|
blueGray900: "#515151",
|
||||||
blueBlueWave: "#1570EF",
|
blueBlueWave: "#1570EF",
|
||||||
|
lightBlueWave: "#CDE2FF",
|
||||||
/* I changed green 100 and green 700. Need to change red and warning as well, and refactor the object following the structure */
|
/* I changed green 100 and green 700. Need to change red and warning as well, and refactor the object following the structure */
|
||||||
green100: "#67cd78",
|
green100: "#67cd78",
|
||||||
green200: "#4B9B77",
|
green200: "#4B9B77",
|
||||||
@@ -172,6 +173,10 @@ const newSemanticColors = {
|
|||||||
light: newColors.gray200,
|
light: newColors.gray200,
|
||||||
dark: "#313131" /* newColors.blueGray600 */,
|
dark: "#313131" /* newColors.blueGray600 */,
|
||||||
},
|
},
|
||||||
|
light: {
|
||||||
|
light: newColors.lightBlueWave,
|
||||||
|
dark: newColors.lightBlueWave,
|
||||||
|
},
|
||||||
contrastText: {
|
contrastText: {
|
||||||
light: newColors.blueGray600,
|
light: newColors.blueGray600,
|
||||||
dark: newColors.gray200,
|
dark: newColors.gray200,
|
||||||
|
|||||||
Reference in new issue
Block a user