Fix: change height and witdth and Merge branch 'develop' into fix/placeholder-center-align
This commit is contained in:
commit
af0c69764f
8 files changed
+174
-48
No files matched your search
@@ -88,14 +88,15 @@ const Fallback = ({
|
|||||||
display: "flex",
|
display: "flex",
|
||||||
borderStyle: "dashed",
|
borderStyle: "dashed",
|
||||||
height: {
|
height: {
|
||||||
xs: theme.spacing(200),
|
sm: "50vh",
|
||||||
sm: theme.spacing(300),
|
md: "70vh",
|
||||||
md: theme.spacing(300),
|
lg: "60vh",
|
||||||
|
xl: "55vh",
|
||||||
},
|
},
|
||||||
width: {
|
width: {
|
||||||
xs: theme.spacing(100),
|
sm: "90%",
|
||||||
sm: theme.spacing(210),
|
md: "50%",
|
||||||
md: theme.spacing(250),
|
lg: "40%",
|
||||||
},
|
},
|
||||||
padding: theme.spacing(10),
|
padding: theme.spacing(10),
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { networkService } from "../main";
|
import { networkService } from "../main";
|
||||||
import { createToast } from "../Utils/toastUtils";
|
import { createToast } from "../Utils/toastUtils";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
const useFetchChecksTeam = ({
|
const useFetchChecksTeam = ({
|
||||||
status,
|
status,
|
||||||
@@ -12,6 +13,7 @@ const useFetchChecksTeam = ({
|
|||||||
page,
|
page,
|
||||||
rowsPerPage,
|
rowsPerPage,
|
||||||
enabled = true,
|
enabled = true,
|
||||||
|
updateTrigger,
|
||||||
}) => {
|
}) => {
|
||||||
const [checks, setChecks] = useState(undefined);
|
const [checks, setChecks] = useState(undefined);
|
||||||
const [checksCount, setChecksCount] = useState(undefined);
|
const [checksCount, setChecksCount] = useState(undefined);
|
||||||
@@ -49,7 +51,18 @@ const useFetchChecksTeam = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
fetchChecks();
|
fetchChecks();
|
||||||
}, [status, sortOrder, limit, dateRange, filter, ack, page, rowsPerPage, enabled]);
|
}, [
|
||||||
|
status,
|
||||||
|
sortOrder,
|
||||||
|
limit,
|
||||||
|
dateRange,
|
||||||
|
filter,
|
||||||
|
ack,
|
||||||
|
page,
|
||||||
|
rowsPerPage,
|
||||||
|
enabled,
|
||||||
|
updateTrigger,
|
||||||
|
]);
|
||||||
|
|
||||||
return [checks, checksCount, isLoading, networkError];
|
return [checks, checksCount, isLoading, networkError];
|
||||||
};
|
};
|
||||||
@@ -66,6 +79,7 @@ const useFetchChecksByMonitor = ({
|
|||||||
page,
|
page,
|
||||||
rowsPerPage,
|
rowsPerPage,
|
||||||
enabled = true,
|
enabled = true,
|
||||||
|
updateTrigger,
|
||||||
}) => {
|
}) => {
|
||||||
const [checks, setChecks] = useState(undefined);
|
const [checks, setChecks] = useState(undefined);
|
||||||
const [checksCount, setChecksCount] = useState(undefined);
|
const [checksCount, setChecksCount] = useState(undefined);
|
||||||
@@ -117,12 +131,13 @@ const useFetchChecksByMonitor = ({
|
|||||||
page,
|
page,
|
||||||
rowsPerPage,
|
rowsPerPage,
|
||||||
enabled,
|
enabled,
|
||||||
|
updateTrigger,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return [checks, checksCount, isLoading, networkError];
|
return [checks, checksCount, isLoading, networkError];
|
||||||
};
|
};
|
||||||
|
|
||||||
const useFetchChecksSummaryByTeamId = () => {
|
const useFetchChecksSummaryByTeamId = ({ updateTrigger } = {}) => {
|
||||||
const [summary, setSummary] = useState(undefined);
|
const [summary, setSummary] = useState(undefined);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [networkError, setNetworkError] = useState(false);
|
const [networkError, setNetworkError] = useState(false);
|
||||||
@@ -143,9 +158,56 @@ const useFetchChecksSummaryByTeamId = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
fetchSummary();
|
fetchSummary();
|
||||||
}, []);
|
}, [updateTrigger]);
|
||||||
|
|
||||||
return [summary, isLoading, networkError];
|
return [summary, isLoading, networkError];
|
||||||
};
|
};
|
||||||
|
|
||||||
export { useFetchChecksByMonitor, useFetchChecksTeam, useFetchChecksSummaryByTeamId };
|
const useResolveIncident = () => {
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const resolveIncident = async (checkId, setUpdateTrigger) => {
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
await networkService.updateCheckStatus({
|
||||||
|
checkId,
|
||||||
|
ack: true,
|
||||||
|
});
|
||||||
|
setUpdateTrigger((prev) => !prev);
|
||||||
|
} catch (error) {
|
||||||
|
createToast({ body: t("checkHooks.failureResolveOne") });
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return [resolveIncident, isLoading];
|
||||||
|
};
|
||||||
|
|
||||||
|
const useAckAllChecks = () => {
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const ackAllChecks = async (setUpdateTrigger) => {
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
await networkService.updateAllChecksStatus({ ack: true });
|
||||||
|
setUpdateTrigger((prev) => !prev);
|
||||||
|
} catch (error) {
|
||||||
|
createToast({ body: t("checkHooks.failureResolveAll") });
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return [ackAllChecks, isLoading];
|
||||||
|
};
|
||||||
|
|
||||||
|
export {
|
||||||
|
useFetchChecksByMonitor,
|
||||||
|
useFetchChecksTeam,
|
||||||
|
useFetchChecksSummaryByTeamId,
|
||||||
|
useResolveIncident,
|
||||||
|
useAckAllChecks,
|
||||||
|
};
|
||||||
@@ -15,13 +15,17 @@ import PropTypes from "prop-types";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useFetchChecksTeam } from "../../../../Hooks/checkHooks";
|
import { useFetchChecksTeam } from "../../../../Hooks/checkHooks";
|
||||||
import { useFetchChecksByMonitor } from "../../../../Hooks/checkHooks";
|
import { useFetchChecksByMonitor } from "../../../../Hooks/checkHooks";
|
||||||
|
import { useResolveIncident } from "../../../../Hooks/checkHooks";
|
||||||
|
import { Button, Typography } from "@mui/material";
|
||||||
|
|
||||||
const IncidentTable = ({
|
const IncidentTable = ({
|
||||||
shouldRender,
|
isLoading,
|
||||||
monitors,
|
monitors,
|
||||||
selectedMonitor,
|
selectedMonitor,
|
||||||
filter,
|
filter,
|
||||||
dateRange,
|
dateRange,
|
||||||
|
updateTrigger,
|
||||||
|
setUpdateTrigger,
|
||||||
}) => {
|
}) => {
|
||||||
//Redux state
|
//Redux state
|
||||||
const uiTimezone = useSelector((state) => state.ui.timezone);
|
const uiTimezone = useSelector((state) => state.ui.timezone);
|
||||||
@@ -32,6 +36,9 @@ const IncidentTable = ({
|
|||||||
const selectedMonitorDetails = monitors?.[selectedMonitor];
|
const selectedMonitorDetails = monitors?.[selectedMonitor];
|
||||||
const selectedMonitorType = selectedMonitorDetails?.type;
|
const selectedMonitorType = selectedMonitorDetails?.type;
|
||||||
|
|
||||||
|
//Hooks
|
||||||
|
const [resolveIncident, resolveLoading] = useResolveIncident();
|
||||||
|
|
||||||
const [checksMonitor, checksCountMonitor, isLoadingMonitor, networkErrorMonitor] =
|
const [checksMonitor, checksCountMonitor, isLoadingMonitor, networkErrorMonitor] =
|
||||||
useFetchChecksByMonitor({
|
useFetchChecksByMonitor({
|
||||||
monitorId: selectedMonitor === "0" ? undefined : selectedMonitor,
|
monitorId: selectedMonitor === "0" ? undefined : selectedMonitor,
|
||||||
@@ -45,6 +52,7 @@ const IncidentTable = ({
|
|||||||
page: page,
|
page: page,
|
||||||
rowsPerPage: rowsPerPage,
|
rowsPerPage: rowsPerPage,
|
||||||
enabled: selectedMonitor !== "0",
|
enabled: selectedMonitor !== "0",
|
||||||
|
updateTrigger,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [checksTeam, checksCountTeam, isLoadingTeam, networkErrorTeam] =
|
const [checksTeam, checksCountTeam, isLoadingTeam, networkErrorTeam] =
|
||||||
@@ -58,11 +66,12 @@ const IncidentTable = ({
|
|||||||
page: page,
|
page: page,
|
||||||
rowsPerPage: rowsPerPage,
|
rowsPerPage: rowsPerPage,
|
||||||
enabled: selectedMonitor === "0",
|
enabled: selectedMonitor === "0",
|
||||||
|
updateTrigger,
|
||||||
});
|
});
|
||||||
|
|
||||||
const checks = selectedMonitor === "0" ? checksTeam : checksMonitor;
|
const checks = selectedMonitor === "0" ? checksTeam : checksMonitor;
|
||||||
const checksCount = selectedMonitor === "0" ? checksCountTeam : checksCountMonitor;
|
const checksCount = selectedMonitor === "0" ? checksCountTeam : checksCountMonitor;
|
||||||
const isLoading = isLoadingTeam || isLoadingMonitor;
|
isLoading = isLoadingTeam || isLoadingMonitor;
|
||||||
const networkError = selectedMonitor === "0" ? networkErrorTeam : networkErrorMonitor;
|
const networkError = selectedMonitor === "0" ? networkErrorTeam : networkErrorMonitor;
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -76,6 +85,10 @@ const IncidentTable = ({
|
|||||||
setRowsPerPage(event.target.value);
|
setRowsPerPage(event.target.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleResolveIncident = (checkId) => {
|
||||||
|
resolveIncident(checkId, setUpdateTrigger);
|
||||||
|
};
|
||||||
|
|
||||||
const headers = [
|
const headers = [
|
||||||
{
|
{
|
||||||
id: "monitorName",
|
id: "monitorName",
|
||||||
@@ -114,9 +127,31 @@ const IncidentTable = ({
|
|||||||
render: (row) => <HttpStatusLabel status={row.statusCode} />,
|
render: (row) => <HttpStatusLabel status={row.statusCode} />,
|
||||||
},
|
},
|
||||||
{ id: "message", content: t("incidentsTableMessage"), render: (row) => row.message },
|
{ id: "message", content: t("incidentsTableMessage"), render: (row) => row.message },
|
||||||
|
{
|
||||||
|
id: "action",
|
||||||
|
content: t("actions"),
|
||||||
|
render: (row) => {
|
||||||
|
return row.ack === false ? (
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
color="accent"
|
||||||
|
onClick={() => {
|
||||||
|
handleResolveIncident(row._id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("incidentsTableActionResolve")}
|
||||||
|
</Button>
|
||||||
|
) : (
|
||||||
|
<Typography>
|
||||||
|
{t("incidentsTableResolvedAt")}{" "}
|
||||||
|
{formatDateWithTz(row.ackAt, "YYYY-MM-DD HH:mm:ss A", uiTimezone)}
|
||||||
|
</Typography>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
if (!shouldRender || isLoading) return <TableSkeleton />;
|
if (isLoading || resolveLoading) return <TableSkeleton />;
|
||||||
|
|
||||||
if (networkError) {
|
if (networkError) {
|
||||||
return (
|
return (
|
||||||
@@ -149,10 +184,12 @@ const IncidentTable = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
IncidentTable.propTypes = {
|
IncidentTable.propTypes = {
|
||||||
shouldRender: PropTypes.bool,
|
isLoading: PropTypes.bool,
|
||||||
monitors: PropTypes.object,
|
monitors: PropTypes.object,
|
||||||
selectedMonitor: PropTypes.string,
|
selectedMonitor: PropTypes.string,
|
||||||
filter: PropTypes.string,
|
filter: PropTypes.string,
|
||||||
dateRange: PropTypes.string,
|
dateRange: PropTypes.string,
|
||||||
|
updateTrigger: PropTypes.bool,
|
||||||
|
setUpdateTrigger: PropTypes.func,
|
||||||
};
|
};
|
||||||
export default IncidentTable;
|
export default IncidentTable;
|
||||||
@@ -21,6 +21,12 @@ const OptionsHeader = ({
|
|||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const monitorNames = typeof monitors !== "undefined" ? Object.values(monitors) : [];
|
const monitorNames = typeof monitors !== "undefined" ? Object.values(monitors) : [];
|
||||||
|
const filterOptions = [
|
||||||
|
{ _id: "all", name: t("incidentsOptionsHeaderFilterAll") },
|
||||||
|
{ _id: "down", name: t("incidentsOptionsHeaderFilterDown") },
|
||||||
|
{ _id: "resolve", name: t("incidentsOptionsHeaderFilterCannotResolve") },
|
||||||
|
{ _id: "resolved", name: t("incidentsOptionsHeaderFilterResolved") },
|
||||||
|
];
|
||||||
|
|
||||||
// The stacks below which are three in number have the same style so
|
// The stacks below which are three in number have the same style so
|
||||||
const stackStyles = {
|
const stackStyles = {
|
||||||
@@ -65,36 +71,16 @@ const OptionsHeader = ({
|
|||||||
>
|
>
|
||||||
{t("incidentsOptionsHeaderFilterBy")}
|
{t("incidentsOptionsHeaderFilterBy")}
|
||||||
</Typography>
|
</Typography>
|
||||||
<ButtonGroup>
|
<Select
|
||||||
<Button
|
id="incidents-select-filter"
|
||||||
variant="group"
|
value={filter}
|
||||||
filled={(filter === "all").toString()}
|
onChange={(e) => setFilter(e.target.value)}
|
||||||
onClick={() => setFilter("all")}
|
items={filterOptions}
|
||||||
>
|
sx={{
|
||||||
{t("incidentsOptionsHeaderFilterAll")}
|
backgroundColor: theme.palette.primary.main,
|
||||||
</Button>
|
color: theme.palette.primary.contrastTextSecondary,
|
||||||
<Button
|
}}
|
||||||
variant="group"
|
/>
|
||||||
filled={(filter === "down").toString()}
|
|
||||||
onClick={() => setFilter("down")}
|
|
||||||
>
|
|
||||||
{t("incidentsOptionsHeaderFilterDown")}
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
variant="group"
|
|
||||||
filled={(filter === "resolve").toString()}
|
|
||||||
onClick={() => setFilter("resolve")}
|
|
||||||
>
|
|
||||||
{t("incidentsOptionsHeaderFilterCannotResolve")}
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
variant="group"
|
|
||||||
filled={(filter === "resolved").toString()}
|
|
||||||
onClick={() => setFilter("resolved")}
|
|
||||||
>
|
|
||||||
{t("incidentsOptionsHeaderFilterResolved")}
|
|
||||||
</Button>
|
|
||||||
</ButtonGroup>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack {...stackStyles}>
|
<Stack {...stackStyles}>
|
||||||
<Typography
|
<Typography
|
||||||
|
|||||||
@@ -5,11 +5,13 @@ import GenericFallback from "../../Components/GenericFallback";
|
|||||||
import IncidentTable from "./Components/IncidentTable";
|
import IncidentTable from "./Components/IncidentTable";
|
||||||
import OptionsHeader from "./Components/OptionsHeader";
|
import OptionsHeader from "./Components/OptionsHeader";
|
||||||
import StatusBoxes from "./Components/StatusBoxes";
|
import StatusBoxes from "./Components/StatusBoxes";
|
||||||
|
import { Box, Button } from "@mui/material";
|
||||||
|
|
||||||
//Utils
|
//Utils
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useFetchMonitorsByTeamId } from "../../Hooks/monitorHooks";
|
import { useFetchMonitorsByTeamId } from "../../Hooks/monitorHooks";
|
||||||
import { useFetchChecksSummaryByTeamId } from "../../Hooks/checkHooks";
|
import { useFetchChecksSummaryByTeamId } from "../../Hooks/checkHooks";
|
||||||
|
import { useAckAllChecks } from "../../Hooks/checkHooks";
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import NetworkError from "../../Components/GenericFallback/NetworkError";
|
import NetworkError from "../../Components/GenericFallback/NetworkError";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -29,12 +31,17 @@ const Incidents = () => {
|
|||||||
const [filter, setFilter] = useState(undefined);
|
const [filter, setFilter] = useState(undefined);
|
||||||
const [dateRange, setDateRange] = useState(undefined);
|
const [dateRange, setDateRange] = useState(undefined);
|
||||||
const [monitorLookup, setMonitorLookup] = useState(undefined);
|
const [monitorLookup, setMonitorLookup] = useState(undefined);
|
||||||
|
const [updateTrigger, setUpdateTrigger] = useState(false);
|
||||||
|
|
||||||
|
//Hooks
|
||||||
|
const [ackAllChecks, ackAllLoading] = useAckAllChecks();
|
||||||
|
|
||||||
//Utils
|
//Utils
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const [monitors, , isLoading, networkError] = useFetchMonitorsByTeamId({});
|
const [monitors, , isLoading, networkError] = useFetchMonitorsByTeamId({});
|
||||||
const [summary, isLoadingSummary, networkErrorSummary] =
|
const [summary, isLoadingSummary, networkErrorSummary] = useFetchChecksSummaryByTeamId({
|
||||||
useFetchChecksSummaryByTeamId();
|
updateTrigger,
|
||||||
|
});
|
||||||
const { monitorId } = useParams();
|
const { monitorId } = useParams();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -55,6 +62,10 @@ const Incidents = () => {
|
|||||||
setMonitorLookup(monitorLookup);
|
setMonitorLookup(monitorLookup);
|
||||||
}, [monitors]);
|
}, [monitors]);
|
||||||
|
|
||||||
|
const handleAckAllChecks = () => {
|
||||||
|
ackAllChecks(setUpdateTrigger);
|
||||||
|
};
|
||||||
|
|
||||||
if (networkError || networkErrorSummary) {
|
if (networkError || networkErrorSummary) {
|
||||||
return (
|
return (
|
||||||
<GenericFallback>
|
<GenericFallback>
|
||||||
@@ -66,6 +77,16 @@ const Incidents = () => {
|
|||||||
return (
|
return (
|
||||||
<Stack gap={theme.spacing(10)}>
|
<Stack gap={theme.spacing(10)}>
|
||||||
<Breadcrumbs list={BREADCRUMBS} />
|
<Breadcrumbs list={BREADCRUMBS} />
|
||||||
|
<Box alignSelf="flex-end">
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
color="accent"
|
||||||
|
onClick={handleAckAllChecks}
|
||||||
|
disabled={ackAllLoading}
|
||||||
|
>
|
||||||
|
{t("incidentsPageActionResolve")}
|
||||||
|
</Button>
|
||||||
|
</Box>
|
||||||
<StatusBoxes
|
<StatusBoxes
|
||||||
isLoading={isLoadingSummary}
|
isLoading={isLoadingSummary}
|
||||||
summary={summary}
|
summary={summary}
|
||||||
@@ -81,11 +102,13 @@ const Incidents = () => {
|
|||||||
setDateRange={setDateRange}
|
setDateRange={setDateRange}
|
||||||
/>
|
/>
|
||||||
<IncidentTable
|
<IncidentTable
|
||||||
shouldRender={!isLoading}
|
isLoading={isLoading}
|
||||||
monitors={monitorLookup ? monitorLookup : {}}
|
monitors={monitorLookup ? monitorLookup : {}}
|
||||||
selectedMonitor={selectedMonitor}
|
selectedMonitor={selectedMonitor}
|
||||||
filter={filter}
|
filter={filter}
|
||||||
dateRange={dateRange}
|
dateRange={dateRange}
|
||||||
|
updateTrigger={updateTrigger}
|
||||||
|
setUpdateTrigger={setUpdateTrigger}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -631,6 +631,12 @@ class NetworkService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async updateAllChecksStatus(config) {
|
||||||
|
return this.axiosInstance.put(`/checks/team/`, {
|
||||||
|
ack: config.ack,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ************************************
|
* ************************************
|
||||||
* Get all checks for a given user
|
* Get all checks for a given user
|
||||||
|
|||||||
@@ -390,7 +390,10 @@
|
|||||||
"incidentsOptionsHeaderFilterBy": "Filter by:",
|
"incidentsOptionsHeaderFilterBy": "Filter by:",
|
||||||
"incidentsOptionsHeaderTotalIncidents": "Total Incidents",
|
"incidentsOptionsHeaderTotalIncidents": "Total Incidents",
|
||||||
"incidentsOptionsHeaderFilterCannotResolve": "Cannot Resolve",
|
"incidentsOptionsHeaderFilterCannotResolve": "Cannot Resolve",
|
||||||
|
"incidentsTableResolvedAt": "Resolved at",
|
||||||
"incidentsOptionsHeaderFilterDown": "Down",
|
"incidentsOptionsHeaderFilterDown": "Down",
|
||||||
|
"incidentsTableActionResolve": "Resolve",
|
||||||
|
"incidentsPageActionResolve": "Resolve all incidents",
|
||||||
"incidentsOptionsHeaderFilterResolved": "Resolved",
|
"incidentsOptionsHeaderFilterResolved": "Resolved",
|
||||||
"incidentsOptionsHeaderLastDay": "Last day",
|
"incidentsOptionsHeaderLastDay": "Last day",
|
||||||
"incidentsOptionsHeaderLastHour": "Last hour",
|
"incidentsOptionsHeaderLastHour": "Last hour",
|
||||||
@@ -513,6 +516,10 @@
|
|||||||
"monitorStatusUp": "Monitor {name} ({url}) is now UP and responding",
|
"monitorStatusUp": "Monitor {name} ({url}) is now UP and responding",
|
||||||
"monitors": "monitors",
|
"monitors": "monitors",
|
||||||
"monitorsToApply": "Monitors to apply maintenance window to",
|
"monitorsToApply": "Monitors to apply maintenance window to",
|
||||||
|
"checkHooks": {
|
||||||
|
"failureResolveOne": "Failed to resolve incident.",
|
||||||
|
"failureResolveAll": "Failed to resolve all incidents."
|
||||||
|
},
|
||||||
"ms": "ms",
|
"ms": "ms",
|
||||||
"navControls": "Controls",
|
"navControls": "Controls",
|
||||||
"nextWindow": "Next window",
|
"nextWindow": "Next window",
|
||||||
|
|||||||
@@ -10,7 +10,11 @@ const buildChecksSummaryByTeamIdPipeline = ({ matchStage }) => {
|
|||||||
totalChecks: { $sum: { $cond: [{ $eq: ["$status", false] }, 1, 0] } },
|
totalChecks: { $sum: { $cond: [{ $eq: ["$status", false] }, 1, 0] } },
|
||||||
resolvedChecks: {
|
resolvedChecks: {
|
||||||
$sum: {
|
$sum: {
|
||||||
$cond: [{ $eq: ["$ack", true] }, 1, 0],
|
$cond: [
|
||||||
|
{ $and: [{ $eq: ["$ack", true] }, { $eq: ["$status", false] }] },
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
downChecks: {
|
downChecks: {
|
||||||
|
|||||||
Reference in new issue
Block a user