Merge branch 'develop' into feat/settings-remove-monitors-modal
This commit is contained in:
commit
f3b4b908fd
33 files changed
+329
-258
No files matched your search
@@ -38,9 +38,9 @@ export const PageSpeedKeyPriorityFallback = () => {
|
|||||||
<Link
|
<Link
|
||||||
component={RouterLink}
|
component={RouterLink}
|
||||||
to="/settings"
|
to="/settings"
|
||||||
|
color={theme.palette.primary.main}
|
||||||
|
fontWeight={600}
|
||||||
sx={{
|
sx={{
|
||||||
color: theme.palette.primary.main,
|
|
||||||
fontWeight: 600,
|
|
||||||
textDecoration: "underline",
|
textDecoration: "underline",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export const MonitorStatus = ({ monitor }: { monitor: Monitor }) => {
|
|||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack>
|
||||||
<Typography
|
<Typography
|
||||||
fontSize={typographyLevels.xl}
|
fontSize={typographyLevels.xxl}
|
||||||
fontWeight={500}
|
fontWeight={500}
|
||||||
overflow={"hidden"}
|
overflow={"hidden"}
|
||||||
textOverflow={"ellipsis"}
|
textOverflow={"ellipsis"}
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ import Box from "@mui/material/Box";
|
|||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import { useTheme, alpha } from "@mui/material/styles";
|
import { useTheme, alpha } from "@mui/material/styles";
|
||||||
import { LAYOUT } from "@/Utils/Theme/constants";
|
import { LAYOUT } from "@/Utils/Theme/constants";
|
||||||
|
import { typographyLevels } from "@/Utils/Theme/Palette";
|
||||||
|
|
||||||
type Severity = "info" | "warning" | "error";
|
export const Severities = ["info", "warning", "error"] as const;
|
||||||
|
export type Severity = (typeof Severities)[number];
|
||||||
|
|
||||||
const SEVERITY_GLYPH: Record<Severity, string> = {
|
const SEVERITY_GLYPH: Record<Severity, string> = {
|
||||||
info: "ⓘ",
|
info: "ⓘ",
|
||||||
@@ -25,29 +27,26 @@ export const NoticeBanner = ({ severity = "info", children }: NoticeBannerProps)
|
|||||||
direction="row"
|
direction="row"
|
||||||
alignItems="flex-start"
|
alignItems="flex-start"
|
||||||
gap={theme.spacing(LAYOUT.SM)}
|
gap={theme.spacing(LAYOUT.SM)}
|
||||||
sx={{
|
width={"100%"}
|
||||||
width: "100%",
|
p={theme.spacing(LAYOUT.MD)}
|
||||||
p: theme.spacing(LAYOUT.MD),
|
borderRadius={theme.shape.borderRadius}
|
||||||
borderRadius: 1,
|
border={`1px solid ${alpha(tone, 0.45)}`}
|
||||||
border: `1px solid ${alpha(tone, 0.45)}`,
|
bgcolor={alpha(tone, 0.08)}
|
||||||
backgroundColor: alpha(tone, 0.08),
|
textAlign={"left"}
|
||||||
textAlign: "left",
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Box
|
<Box
|
||||||
component="span"
|
component="span"
|
||||||
sx={{
|
color={tone}
|
||||||
color: tone,
|
fontSize={typographyLevels.xl}
|
||||||
fontSize: 18,
|
lineHeight={1}
|
||||||
lineHeight: 1,
|
mt={LAYOUT.XXS}
|
||||||
mt: "2px",
|
|
||||||
}}
|
|
||||||
aria-hidden
|
aria-hidden
|
||||||
>
|
>
|
||||||
{SEVERITY_GLYPH[severity]}
|
{SEVERITY_GLYPH[severity]}
|
||||||
</Box>
|
</Box>
|
||||||
<Typography
|
<Typography
|
||||||
sx={{ color: theme.palette.text.primary, lineHeight: 1.55, fontSize: 13 }}
|
color={theme.palette.text.primary}
|
||||||
|
lineHeight={1.55}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
@@ -1,19 +1,43 @@
|
|||||||
import Button from "@mui/material/Button";
|
import Button from "@mui/material/Button";
|
||||||
import type { ButtonProps } from "@mui/material/Button";
|
import type { ButtonProps } from "@mui/material/Button";
|
||||||
import { useTheme } from "@mui/material/styles";
|
import { useTheme, darken } from "@mui/material/styles";
|
||||||
|
import { HOVER } from "@/Utils/Theme/constants";
|
||||||
|
|
||||||
|
const PALETTE_COLORS = [
|
||||||
|
"primary",
|
||||||
|
"secondary",
|
||||||
|
"error",
|
||||||
|
"warning",
|
||||||
|
"info",
|
||||||
|
"success",
|
||||||
|
] as const;
|
||||||
|
type PaletteColor = (typeof PALETTE_COLORS)[number];
|
||||||
|
|
||||||
export const ButtonInput = ({ sx, ...props }: ButtonProps) => {
|
export const ButtonInput = ({ sx, ...props }: ButtonProps) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const outlinedSx =
|
|
||||||
|
const hoverOverrides: Record<string, unknown> = { boxShadow: "none" };
|
||||||
|
|
||||||
|
if (props.variant === "outlined") {
|
||||||
|
hoverOverrides.borderColor = theme.palette.text.secondary;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (props.variant === "contained") {
|
||||||
|
const colorKey = (props.color ?? "primary") as PaletteColor;
|
||||||
|
const palette = theme.palette[colorKey];
|
||||||
|
if (palette && typeof palette === "object" && "main" in palette) {
|
||||||
|
hoverOverrides.backgroundColor = darken(palette.main, HOVER.DARKEN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const variantSx =
|
||||||
props.variant === "outlined"
|
props.variant === "outlined"
|
||||||
? {
|
? {
|
||||||
color: theme.palette.text.primary,
|
color: theme.palette.text.primary,
|
||||||
borderColor: theme.palette.divider,
|
borderColor: theme.palette.divider,
|
||||||
"&:hover": {
|
|
||||||
borderColor: theme.palette.text.secondary,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
: {};
|
: {};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
{...props}
|
{...props}
|
||||||
@@ -26,10 +50,8 @@ export const ButtonInput = ({ sx, ...props }: ButtonProps) => {
|
|||||||
textOverflow: "ellipsis",
|
textOverflow: "ellipsis",
|
||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
boxShadow: "none",
|
boxShadow: "none",
|
||||||
"&:hover": {
|
"&:hover": hoverOverrides,
|
||||||
boxShadow: "none",
|
...variantSx,
|
||||||
},
|
|
||||||
...outlinedSx,
|
|
||||||
...sx,
|
...sx,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -53,24 +53,24 @@ export const DialogInput = ({
|
|||||||
>
|
>
|
||||||
{title && (
|
{title && (
|
||||||
<DialogTitle
|
<DialogTitle
|
||||||
sx={{
|
pb={theme.spacing(LAYOUT.XS)}
|
||||||
pb: theme.spacing(LAYOUT.XS),
|
bgcolor={theme.palette.action.hover}
|
||||||
backgroundColor: theme.palette.action.hover,
|
borderBottom={`1px solid ${theme.palette.divider}`}
|
||||||
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
variant="h2"
|
variant="h2"
|
||||||
sx={{ fontWeight: 600, display: "block" }}
|
fontWeight={600}
|
||||||
|
display={"block"}
|
||||||
>
|
>
|
||||||
{title}
|
{title}
|
||||||
</Typography>
|
</Typography>
|
||||||
{content && (
|
{content && (
|
||||||
<Typography
|
<Typography
|
||||||
variant="body1"
|
variant="body1"
|
||||||
color="text.secondary"
|
color={theme.palette.text.secondary}
|
||||||
sx={{ mt: theme.spacing(LAYOUT.XS), display: "block" }}
|
mt={theme.spacing(LAYOUT.XS)}
|
||||||
|
display={"block"}
|
||||||
>
|
>
|
||||||
{content}
|
{content}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -79,7 +79,7 @@ export const DialogInput = ({
|
|||||||
)}
|
)}
|
||||||
{children && (
|
{children && (
|
||||||
<DialogContent sx={{ pt: theme.spacing(LAYOUT.MD) }}>
|
<DialogContent sx={{ pt: theme.spacing(LAYOUT.MD) }}>
|
||||||
<Box sx={{ pt: theme.spacing(LAYOUT.XS) }}>{children}</Box>
|
<Box pt={theme.spacing(LAYOUT.XS)}>{children}</Box>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
)}
|
)}
|
||||||
<DialogActions
|
<DialogActions
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ export const FieldLabel = ({ children, required = false, htmlFor }: FieldLabelPr
|
|||||||
return (
|
return (
|
||||||
<Typography
|
<Typography
|
||||||
component="label"
|
component="label"
|
||||||
|
variant="body1"
|
||||||
htmlFor={htmlFor}
|
htmlFor={htmlFor}
|
||||||
sx={{
|
sx={{
|
||||||
fontSize: "14px",
|
|
||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
color: theme.palette.text.secondary,
|
color: theme.palette.text.secondary,
|
||||||
marginBottom: theme.spacing(2),
|
marginBottom: theme.spacing(2),
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { typographyLevels } from "@/Utils/Theme/Palette";
|
|||||||
import { useTheme } from "@mui/material/styles";
|
import { useTheme } from "@mui/material/styles";
|
||||||
import Stack from "@mui/material/Stack";
|
import Stack from "@mui/material/Stack";
|
||||||
import { FieldLabel } from "./FieldLabel";
|
import { FieldLabel } from "./FieldLabel";
|
||||||
|
import { LAYOUT } from "@/Utils/Theme/constants";
|
||||||
|
|
||||||
interface TextInputProps extends Omit<TextFieldProps, "label"> {
|
interface TextInputProps extends Omit<TextFieldProps, "label"> {
|
||||||
fieldLabel?: string;
|
fieldLabel?: string;
|
||||||
@@ -12,47 +13,53 @@ interface TextInputProps extends Omit<TextFieldProps, "label"> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const TextInput = forwardRef<HTMLInputElement, TextInputProps>(function TextInput(
|
export const TextInput = forwardRef<HTMLInputElement, TextInputProps>(function TextInput(
|
||||||
{ fieldLabel, required, ...props },
|
{ fieldLabel, required, sx, ...props },
|
||||||
ref
|
ref
|
||||||
) {
|
) {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
|
const innerSx = {
|
||||||
|
width: "100%",
|
||||||
|
"& .MuiOutlinedInput-root": {
|
||||||
|
borderRadius: theme.shape.borderRadius,
|
||||||
|
height: 34,
|
||||||
|
fontSize: typographyLevels.base,
|
||||||
|
overflow: "hidden",
|
||||||
|
},
|
||||||
|
"& .MuiOutlinedInput-notchedOutline": {
|
||||||
|
borderColor: theme.palette.divider,
|
||||||
|
},
|
||||||
|
"&:hover .MuiOutlinedInput-notchedOutline": {
|
||||||
|
borderColor: theme.palette.divider,
|
||||||
|
},
|
||||||
|
"& .MuiFormHelperText-root": {
|
||||||
|
marginLeft: 0,
|
||||||
|
marginRight: 0,
|
||||||
|
marginTop: theme.spacing(1),
|
||||||
|
},
|
||||||
|
"& input:-webkit-autofill, & input:-webkit-autofill:hover, & input:-webkit-autofill:focus, & input:-webkit-autofill:active":
|
||||||
|
{
|
||||||
|
WebkitBoxShadow: `0 0 0 100px ${theme.palette.background.default} inset !important`,
|
||||||
|
WebkitTextFillColor: `${theme.palette.text.primary} !important`,
|
||||||
|
caretColor: theme.palette.text.primary,
|
||||||
|
transition: "background-color 5000s ease-in-out 0s",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
const input = (
|
const input = (
|
||||||
<TextField
|
<TextField
|
||||||
{...props}
|
{...props}
|
||||||
inputRef={ref}
|
inputRef={ref}
|
||||||
sx={{
|
sx={fieldLabel ? innerSx : { ...innerSx, ...sx }}
|
||||||
"& .MuiOutlinedInput-root": {
|
|
||||||
borderRadius: theme.shape.borderRadius,
|
|
||||||
height: 34,
|
|
||||||
fontSize: typographyLevels.base,
|
|
||||||
overflow: "hidden",
|
|
||||||
},
|
|
||||||
"& .MuiOutlinedInput-notchedOutline": {
|
|
||||||
borderColor: theme.palette.divider,
|
|
||||||
},
|
|
||||||
"&:hover .MuiOutlinedInput-notchedOutline": {
|
|
||||||
borderColor: theme.palette.divider,
|
|
||||||
},
|
|
||||||
"& .MuiFormHelperText-root": {
|
|
||||||
marginLeft: 0,
|
|
||||||
marginRight: 0,
|
|
||||||
marginTop: theme.spacing(1),
|
|
||||||
},
|
|
||||||
"& input:-webkit-autofill, & input:-webkit-autofill:hover, & input:-webkit-autofill:focus, & input:-webkit-autofill:active":
|
|
||||||
{
|
|
||||||
WebkitBoxShadow: `0 0 0 100px ${theme.palette.background.default} inset !important`,
|
|
||||||
WebkitTextFillColor: `${theme.palette.text.primary} !important`,
|
|
||||||
caretColor: theme.palette.text.primary,
|
|
||||||
transition: "background-color 5000s ease-in-out 0s",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
if (fieldLabel) {
|
if (fieldLabel) {
|
||||||
return (
|
return (
|
||||||
<Stack spacing={theme.spacing(2)}>
|
<Stack
|
||||||
|
spacing={theme.spacing(LAYOUT.XXS)}
|
||||||
|
sx={sx}
|
||||||
|
>
|
||||||
<FieldLabel required={required}>{fieldLabel}</FieldLabel>
|
<FieldLabel required={required}>{fieldLabel}</FieldLabel>
|
||||||
{input}
|
{input}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { useAddTeamMemberForm } from "@/Hooks/useAddTeamMemberForm";
|
|||||||
import type { AddTeamMemberFormData } from "@/Validation/addTeamMember";
|
import type { AddTeamMemberFormData } from "@/Validation/addTeamMember";
|
||||||
import type { UserRole, User } from "@/Types/User";
|
import type { UserRole, User } from "@/Types/User";
|
||||||
import { usePost } from "@/Hooks/UseApi";
|
import { usePost } from "@/Hooks/UseApi";
|
||||||
|
import { LAYOUT } from "@/Utils/Theme/constants";
|
||||||
|
|
||||||
interface AddTeamMemberDialogProps {
|
interface AddTeamMemberDialogProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
@@ -82,38 +83,40 @@ export const AddTeamMemberDialog = ({
|
|||||||
maxWidth="sm"
|
maxWidth="sm"
|
||||||
fullWidth
|
fullWidth
|
||||||
>
|
>
|
||||||
<Stack
|
<Stack gap={theme.spacing(LAYOUT.XS)}>
|
||||||
gap={theme.spacing(4)}
|
<Stack
|
||||||
mt={theme.spacing(4)}
|
direction="row"
|
||||||
>
|
gap={theme.spacing(LAYOUT.XS)}
|
||||||
<Controller
|
>
|
||||||
name="firstName"
|
<Controller
|
||||||
control={control}
|
name="firstName"
|
||||||
render={({ field, fieldState }) => (
|
control={control}
|
||||||
<TextField
|
render={({ field, fieldState }) => (
|
||||||
{...field}
|
<TextField
|
||||||
fieldLabel={t("common.form.name.option.firstName.label")}
|
{...field}
|
||||||
placeholder={t("common.form.name.option.firstName.placeholder")}
|
fieldLabel={t("common.form.name.option.firstName.label")}
|
||||||
error={!!fieldState.error}
|
placeholder={t("common.form.name.option.firstName.placeholder")}
|
||||||
helperText={fieldState.error?.message ?? ""}
|
error={!!fieldState.error}
|
||||||
fullWidth
|
helperText={fieldState.error?.message ?? ""}
|
||||||
/>
|
sx={{ flex: 1 }}
|
||||||
)}
|
/>
|
||||||
/>
|
)}
|
||||||
<Controller
|
/>
|
||||||
name="lastName"
|
<Controller
|
||||||
control={control}
|
name="lastName"
|
||||||
render={({ field, fieldState }) => (
|
control={control}
|
||||||
<TextField
|
render={({ field, fieldState }) => (
|
||||||
{...field}
|
<TextField
|
||||||
fieldLabel={t("common.form.name.option.lastName.label")}
|
{...field}
|
||||||
placeholder={t("common.form.name.option.lastName.placeholder")}
|
fieldLabel={t("common.form.name.option.lastName.label")}
|
||||||
error={!!fieldState.error}
|
placeholder={t("common.form.name.option.lastName.placeholder")}
|
||||||
helperText={fieldState.error?.message ?? ""}
|
error={!!fieldState.error}
|
||||||
fullWidth
|
helperText={fieldState.error?.message ?? ""}
|
||||||
/>
|
sx={{ flex: 1 }}
|
||||||
)}
|
/>
|
||||||
/>
|
)}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
<Controller
|
<Controller
|
||||||
name="email"
|
name="email"
|
||||||
control={control}
|
control={control}
|
||||||
@@ -151,36 +154,41 @@ export const AddTeamMemberDialog = ({
|
|||||||
</Select>
|
</Select>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<Controller
|
<Stack
|
||||||
name="password"
|
direction="row"
|
||||||
control={control}
|
gap={theme.spacing(LAYOUT.XS)}
|
||||||
render={({ field, fieldState }) => (
|
>
|
||||||
<TextField
|
<Controller
|
||||||
{...field}
|
name="password"
|
||||||
fieldLabel={t("pages.auth.common.form.option.password.label")}
|
control={control}
|
||||||
placeholder={t("pages.auth.common.form.option.password.placeholder")}
|
render={({ field, fieldState }) => (
|
||||||
type="password"
|
<TextField
|
||||||
error={!!fieldState.error}
|
{...field}
|
||||||
helperText={fieldState.error?.message ?? ""}
|
fieldLabel={t("pages.auth.common.form.option.password.label")}
|
||||||
fullWidth
|
placeholder={t("pages.auth.common.form.option.password.placeholder")}
|
||||||
/>
|
type="password"
|
||||||
)}
|
error={!!fieldState.error}
|
||||||
/>
|
helperText={fieldState.error?.message ?? ""}
|
||||||
<Controller
|
sx={{ flex: 1 }}
|
||||||
name="confirm"
|
/>
|
||||||
control={control}
|
)}
|
||||||
render={({ field, fieldState }) => (
|
/>
|
||||||
<TextField
|
<Controller
|
||||||
{...field}
|
name="confirm"
|
||||||
fieldLabel={t("pages.auth.common.form.option.confirmPassword.label")}
|
control={control}
|
||||||
placeholder={t("pages.auth.common.form.option.password.placeholder")}
|
render={({ field, fieldState }) => (
|
||||||
type="password"
|
<TextField
|
||||||
error={!!fieldState.error}
|
{...field}
|
||||||
helperText={fieldState.error?.message ?? ""}
|
fieldLabel={t("pages.auth.common.form.option.confirmPassword.label")}
|
||||||
fullWidth
|
placeholder={t("pages.auth.common.form.option.password.placeholder")}
|
||||||
/>
|
type="password"
|
||||||
)}
|
error={!!fieldState.error}
|
||||||
/>
|
helperText={fieldState.error?.message ?? ""}
|
||||||
|
sx={{ flex: 1 }}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import type { UserRole } from "@/Types/User";
|
|||||||
import { useInviteForm } from "@/Hooks/useInviteForm";
|
import { useInviteForm } from "@/Hooks/useInviteForm";
|
||||||
import type { InviteFormData } from "@/Validation/invite";
|
import type { InviteFormData } from "@/Validation/invite";
|
||||||
import { usePost } from "@/Hooks/UseApi";
|
import { usePost } from "@/Hooks/UseApi";
|
||||||
|
import { LAYOUT } from "@/Utils/Theme/constants";
|
||||||
|
|
||||||
const CLIENT_HOST = import.meta.env.VITE_APP_CLIENT_HOST;
|
const CLIENT_HOST = import.meta.env.VITE_APP_CLIENT_HOST;
|
||||||
|
|
||||||
@@ -95,10 +96,7 @@ export const InviteTeamMemberDialog = ({
|
|||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Stack
|
<Stack gap={theme.spacing(LAYOUT.XS)}>
|
||||||
gap={theme.spacing(4)}
|
|
||||||
mt={theme.spacing(4)}
|
|
||||||
>
|
|
||||||
<Controller
|
<Controller
|
||||||
name="email"
|
name="email"
|
||||||
control={control}
|
control={control}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { useSelector } from "react-redux";
|
|||||||
import type { RootState } from "@/Types/state";
|
import type { RootState } from "@/Types/state";
|
||||||
import { formatDateWithTz } from "@/Utils/TimeUtils";
|
import { formatDateWithTz } from "@/Utils/TimeUtils";
|
||||||
import { getIncidentsDuration } from "@/Pages/Incidents/utils";
|
import { getIncidentsDuration } from "@/Pages/Incidents/utils";
|
||||||
|
import { theme } from "@/Utils/Theme/Theme";
|
||||||
|
|
||||||
interface CardDetailsProps {
|
interface CardDetailsProps {
|
||||||
incident: Incident | null;
|
incident: Incident | null;
|
||||||
@@ -20,6 +21,24 @@ interface CardDetailsProps {
|
|||||||
sx?: object;
|
sx?: object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const SectionHeading = ({ children }: { children: React.ReactNode }) => {
|
||||||
|
const theme = useTheme();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Typography
|
||||||
|
component="h2"
|
||||||
|
variant="eyebrow"
|
||||||
|
color={theme.palette.text.secondary}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</Typography>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const Cell = ({ children }: { children: React.ReactNode }) => (
|
||||||
|
<Typography variant="body1">{children}</Typography>
|
||||||
|
);
|
||||||
|
|
||||||
export const CardDetails = ({ incident, monitor, sx }: CardDetailsProps) => {
|
export const CardDetails = ({ incident, monitor, sx }: CardDetailsProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
@@ -33,22 +52,18 @@ export const CardDetails = ({ incident, monitor, sx }: CardDetailsProps) => {
|
|||||||
gap={theme.spacing(LAYOUT.MD)}
|
gap={theme.spacing(LAYOUT.MD)}
|
||||||
sx={sx}
|
sx={sx}
|
||||||
>
|
>
|
||||||
<Typography textTransform={"uppercase"}>
|
<SectionHeading>{t("pages.incidents.dialog.details.title")}</SectionHeading>
|
||||||
{t("pages.incidents.dialog.details.title")}
|
|
||||||
</Typography>
|
|
||||||
<BaseBox padding={LAYOUT.MD}>
|
<BaseBox padding={LAYOUT.MD}>
|
||||||
<Stack gap={theme.spacing(LAYOUT.MD)}>
|
<Stack gap={theme.spacing(LAYOUT.MD)}>
|
||||||
<Typography textTransform={"uppercase"}>
|
<SectionHeading>{t("pages.incidents.dialog.details.overview")}</SectionHeading>
|
||||||
{t("pages.incidents.dialog.details.overview")}
|
|
||||||
</Typography>
|
|
||||||
<Divider />
|
|
||||||
|
|
||||||
<Grid
|
<Grid
|
||||||
container
|
container
|
||||||
spacing={theme.spacing(LAYOUT.MD)}
|
spacing={theme.spacing(LAYOUT.MD)}
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
>
|
>
|
||||||
<Grid size={2}>{t("pages.incidents.dialog.details.status")}</Grid>
|
<Grid size={2}>
|
||||||
|
<Cell>{t("pages.incidents.dialog.details.status")}</Cell>
|
||||||
|
</Grid>
|
||||||
<Grid size={10}>
|
<Grid size={10}>
|
||||||
<ValueLabel
|
<ValueLabel
|
||||||
value={incident.status ? "negative" : "positive"}
|
value={incident.status ? "negative" : "positive"}
|
||||||
@@ -61,15 +76,17 @@ export const CardDetails = ({ incident, monitor, sx }: CardDetailsProps) => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
{monitor && (
|
{monitor && (
|
||||||
<>
|
<>
|
||||||
<Grid size={2}>{t("pages.incidents.dialog.details.monitor")}</Grid>
|
<Grid size={2}>
|
||||||
|
<Cell>{t("pages.incidents.dialog.details.monitor")}</Cell>
|
||||||
|
</Grid>
|
||||||
<Grid size={10}>
|
<Grid size={10}>
|
||||||
<Typography>{monitor.name ?? "N/A"}</Typography>
|
<Cell>{monitor.name ?? "N/A"}</Cell>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={2}>
|
<Grid size={2}>
|
||||||
<Typography>{t("pages.incidents.dialog.details.url")}</Typography>
|
<Cell>{t("pages.incidents.dialog.details.url")}</Cell>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={10}>
|
<Grid size={10}>
|
||||||
<Typography>{monitor.url ?? "N/A"}</Typography>
|
<Cell>{monitor.url ?? "N/A"}</Cell>
|
||||||
</Grid>
|
</Grid>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
@@ -78,51 +95,48 @@ export const CardDetails = ({ incident, monitor, sx }: CardDetailsProps) => {
|
|||||||
</BaseBox>
|
</BaseBox>
|
||||||
<BaseBox padding={LAYOUT.MD}>
|
<BaseBox padding={LAYOUT.MD}>
|
||||||
<Stack gap={theme.spacing(LAYOUT.MD)}>
|
<Stack gap={theme.spacing(LAYOUT.MD)}>
|
||||||
<Typography textTransform={"uppercase"}>
|
<SectionHeading>{t("pages.incidents.dialog.details.analysis")}</SectionHeading>
|
||||||
{t("pages.incidents.dialog.details.analysis")}
|
|
||||||
</Typography>
|
|
||||||
<Divider />
|
|
||||||
<Grid
|
<Grid
|
||||||
container
|
container
|
||||||
spacing={theme.spacing(LAYOUT.MD)}
|
spacing={theme.spacing(LAYOUT.MD)}
|
||||||
>
|
>
|
||||||
<Grid size={6}>
|
<Grid size={6}>
|
||||||
<Typography>{t("pages.incidents.dialog.details.timeline")}</Typography>
|
<Cell>{t("pages.incidents.dialog.details.timeline")}</Cell>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={6}>
|
<Grid size={6}>
|
||||||
<Typography>{t("pages.incidents.dialog.details.detailsLabel")}</Typography>
|
<Cell>{t("pages.incidents.dialog.details.detailsLabel")}</Cell>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={6}>
|
<Grid size={6}>
|
||||||
<Divider></Divider>
|
<Divider />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={6}>
|
<Grid size={6}>
|
||||||
<Divider></Divider>
|
<Divider />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={2}>
|
<Grid size={2}>
|
||||||
<Typography>{t("pages.incidents.dialog.details.startedAt")}</Typography>
|
<Cell>{t("pages.incidents.dialog.details.startedAt")}</Cell>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={4}>
|
<Grid size={4}>
|
||||||
<Typography>
|
<Cell>
|
||||||
{formatDateWithTz(incident.startTime, "D MMM YYYY, h:mm A", uiTimezone)}
|
{formatDateWithTz(incident.startTime, "D MMM YYYY, h:mm A", uiTimezone)}
|
||||||
</Typography>
|
</Cell>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={2}>
|
<Grid size={2}>
|
||||||
<Typography>{t("pages.incidents.dialog.details.statusCode")}</Typography>
|
<Cell>{t("pages.incidents.dialog.details.statusCode")}</Cell>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={4}>
|
<Grid size={4}>
|
||||||
<Typography>{incident.statusCode ?? "N/A"}</Typography>
|
<Cell>{incident.statusCode ?? "N/A"}</Cell>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={2}>
|
<Grid size={2}>
|
||||||
<Typography>{t("pages.incidents.dialog.details.downtime")}</Typography>
|
<Cell>{t("pages.incidents.dialog.details.downtime")}</Cell>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={4}>
|
<Grid size={4}>
|
||||||
<Typography>{getIncidentsDuration(incident)}</Typography>
|
<Cell>{getIncidentsDuration(incident)}</Cell>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={2}>
|
<Grid size={2}>
|
||||||
<Typography>{t("pages.incidents.dialog.details.message")}</Typography>
|
<Cell>{t("pages.incidents.dialog.details.message")}</Cell>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={4}>
|
<Grid size={4}>
|
||||||
<Typography>{incident.message ?? "N/A"}</Typography>
|
<Cell>{incident.message ?? "N/A"}</Cell>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -130,60 +144,53 @@ export const CardDetails = ({ incident, monitor, sx }: CardDetailsProps) => {
|
|||||||
{!incident.status && (
|
{!incident.status && (
|
||||||
<BaseBox padding={LAYOUT.MD}>
|
<BaseBox padding={LAYOUT.MD}>
|
||||||
<Stack gap={theme.spacing(LAYOUT.XS)}>
|
<Stack gap={theme.spacing(LAYOUT.XS)}>
|
||||||
<Typography textTransform={"uppercase"}>
|
<SectionHeading>
|
||||||
{t("pages.incidents.dialog.details.resolutionDetails")}
|
{t("pages.incidents.dialog.details.resolutionDetails")}
|
||||||
</Typography>
|
</SectionHeading>
|
||||||
<Divider />
|
|
||||||
<Grid
|
<Grid
|
||||||
container
|
container
|
||||||
spacing={theme.spacing(LAYOUT.MD)}
|
spacing={theme.spacing(LAYOUT.MD)}
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
>
|
>
|
||||||
<Grid size={2}>
|
<Grid size={2}>
|
||||||
<Typography>{t("pages.incidents.dialog.details.resolvedAt")}</Typography>
|
<Cell>{t("pages.incidents.dialog.details.resolvedAt")}</Cell>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={10}>
|
<Grid size={10}>
|
||||||
<Typography>
|
<Cell>
|
||||||
{incident.endTime
|
{incident.endTime
|
||||||
? formatDateWithTz(incident.endTime, "D MMM YYYY, h:mm A", uiTimezone)
|
? formatDateWithTz(incident.endTime, "D MMM YYYY, h:mm A", uiTimezone)
|
||||||
: "N/A"}
|
: "N/A"}
|
||||||
</Typography>
|
</Cell>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={2}>
|
<Grid size={2}>
|
||||||
<Typography>
|
<Cell>{t("pages.incidents.dialog.details.resolutionType")}</Cell>
|
||||||
{t("pages.incidents.dialog.details.resolutionType")}
|
|
||||||
</Typography>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={10}>
|
<Grid size={10}>
|
||||||
<Typography>
|
<Cell>
|
||||||
{incident.resolutionType
|
{incident.resolutionType
|
||||||
? t(
|
? t(
|
||||||
`pages.incidents.dialog.details.resolutionTypes.${incident.resolutionType}`
|
`pages.incidents.dialog.details.resolutionTypes.${incident.resolutionType}`
|
||||||
)
|
)
|
||||||
: "N/A"}
|
: "N/A"}
|
||||||
</Typography>
|
</Cell>
|
||||||
</Grid>
|
</Grid>
|
||||||
{incident.resolvedBy && (
|
{incident.resolvedBy && (
|
||||||
<>
|
<>
|
||||||
<Grid size={2}>
|
<Grid size={2}>
|
||||||
<Typography>
|
<Cell>{t("pages.incidents.dialog.details.resolvedBy")}</Cell>
|
||||||
{t("pages.incidents.dialog.details.resolvedBy")}
|
|
||||||
</Typography>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={10}>
|
<Grid size={10}>
|
||||||
<Typography>
|
<Cell>{incident.resolvedByEmail ?? incident.resolvedBy}</Cell>
|
||||||
{incident.resolvedByEmail ?? incident.resolvedBy}
|
|
||||||
</Typography>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{incident.comment && (
|
{incident.comment && (
|
||||||
<>
|
<>
|
||||||
<Grid size={2}>
|
<Grid size={2}>
|
||||||
<Typography>{t("pages.incidents.dialog.details.comment")}</Typography>
|
<Cell>{t("pages.incidents.dialog.details.comment")}</Cell>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={10}>
|
<Grid size={10}>
|
||||||
<Typography>{incident.comment}</Typography>
|
<Cell>{incident.comment}</Cell>
|
||||||
</Grid>
|
</Grid>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import Stack from "@mui/material/Stack";
|
import Stack from "@mui/material/Stack";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import Divider from "@mui/material/Divider";
|
|
||||||
import Grid from "@mui/material/Grid";
|
import Grid from "@mui/material/Grid";
|
||||||
import { BaseBox, ValueLabel } from "@/Components/design-elements";
|
import { BaseBox, Icon, ValueLabel } from "@/Components/design-elements";
|
||||||
import { CircleCheck, TriangleAlert, Bell, Wrench, Globe } from "lucide-react";
|
import { CircleCheck, TriangleAlert, Bell, Wrench, Globe } from "lucide-react";
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
|
|
||||||
@@ -25,6 +24,7 @@ const SummaryItem = ({ icon, label, value }: SummaryItemProps) => {
|
|||||||
alignItems="center"
|
alignItems="center"
|
||||||
justifyContent="space-between"
|
justifyContent="space-between"
|
||||||
gap={theme.spacing(2)}
|
gap={theme.spacing(2)}
|
||||||
|
minHeight={32}
|
||||||
>
|
>
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
@@ -32,10 +32,10 @@ const SummaryItem = ({ icon, label, value }: SummaryItemProps) => {
|
|||||||
gap={theme.spacing(2)}
|
gap={theme.spacing(2)}
|
||||||
>
|
>
|
||||||
{icon}
|
{icon}
|
||||||
<Typography variant="body2">{label}</Typography>
|
<Typography variant="body1">{label}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Typography
|
<Typography
|
||||||
variant="body2"
|
variant="body1"
|
||||||
fontWeight={600}
|
fontWeight={600}
|
||||||
>
|
>
|
||||||
{value}
|
{value}
|
||||||
@@ -67,15 +67,11 @@ export const SummaryCard = ({
|
|||||||
>
|
>
|
||||||
<Typography
|
<Typography
|
||||||
component="h2"
|
component="h2"
|
||||||
sx={{
|
variant="eyebrow"
|
||||||
textTransform: "uppercase",
|
color={theme.palette.text.secondary}
|
||||||
fontWeight: 500,
|
|
||||||
fontSize: 13,
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{title}
|
{title}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Divider />
|
|
||||||
{children}
|
{children}
|
||||||
</Stack>
|
</Stack>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
@@ -97,10 +93,13 @@ export const SummaryCardActiveIncidents = ({
|
|||||||
const activeCount = summary.totalActive;
|
const activeCount = summary.totalActive;
|
||||||
const hasActive = activeCount > 0;
|
const hasActive = activeCount > 0;
|
||||||
const color = hasActive ? theme.palette.error.main : theme.palette.success.main;
|
const color = hasActive ? theme.palette.error.main : theme.palette.success.main;
|
||||||
const icon = hasActive ? (
|
const icon = (
|
||||||
<TriangleAlert color={color} />
|
<Box sx={{ color, display: "inline-flex" }}>
|
||||||
) : (
|
<Icon
|
||||||
<CircleCheck color={color} />
|
icon={hasActive ? TriangleAlert : CircleCheck}
|
||||||
|
size={32}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
);
|
);
|
||||||
const msg = t("pages.incidents.summaryCard.activeIncidents.active", {
|
const msg = t("pages.incidents.summaryCard.activeIncidents.active", {
|
||||||
count: activeCount,
|
count: activeCount,
|
||||||
@@ -133,10 +132,7 @@ const SummaryIncidentItem = ({ incident }: { incident: IncidentSummaryItem }) =>
|
|||||||
container
|
container
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
spacing={2}
|
spacing={2}
|
||||||
sx={{
|
sx={{ width: "100%", minHeight: 32 }}
|
||||||
width: "100%",
|
|
||||||
py: theme.spacing(0.5),
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Grid
|
<Grid
|
||||||
size={{ xs: 12, lg: 5 }}
|
size={{ xs: 12, lg: 5 }}
|
||||||
@@ -147,7 +143,7 @@ const SummaryIncidentItem = ({ incident }: { incident: IncidentSummaryItem }) =>
|
|||||||
gap: theme.spacing(2),
|
gap: theme.spacing(2),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Globe />
|
<Icon icon={Globe} />
|
||||||
<Typography
|
<Typography
|
||||||
variant="body1"
|
variant="body1"
|
||||||
fontWeight={500}
|
fontWeight={500}
|
||||||
@@ -159,9 +155,7 @@ const SummaryIncidentItem = ({ incident }: { incident: IncidentSummaryItem }) =>
|
|||||||
|
|
||||||
<Grid
|
<Grid
|
||||||
size={{ xs: 12, md: 6, lg: 3 }}
|
size={{ xs: 12, md: 6, lg: 3 }}
|
||||||
sx={{
|
sx={{ display: "flex" }}
|
||||||
display: "flex",
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<ValueLabel
|
<ValueLabel
|
||||||
value={incident.status ? "negative" : "positive"}
|
value={incident.status ? "negative" : "positive"}
|
||||||
@@ -173,7 +167,7 @@ const SummaryIncidentItem = ({ incident }: { incident: IncidentSummaryItem }) =>
|
|||||||
size={{ xs: 12, md: 6, lg: 4 }}
|
size={{ xs: 12, md: 6, lg: 4 }}
|
||||||
sx={{
|
sx={{
|
||||||
textAlign: { xs: "left", md: "right" },
|
textAlign: { xs: "left", md: "right" },
|
||||||
fontWeight: 500,
|
fontWeight: 600,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography variant="body1">{duration}</Typography>
|
<Typography variant="body1">{duration}</Typography>
|
||||||
@@ -190,22 +184,17 @@ export const SummaryCardLatestIncidents = ({
|
|||||||
summary,
|
summary,
|
||||||
}: SummaryCardLatestIncidentsProps) => {
|
}: SummaryCardLatestIncidentsProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const theme = useTheme();
|
|
||||||
|
|
||||||
const latestIncidents = summary?.latestIncidents ?? [];
|
const latestIncidents = summary?.latestIncidents ?? [];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SummaryCard title={t("pages.incidents.summaryCard.latestIncidents.title")}>
|
<SummaryCard title={t("pages.incidents.summaryCard.latestIncidents.title")}>
|
||||||
<Stack gap={theme.spacing(4)}>
|
{latestIncidents.slice(0, 3).map((incident) => (
|
||||||
{latestIncidents.slice(0, 3).map((incident, index) => (
|
<SummaryIncidentItem
|
||||||
<Box key={incident.id}>
|
key={incident.id}
|
||||||
<SummaryIncidentItem incident={incident} />
|
incident={incident}
|
||||||
{index < latestIncidents.length - 1 && (
|
/>
|
||||||
<Divider sx={{ mt: theme.spacing(2) }} />
|
))}
|
||||||
)}
|
|
||||||
</Box>
|
|
||||||
))}
|
|
||||||
</Stack>
|
|
||||||
</SummaryCard>
|
</SummaryCard>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -224,17 +213,17 @@ export const SummaryCardStats = ({ summary }: SummaryCardStatsProps) => {
|
|||||||
return (
|
return (
|
||||||
<SummaryCard title={t("pages.incidents.summaryCard.incidentStats.title")}>
|
<SummaryCard title={t("pages.incidents.summaryCard.incidentStats.title")}>
|
||||||
<SummaryItem
|
<SummaryItem
|
||||||
icon={<Bell size={18} />}
|
icon={<Icon icon={Bell} />}
|
||||||
label={t("pages.incidents.summaryCard.incidentStats.totalIncidents")}
|
label={t("pages.incidents.summaryCard.incidentStats.totalIncidents")}
|
||||||
value={summary?.total || 0}
|
value={summary?.total || 0}
|
||||||
/>
|
/>
|
||||||
<SummaryItem
|
<SummaryItem
|
||||||
icon={<TriangleAlert size={18} />}
|
icon={<Icon icon={TriangleAlert} />}
|
||||||
label={t("pages.incidents.summaryCard.incidentStats.mostAffectedMonitor")}
|
label={t("pages.incidents.summaryCard.incidentStats.mostAffectedMonitor")}
|
||||||
value={mostAffected}
|
value={mostAffected}
|
||||||
/>
|
/>
|
||||||
<SummaryItem
|
<SummaryItem
|
||||||
icon={<Wrench size={18} />}
|
icon={<Icon icon={Wrench} />}
|
||||||
label={t("pages.incidents.summaryCard.incidentStats.avgResolutionTime")}
|
label={t("pages.incidents.summaryCard.incidentStats.avgResolutionTime")}
|
||||||
value={
|
value={
|
||||||
summary.total > 0
|
summary.total > 0
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export const ControlsIncidentFilter = ({
|
|||||||
variant="contained"
|
variant="contained"
|
||||||
onClick={onClearFilters}
|
onClick={onClearFilters}
|
||||||
>
|
>
|
||||||
{t("pages.incidents.filters.clearFilters")}
|
{t("common.buttons.clearFilters")}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import { HeaderTimeRange } from "@/Components/common";
|
|||||||
import { ControlsIncidentFilter } from "@/Pages/Incidents/Components/ControlsIncidentFilter";
|
import { ControlsIncidentFilter } from "@/Pages/Incidents/Components/ControlsIncidentFilter";
|
||||||
|
|
||||||
import { useGet } from "@/Hooks/UseApi";
|
import { useGet } from "@/Hooks/UseApi";
|
||||||
|
import { LAYOUT } from "@/Utils/Theme/constants";
|
||||||
import { useState, useEffect, useMemo } from "react";
|
import { useState, useEffect, useMemo } from "react";
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import type { Incident, IncidentsResponse, IncidentSummary } from "@/Types/Incident";
|
import type { Incident, IncidentsResponse, IncidentSummary } from "@/Types/Incident";
|
||||||
@@ -186,8 +187,9 @@ const IncidentsPage = () => {
|
|||||||
{activeIncidentsCount > 0 && (
|
{activeIncidentsCount > 0 && (
|
||||||
<>
|
<>
|
||||||
<Typography
|
<Typography
|
||||||
variant="h6"
|
variant="eyebrow"
|
||||||
sx={{ mb: theme.spacing(4), textTransform: "uppercase" }}
|
color={theme.palette.text.secondary}
|
||||||
|
mb={theme.spacing(LAYOUT.XS)}
|
||||||
>
|
>
|
||||||
{t("pages.incidents.table.activeIncidents")}
|
{t("pages.incidents.table.activeIncidents")}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -208,8 +210,9 @@ const IncidentsPage = () => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<Typography
|
<Typography
|
||||||
variant="h6"
|
variant="eyebrow"
|
||||||
sx={{ mb: theme.spacing(4), textTransform: "uppercase" }}
|
color={theme.palette.text.secondary}
|
||||||
|
mb={theme.spacing(LAYOUT.XS)}
|
||||||
>
|
>
|
||||||
{t("pages.incidents.table.resolvedIncidents")}
|
{t("pages.incidents.table.resolvedIncidents")}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import Grid from "@mui/material/Grid";
|
import Grid from "@mui/material/Grid";
|
||||||
|
import Stack from "@mui/material/Stack";
|
||||||
|
import { NoticeBanner } from "@/Components/design-elements";
|
||||||
import { HistogramInfrastructure } from "@/Components/monitors";
|
import { HistogramInfrastructure } from "@/Components/monitors";
|
||||||
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -6,6 +8,7 @@ import type { HardwareCheckStats } from "@/Types/Monitor";
|
|||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { useTheme } from "@mui/material/styles";
|
import { useTheme } from "@mui/material/styles";
|
||||||
import useMediaQuery from "@mui/material/useMediaQuery";
|
import useMediaQuery from "@mui/material/useMediaQuery";
|
||||||
|
import { LAYOUT } from "@/Utils/Theme/constants";
|
||||||
|
|
||||||
const formatBytesToMB = (value: number) => `${(value / (1024 * 1024)).toFixed(2)} MB`;
|
const formatBytesToMB = (value: number) => `${(value / (1024 * 1024)).toFixed(2)} MB`;
|
||||||
|
|
||||||
@@ -60,6 +63,11 @@ const getChartConfigs = (
|
|||||||
return configs;
|
return configs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const hasAnyNetworkTraffic = (checks: HardwareCheckStats[]): boolean =>
|
||||||
|
checks.some((c) =>
|
||||||
|
c.net?.some((iface) => iface.bytesSentPerSecond > 0 || iface.deltaBytesRecv > 0)
|
||||||
|
);
|
||||||
|
|
||||||
export const InfraNetworkCharts = ({
|
export const InfraNetworkCharts = ({
|
||||||
checks,
|
checks,
|
||||||
dateRange,
|
dateRange,
|
||||||
@@ -74,35 +82,43 @@ export const InfraNetworkCharts = ({
|
|||||||
() => getChartConfigs(theme, checks, t),
|
() => getChartConfigs(theme, checks, t),
|
||||||
[theme, checks, t]
|
[theme, checks, t]
|
||||||
);
|
);
|
||||||
|
const showNoTrafficNotice = chartConfigs.length > 0 && !hasAnyNetworkTraffic(checks);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Grid
|
<Stack gap={theme.spacing(LAYOUT.XS)}>
|
||||||
container
|
{showNoTrafficNotice && (
|
||||||
spacing={theme.spacing(8)}
|
<NoticeBanner severity="warning">
|
||||||
>
|
{t("pages.infrastructure.charts.labels.netNoTraffic")}
|
||||||
{chartConfigs.map((config) => {
|
</NoticeBanner>
|
||||||
return (
|
)}
|
||||||
<Grid
|
<Grid
|
||||||
size={isSmall ? 12 : 6}
|
container
|
||||||
key={`${config.type}-${config.interfaceName ?? config.idx ?? ""}`}
|
spacing={theme.spacing(LAYOUT.MD)}
|
||||||
>
|
>
|
||||||
<HistogramInfrastructure
|
{chartConfigs.map((config) => {
|
||||||
dateRange={dateRange}
|
return (
|
||||||
title={config.title}
|
<Grid
|
||||||
type={config.type}
|
size={isSmall ? 12 : 6}
|
||||||
idx={config.idx}
|
key={`${config.type}-${config.interfaceName ?? config.idx ?? ""}`}
|
||||||
checks={checks}
|
>
|
||||||
xKey="bucketDate"
|
<HistogramInfrastructure
|
||||||
dataKeys={config.dataKeys}
|
dateRange={dateRange}
|
||||||
gradient={true}
|
title={config.title}
|
||||||
gradientStartColor={config.gradientStartColor}
|
type={config.type}
|
||||||
gradientEndColor="#ffffff"
|
idx={config.idx}
|
||||||
strokeColor={config.strokeColor}
|
checks={checks}
|
||||||
yAxisFormatter={formatBytesToMB}
|
xKey="bucketDate"
|
||||||
/>
|
dataKeys={config.dataKeys}
|
||||||
</Grid>
|
gradient={true}
|
||||||
);
|
gradientStartColor={config.gradientStartColor}
|
||||||
})}
|
gradientEndColor="#ffffff"
|
||||||
</Grid>
|
strokeColor={config.strokeColor}
|
||||||
|
yAxisFormatter={formatBytesToMB}
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Grid>
|
||||||
|
</Stack>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
const typographyBase = 13;
|
const typographyBase = 13;
|
||||||
|
|
||||||
export const typographyLevels = {
|
export const typographyLevels = {
|
||||||
base: typographyBase,
|
base: typographyBase, // 13px
|
||||||
xs: `${(typographyBase - 4) / 16}rem`,
|
xs: `${(typographyBase - 4) / 16}rem`, // 9px
|
||||||
s: `${(typographyBase - 2) / 16}rem`,
|
s: `${(typographyBase - 2) / 16}rem`, // 11px
|
||||||
m: `${typographyBase / 16}rem`,
|
m: `${typographyBase / 16}rem`, // 13px
|
||||||
l: `${(typographyBase + 2) / 16}rem`,
|
l: `${(typographyBase + 2) / 16}rem`, // 15px
|
||||||
xl: `${(typographyBase + 10) / 16}rem`,
|
xl: `${(typographyBase + 5) / 16}rem`, // 18px
|
||||||
|
xxl: `${(typographyBase + 10) / 16}rem`, // 23px
|
||||||
};
|
};
|
||||||
|
|
||||||
export const colors = {
|
export const colors = {
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export const theme = (mode: string, palette: any) =>
|
|||||||
fontFamilyMonospace,
|
fontFamilyMonospace,
|
||||||
fontSize: typographyLevels.base,
|
fontSize: typographyLevels.base,
|
||||||
h1: {
|
h1: {
|
||||||
fontSize: typographyLevels.xl,
|
fontSize: typographyLevels.xxl,
|
||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
},
|
},
|
||||||
h2: {
|
h2: {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ export const SPACING = {
|
|||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const LAYOUT = {
|
export const LAYOUT = {
|
||||||
|
XXS: 2,
|
||||||
XS: 4,
|
XS: 4,
|
||||||
SM: 6,
|
SM: 6,
|
||||||
MD: 8,
|
MD: 8,
|
||||||
@@ -15,3 +16,7 @@ export const LAYOUT = {
|
|||||||
XL: 12,
|
XL: 12,
|
||||||
XXL: 16,
|
XXL: 16,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
export const HOVER = {
|
||||||
|
DARKEN: 0.06, // This is a coefficient for darkening function
|
||||||
|
} as const;
|
||||||
@@ -769,6 +769,7 @@
|
|||||||
"memory": "استخدام الذاكرة",
|
"memory": "استخدام الذاكرة",
|
||||||
"netBytesRecv": "{{name}} - البايتات المستلمة",
|
"netBytesRecv": "{{name}} - البايتات المستلمة",
|
||||||
"netBytesSent": "{{name}} - البايتات المرسلة",
|
"netBytesSent": "{{name}} - البايتات المرسلة",
|
||||||
|
"netNoTraffic": "Capture يبلغ عن عدم وجود حركة بيانات على أي واجهة. هذا أمر طبيعي عندما يعمل Capture داخل حاوية لا ترى سوى واجهات الاسترجاع — قم بتشغيل Capture مباشرة على المضيف لرؤية نشاط الشبكة الحقيقي.",
|
||||||
"temp": "الحرارة"
|
"temp": "الحرارة"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -769,6 +769,7 @@
|
|||||||
"memory": "Využití paměti",
|
"memory": "Využití paměti",
|
||||||
"netBytesRecv": "{{name}} - přijaté bajty",
|
"netBytesRecv": "{{name}} - přijaté bajty",
|
||||||
"netBytesSent": "{{name}} - odeslané bajty",
|
"netBytesSent": "{{name}} - odeslané bajty",
|
||||||
|
"netNoTraffic": "Capture hlásí nulový provoz na všech rozhraních. To je normální, když Capture běží uvnitř kontejneru, který vidí pouze loopback rozhraní — spusťte Capture přímo na hostiteli, abyste viděli skutečnou síťovou aktivitu.",
|
||||||
"temp": "Teplota"
|
"temp": "Teplota"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -769,6 +769,7 @@
|
|||||||
"memory": "Arbeitsspeicherauslastung",
|
"memory": "Arbeitsspeicherauslastung",
|
||||||
"netBytesRecv": "{{name}} - Empfangene Bytes",
|
"netBytesRecv": "{{name}} - Empfangene Bytes",
|
||||||
"netBytesSent": "{{name}} - Gesendete Bytes",
|
"netBytesSent": "{{name}} - Gesendete Bytes",
|
||||||
|
"netNoTraffic": "Capture meldet null Datenverkehr auf allen Schnittstellen. Das ist normal, wenn Capture in einem Container läuft, der nur Loopback-Schnittstellen sieht — führe Capture direkt auf dem Host aus, um echten Netzwerkverkehr zu sehen.",
|
||||||
"temp": "Temp."
|
"temp": "Temp."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -769,6 +769,7 @@
|
|||||||
"memory": "Memory usage",
|
"memory": "Memory usage",
|
||||||
"netBytesRecv": "{{name}} - Bytes Received",
|
"netBytesRecv": "{{name}} - Bytes Received",
|
||||||
"netBytesSent": "{{name}} - Bytes Sent",
|
"netBytesSent": "{{name}} - Bytes Sent",
|
||||||
|
"netNoTraffic": "Capture is reporting zero traffic on every interface. This is normal when Capture runs inside a container that can only see loopback interfaces — run Capture directly on the host to see real network activity.",
|
||||||
"temp": "Temp"
|
"temp": "Temp"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -776,6 +776,7 @@
|
|||||||
"memory": "Uso de memoria",
|
"memory": "Uso de memoria",
|
||||||
"netBytesRecv": "{{name}} - Bytes recibidos",
|
"netBytesRecv": "{{name}} - Bytes recibidos",
|
||||||
"netBytesSent": "{{name}} - Bytes enviados",
|
"netBytesSent": "{{name}} - Bytes enviados",
|
||||||
|
"netNoTraffic": "Capture no informa tráfico en ninguna interfaz. Esto es normal cuando Capture se ejecuta dentro de un contenedor que solo ve interfaces de loopback — ejecuta Capture directamente en el host para ver actividad de red real.",
|
||||||
"temp": "Temp"
|
"temp": "Temp"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -769,6 +769,7 @@
|
|||||||
"memory": "Muistin käyttö",
|
"memory": "Muistin käyttö",
|
||||||
"netBytesRecv": "{{name}} - tavua vastaanotettu",
|
"netBytesRecv": "{{name}} - tavua vastaanotettu",
|
||||||
"netBytesSent": "{{name}} - tavua lähetetty",
|
"netBytesSent": "{{name}} - tavua lähetetty",
|
||||||
|
"netNoTraffic": "Capture ilmoittaa nollaliikennettä kaikilla rajapinnoilla. Tämä on normaalia, kun Capture käynnistetään säiliössä, joka näkee vain loopback-rajapinnat — suorita Capture suoraan isännällä nähdäksesi todellisen verkkoaktiviteetin.",
|
||||||
"temp": "Lämpö"
|
"temp": "Lämpö"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -769,6 +769,7 @@
|
|||||||
"memory": "Utilisation mémoire",
|
"memory": "Utilisation mémoire",
|
||||||
"netBytesRecv": "{{name}} - Octets reçus",
|
"netBytesRecv": "{{name}} - Octets reçus",
|
||||||
"netBytesSent": "{{name}} - Octets envoyés",
|
"netBytesSent": "{{name}} - Octets envoyés",
|
||||||
|
"netNoTraffic": "Capture ne signale aucun trafic sur toutes les interfaces. C'est normal lorsque Capture s'exécute dans un conteneur qui ne voit que les interfaces de loopback — exécutez Capture directement sur l'hôte pour voir l'activité réseau réelle.",
|
||||||
"temp": "Temp."
|
"temp": "Temp."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -769,6 +769,7 @@
|
|||||||
"memory": "メモリ使用率",
|
"memory": "メモリ使用率",
|
||||||
"netBytesRecv": "{{name}} - 受信バイト数",
|
"netBytesRecv": "{{name}} - 受信バイト数",
|
||||||
"netBytesSent": "{{name}} - 送信バイト数",
|
"netBytesSent": "{{name}} - 送信バイト数",
|
||||||
|
"netNoTraffic": "Capture はすべてのインターフェイスでゼロのトラフィックを報告しています。これは Capture がループバックインターフェイスのみを認識できるコンテナ内で実行されている場合に正常です — 実際のネットワークアクティビティを表示するには、ホスト上で Capture を直接実行してください。",
|
||||||
"temp": "温度"
|
"temp": "温度"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -769,6 +769,7 @@
|
|||||||
"memory": "Uso de memória",
|
"memory": "Uso de memória",
|
||||||
"netBytesRecv": "{{name}} - Bytes recebidos",
|
"netBytesRecv": "{{name}} - Bytes recebidos",
|
||||||
"netBytesSent": "{{name}} - Bytes enviados",
|
"netBytesSent": "{{name}} - Bytes enviados",
|
||||||
|
"netNoTraffic": "Capture está reportando zero tráfego em todas as interfaces. Isso é normal quando Capture é executado dentro de um container que só consegue ver interfaces de loopback — execute Capture diretamente no host para ver a atividade real da rede.",
|
||||||
"temp": "Temp"
|
"temp": "Temp"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -769,6 +769,7 @@
|
|||||||
"memory": "Использование памяти",
|
"memory": "Использование памяти",
|
||||||
"netBytesRecv": "{{name}} - байт получено",
|
"netBytesRecv": "{{name}} - байт получено",
|
||||||
"netBytesSent": "{{name}} - байт отправлено",
|
"netBytesSent": "{{name}} - байт отправлено",
|
||||||
|
"netNoTraffic": "Capture сообщает о нулевом трафике на всех интерфейсах. Это нормально, когда Capture работает внутри контейнера, который видит только loopback-интерфейсы — запустите Capture непосредственно на хосте, чтобы увидеть реальную сетевую активность.",
|
||||||
"temp": "Температура"
|
"temp": "Температура"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -769,6 +769,7 @@
|
|||||||
"memory": "การใช้งานหน่วยความจำ",
|
"memory": "การใช้งานหน่วยความจำ",
|
||||||
"netBytesRecv": "{{name}} - ไบต์ที่รับ",
|
"netBytesRecv": "{{name}} - ไบต์ที่รับ",
|
||||||
"netBytesSent": "{{name}} - ไบต์ที่ส่ง",
|
"netBytesSent": "{{name}} - ไบต์ที่ส่ง",
|
||||||
|
"netNoTraffic": "Capture รายงานว่าไม่มีการรับส่งข้อมูลบนอินเทอร์เฟซใดๆ เลย ซึ่งเป็นเรื่องปกติเมื่อ Capture ทำงานอยู่ในคอนเทนเนอร์ที่มองเห็นเพียงอินเทอร์เฟซ loopback เท่านั้น — รัน Capture บนโฮสต์โดยตรงเพื่อดูกิจกรรมเครือข่ายจริง",
|
||||||
"temp": "อุณหภูมิ"
|
"temp": "อุณหภูมิ"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -769,6 +769,7 @@
|
|||||||
"memory": "Bellek kullanımı",
|
"memory": "Bellek kullanımı",
|
||||||
"netBytesRecv": "{{name}} - Alınan bayt",
|
"netBytesRecv": "{{name}} - Alınan bayt",
|
||||||
"netBytesSent": "{{name}} - Gönderilen bayt",
|
"netBytesSent": "{{name}} - Gönderilen bayt",
|
||||||
|
"netNoTraffic": "Capture tüm arabirimlerde sıfır trafik raporluyor. Bu, Capture yalnızca loopback arabirimlerini görebilen bir konteyner içinde çalışırken normaldir — gerçek ağ etkinliğini görmek için Capture'ı doğrudan host üzerinde çalıştırın.",
|
||||||
"temp": "Sıcaklık"
|
"temp": "Sıcaklık"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -769,6 +769,7 @@
|
|||||||
"memory": "Використання пам'яті",
|
"memory": "Використання пам'яті",
|
||||||
"netBytesRecv": "{{name}} - Отримано байтів",
|
"netBytesRecv": "{{name}} - Отримано байтів",
|
||||||
"netBytesSent": "{{name}} - Надіслано байтів",
|
"netBytesSent": "{{name}} - Надіслано байтів",
|
||||||
|
"netNoTraffic": "Capture повідомляє про нульовий трафік на всіх інтерфейсах. Це нормально, коли Capture працює всередині контейнера, який бачить лише loopback-інтерфейси — запустіть Capture безпосередньо на хості, щоб побачити реальну мережеву активність.",
|
||||||
"temp": "Темп."
|
"temp": "Темп."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -769,6 +769,7 @@
|
|||||||
"memory": "Sử dụng bộ nhớ",
|
"memory": "Sử dụng bộ nhớ",
|
||||||
"netBytesRecv": "{{name}} - Byte nhận",
|
"netBytesRecv": "{{name}} - Byte nhận",
|
||||||
"netBytesSent": "{{name}} - Byte gửi",
|
"netBytesSent": "{{name}} - Byte gửi",
|
||||||
|
"netNoTraffic": "Capture đang báo cáo lưu lượng bằng không trên mọi giao diện. Điều này là bình thường khi Capture chạy bên trong một container chỉ có thể thấy các giao diện loopback — hãy chạy Capture trực tiếp trên máy chủ để xem hoạt động mạng thực tế.",
|
||||||
"temp": "Nhiệt độ"
|
"temp": "Nhiệt độ"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -769,6 +769,7 @@
|
|||||||
"memory": "内存使用率",
|
"memory": "内存使用率",
|
||||||
"netBytesRecv": "{{name}} - 接收字节",
|
"netBytesRecv": "{{name}} - 接收字节",
|
||||||
"netBytesSent": "{{name}} - 发送字节",
|
"netBytesSent": "{{name}} - 发送字节",
|
||||||
|
"netNoTraffic": "Capture 报告所有接口的流量均为零。当 Capture 在只能看到回环接口的容器内运行时,这属于正常情况——请直接在主机上运行 Capture 才能看到真实的网络活动。",
|
||||||
"temp": "温度"
|
"temp": "温度"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -769,6 +769,7 @@
|
|||||||
"memory": "記憶體使用率",
|
"memory": "記憶體使用率",
|
||||||
"netBytesRecv": "{{name}} - 接收位元組",
|
"netBytesRecv": "{{name}} - 接收位元組",
|
||||||
"netBytesSent": "{{name}} - 發送位元組",
|
"netBytesSent": "{{name}} - 發送位元組",
|
||||||
|
"netNoTraffic": "Capture 回報所有介面的流量皆為零。當 Capture 在只能看到回環介面的容器中執行時,這是正常情況——請直接在主機上執行 Capture 才能看到實際的網路活動。",
|
||||||
"temp": "溫度"
|
"temp": "溫度"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user