Fix: Infrastructure disks overflow

This commit is contained in:
Br0wnHammer committed 2025-07-23 15:33:09 +05:30
1 parent 9c9eaca990
commit 8fcaf721ad
4 files changed
+13 -12

No files matched your search

@@ -6,7 +6,6 @@ import { useSelector } from "react-redux";
import { useDispatch } from "react-redux"; import { useDispatch } from "react-redux";
import { setLanguage } from "../Features/UI/uiSlice"; import { setLanguage } from "../Features/UI/uiSlice";
const langMap = { const langMap = {
cs: "cz", cs: "cz",
ja: "jp", ja: "jp",
@@ -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}
/> />
+2 -7
View File
@@ -164,11 +164,7 @@ const createMonitorBodyValidation = joi.object({
.custom((value, helpers) => { .custom((value, helpers) => {
// 1. Standard URLs: must have protocol and pass canParse() // 1. Standard URLs: must have protocol and pass canParse()
if (/^(https?:\/\/)/.test(value)) { if (/^(https?:\/\/)/.test(value)) {
if ( if (typeof URL !== "undefined" && typeof URL.canParse === "function" && URL.canParse(value)) {
typeof URL !== "undefined" &&
typeof URL.canParse === "function" &&
URL.canParse(value)
) {
return value; return value;
} }
// else, it's a malformed URL with protocol // else, it's a malformed URL with protocol
@@ -197,8 +193,7 @@ const createMonitorBodyValidation = joi.object({
.messages({ .messages({
"string.empty": "This field is required.", "string.empty": "This field is required.",
"string.uri": "The URL you provided is not valid.", "string.uri": "The URL you provided is not valid.",
"string.invalidUrl": "string.invalidUrl": "Please enter a valid URL, hostname, or container name (with optional port).",
"Please enter a valid URL, hostname, or container name (with optional port).",
}), }),
ignoreTlsErrors: joi.boolean().default(false), ignoreTlsErrors: joi.boolean().default(false),
port: joi.number(), port: joi.number(),