status pages
This commit is contained in:
1 parent
602597abe2
commit
e5ef14215f
14 files changed
+77
-60
No files matched your search
@@ -5,14 +5,10 @@ import Link from "@mui/material/Link";
|
||||
import { config } from "@/config/index";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import type { IStatusPageWithMonitors } from "@/types/status-page";
|
||||
import type { IStatusPage } from "@/types/status-page";
|
||||
const HOST = config.HOST;
|
||||
|
||||
export const NameHeader = ({
|
||||
statusPage,
|
||||
}: {
|
||||
statusPage: IStatusPageWithMonitors;
|
||||
}) => {
|
||||
export const NameHeader = ({ statusPage }: { statusPage: IStatusPage }) => {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Stack direction={"row"} alignItems={"flex-end"} spacing={4}>
|
||||
|
||||
@@ -2,15 +2,11 @@ import Typography from "@mui/material/Typography";
|
||||
import Stack from "@mui/material/Stack";
|
||||
|
||||
import { getStatusPageHeaderConfig } from "@/utils/MonitorUtils";
|
||||
import type { IStatusPageWithMonitors } from "@/types/status-page";
|
||||
import type { IStatusPage } from "@/types/status-page";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export const StatusHeader = ({
|
||||
statusPage,
|
||||
}: {
|
||||
statusPage: IStatusPageWithMonitors;
|
||||
}) => {
|
||||
export const StatusHeader = ({ statusPage }: { statusPage: IStatusPage }) => {
|
||||
const theme = useTheme();
|
||||
const { t } = useTranslation();
|
||||
const headerConfig = getStatusPageHeaderConfig(statusPage?.monitors || [], t);
|
||||
|
||||
@@ -8,7 +8,9 @@ import { useTheme } from "@mui/material/styles";
|
||||
import { useAppSelector } from "@/hooks/AppHooks";
|
||||
import type { IMonitor } from "@/types/monitor";
|
||||
|
||||
export const StatusPageRow = ({ monitor }: { monitor: IMonitor }) => {
|
||||
type Props = { monitor: IMonitor; checks: any[] };
|
||||
|
||||
export const StatusPageRow = ({ monitor, checks }: Props) => {
|
||||
const theme = useTheme();
|
||||
const type = useAppSelector((state) => state?.ui?.chartType || "heatmap");
|
||||
|
||||
@@ -32,7 +34,7 @@ export const StatusPageRow = ({ monitor }: { monitor: IMonitor }) => {
|
||||
{type === "heatmap" && (
|
||||
<HeatmapResponseTime
|
||||
gap={{ xs: theme.spacing(0.5), md: theme.spacing(2) }}
|
||||
checks={monitor?.latestChecks ?? []}
|
||||
checks={checks ?? []}
|
||||
availabilityCellSx={{
|
||||
borderRadius: {
|
||||
xs: theme.spacing(0.5),
|
||||
@@ -49,7 +51,7 @@ export const StatusPageRow = ({ monitor }: { monitor: IMonitor }) => {
|
||||
)}
|
||||
{type === "histogram" && (
|
||||
<HistogramResponseTime
|
||||
checks={monitor?.latestChecks ?? []}
|
||||
checks={checks ?? []}
|
||||
height={{ xs: 50, md: 100 }}
|
||||
gap={{ xs: 0.5, md: theme.spacing(4) }}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user