Merge pull request #2663 from bluewave-labs/feat/fe/infrastructure-disk-ui-overflow
Fix: Infrastructure disks overflow
This commit is contained in:
2 files changed
+11
-4
No files matched your search
@@ -2,18 +2,19 @@
|
|||||||
import { Stack } from "@mui/material";
|
import { Stack } from "@mui/material";
|
||||||
import Gauge from "./Gauge";
|
import Gauge from "./Gauge";
|
||||||
import SkeletonLayout from "./skeleton";
|
import SkeletonLayout from "./skeleton";
|
||||||
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import { useHardwareUtils } from "../../Hooks/useHardwareUtils";
|
import { useHardwareUtils } from "../../Hooks/useHardwareUtils";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
const Gauges = ({ shouldRender, monitor }) => {
|
const Gauges = ({ isLoading = false, monitor }) => {
|
||||||
const { decimalToPercentage, formatBytes } = useHardwareUtils();
|
const { decimalToPercentage, formatBytes } = useHardwareUtils();
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
if (!shouldRender) {
|
if (isLoading) {
|
||||||
return <SkeletonLayout />;
|
return <SkeletonLayout />;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,6 +61,7 @@ const Gauges = ({ shouldRender, monitor }) => {
|
|||||||
return (
|
return (
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
|
flexWrap="wrap"
|
||||||
gap={theme.spacing(8)}
|
gap={theme.spacing(8)}
|
||||||
>
|
>
|
||||||
{gauges.map((gauge) => {
|
{gauges.map((gauge) => {
|
||||||
@@ -79,4 +81,9 @@ const Gauges = ({ shouldRender, monitor }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Gauges.propTypes = {
|
||||||
|
isLoading: PropTypes.bool,
|
||||||
|
monitor: PropTypes.object,
|
||||||
|
};
|
||||||
|
|
||||||
export default Gauges;
|
export default Gauges;
|
||||||
@@ -92,11 +92,11 @@ const InfrastructureDetails = () => {
|
|||||||
monitor={monitor}
|
monitor={monitor}
|
||||||
/>
|
/>
|
||||||
<GaugeBoxes
|
<GaugeBoxes
|
||||||
shouldRender={!isLoading}
|
isLoading={isLoading}
|
||||||
monitor={monitor}
|
monitor={monitor}
|
||||||
/>
|
/>
|
||||||
<MonitorTimeFrameHeader
|
<MonitorTimeFrameHeader
|
||||||
shouldRender={!isLoading}
|
isLoading={isLoading}
|
||||||
dateRange={dateRange}
|
dateRange={dateRange}
|
||||||
setDateRange={setDateRange}
|
setDateRange={setDateRange}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in new issue
Block a user