types
This commit is contained in:
1 parent
f2d2687d2a
commit
667dc55fc8
4 files changed
+11
-10
No files matched your search
@@ -7,6 +7,7 @@ import { useTheme } from "@mui/material/styles";
|
|||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import type { RootState } from "@/Types/state";
|
import type { RootState } from "@/Types/state";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
type HeatmapCheck =
|
type HeatmapCheck =
|
||||||
| CheckSnapshot
|
| CheckSnapshot
|
||||||
| { status: "placeholder"; responseTime: 0; createdAt: "" };
|
| { status: "placeholder"; responseTime: 0; createdAt: "" };
|
||||||
@@ -55,12 +56,9 @@ export const HeatmapResponseTimeTooltip = ({
|
|||||||
<Typography>
|
<Typography>
|
||||||
{formatDateWithTz(check?.createdAt, "ddd, MMMM D, YYYY, HH:mm A", uiTimezone)}
|
{formatDateWithTz(check?.createdAt, "ddd, MMMM D, YYYY, HH:mm A", uiTimezone)}
|
||||||
</Typography>
|
</Typography>
|
||||||
{check?.responseTime && (
|
<Typography>
|
||||||
<Typography>
|
{t("common.labels.responseTime")}: {check.originalResponseTime.toFixed()} ms
|
||||||
{t("common.labels.responseTime")}: {check.responseTime.toFixed()} ms
|
</Typography>
|
||||||
</Typography>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Typography textTransform={"capitalize"}>
|
<Typography textTransform={"capitalize"}>
|
||||||
Status:{" "}
|
Status:{" "}
|
||||||
<span style={{ color: getColor(check?.status) }}>
|
<span style={{ color: getColor(check?.status) }}>
|
||||||
|
|||||||
@@ -12,11 +12,13 @@ const generateDummyChecks = (): CheckSnapshot[] => {
|
|||||||
const checks: CheckSnapshot[] = [];
|
const checks: CheckSnapshot[] = [];
|
||||||
for (let i = 0; i < 25; i++) {
|
for (let i = 0; i < 25; i++) {
|
||||||
const isUp = Math.random() > 0.1;
|
const isUp = Math.random() > 0.1;
|
||||||
|
const responseTime = Math.floor(Math.random() * 80) + 20;
|
||||||
checks.push({
|
checks.push({
|
||||||
id: `dummy-${i}`,
|
id: `dummy-${i}`,
|
||||||
status: isUp,
|
status: isUp,
|
||||||
statusCode: isUp ? 200 : 500,
|
statusCode: isUp ? 200 : 500,
|
||||||
responseTime: Math.floor(Math.random() * 80) + 20,
|
responseTime: responseTime,
|
||||||
|
originalResponseTime: responseTime,
|
||||||
message: "",
|
message: "",
|
||||||
createdAt: new Date(Date.now() - i * 60000).toISOString(),
|
createdAt: new Date(Date.now() - i * 60000).toISOString(),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -237,7 +237,9 @@ export interface ChecksSummary {
|
|||||||
export type CheckSnapshot = Omit<
|
export type CheckSnapshot = Omit<
|
||||||
Check,
|
Check,
|
||||||
"metadata" | "ack" | "ackAt" | "expiry" | "__v" | "updatedAt"
|
"metadata" | "ack" | "ackAt" | "expiry" | "__v" | "updatedAt"
|
||||||
>;
|
> & {
|
||||||
|
originalResponseTime: number;
|
||||||
|
};
|
||||||
|
|
||||||
export interface HasResponseTime {
|
export interface HasResponseTime {
|
||||||
responseTime: number;
|
responseTime: number;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import type { GroupedCheck } from "@/Types/Check";
|
import type { GroupedCheck, CheckSnapshot } from "@/Types/Check";
|
||||||
import type { CheckSnapshot } from "@/Types/Check";
|
|
||||||
export type MonitorStatus = boolean | undefined;
|
export type MonitorStatus = boolean | undefined;
|
||||||
|
|
||||||
export const MonitorTypes = [
|
export const MonitorTypes = [
|
||||||
|
|||||||
Reference in new issue
Block a user