Merge branch 'develop' into fix/placeholder-center-align
This commit is contained in:
commit
4aaa2faf9a
18 files changed
+150
-88
No files matched your search
@@ -50,7 +50,7 @@ Usage instructions can be found [here](https://docs.checkmate.so/checkmate-2.1).
|
|||||||
|
|
||||||
## 🛠️ Installation
|
## 🛠️ Installation
|
||||||
|
|
||||||
See installation instructions in [Checkmate documentation portal](https://docs.checkmate.so/checkmate-2.1/users-guide/quickstart). Alternatively, you can also use [Coolify](https://coolify.io/) or [Elestio](https://elest.io/open-source/checkmate) for a one-click Docker deployment. If you would like to monitor your server infrastructure, you'll need [Capture agent](https://github.com/bluewave-labs/capture). Capture repository also contains the installation instructions.
|
See installation instructions in [Checkmate documentation portal](https://docs.checkmate.so/checkmate-2.1/users-guide/quickstart). Alternatively, you can also use [Coolify](https://coolify.io/), [Elestio](https://elest.io/open-source/checkmate) or [Pikapods](https://www.pikapods.com/) to quickly spin off a Checkmate instance. If you would like to monitor your server infrastructure, you'll need [Capture agent](https://github.com/bluewave-labs/capture). Capture repository also contains the installation instructions.
|
||||||
|
|
||||||
## 🏁 Translations
|
## 🏁 Translations
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import Stack from "@mui/material/Stack";
|
|||||||
import Status from "./status";
|
import Status from "./status";
|
||||||
import Skeleton from "./skeleton";
|
import Skeleton from "./skeleton";
|
||||||
import Button from "@mui/material/Button";
|
import Button from "@mui/material/Button";
|
||||||
|
import { Tooltip } from "@mui/material";
|
||||||
import SettingsOutlinedIcon from "@mui/icons-material/SettingsOutlined";
|
import SettingsOutlinedIcon from "@mui/icons-material/SettingsOutlined";
|
||||||
import PauseOutlinedIcon from "@mui/icons-material/PauseOutlined";
|
import PauseOutlinedIcon from "@mui/icons-material/PauseOutlined";
|
||||||
import PlayArrowOutlinedIcon from "@mui/icons-material/PlayArrowOutlined";
|
import PlayArrowOutlinedIcon from "@mui/icons-material/PlayArrowOutlined";
|
||||||
@@ -40,6 +41,10 @@ const MonitorDetailsControlHeader = ({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [pauseMonitor, isPausing, error] = usePauseMonitor();
|
const [pauseMonitor, isPausing, error] = usePauseMonitor();
|
||||||
|
|
||||||
|
const isTestNotificationsDisabled = monitor?.notifications?.length === 0;
|
||||||
|
|
||||||
|
const tooltipTitle = isTestNotificationsDisabled ? t("testNotificationsDisabled") : "";
|
||||||
|
|
||||||
// const [isSending, emailError, sendTestEmail] = useSendTestEmail();
|
// const [isSending, emailError, sendTestEmail] = useSendTestEmail();
|
||||||
|
|
||||||
const [testAllNotifications, isSending, errorAllNotifications] =
|
const [testAllNotifications, isSending, errorAllNotifications] =
|
||||||
@@ -60,20 +65,29 @@ const MonitorDetailsControlHeader = ({
|
|||||||
direction="row"
|
direction="row"
|
||||||
gap={theme.spacing(2)}
|
gap={theme.spacing(2)}
|
||||||
>
|
>
|
||||||
<Button
|
<Tooltip
|
||||||
variant="contained"
|
key={monitor?._id}
|
||||||
color="secondary"
|
placement="bottom"
|
||||||
loading={isSending}
|
title={tooltipTitle}
|
||||||
startIcon={<EmailIcon />}
|
|
||||||
onClick={() => {
|
|
||||||
testAllNotifications({ monitorId: monitor?._id });
|
|
||||||
}}
|
|
||||||
sx={{
|
|
||||||
whiteSpace: "nowrap",
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{t("sendTestNotifications")}
|
<span>
|
||||||
</Button>
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
color="secondary"
|
||||||
|
loading={isSending}
|
||||||
|
startIcon={<EmailIcon />}
|
||||||
|
disabled={isTestNotificationsDisabled}
|
||||||
|
onClick={() => {
|
||||||
|
testAllNotifications({ monitorId: monitor?._id });
|
||||||
|
}}
|
||||||
|
sx={{
|
||||||
|
whiteSpace: "nowrap",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("sendTestNotifications")}
|
||||||
|
</Button>
|
||||||
|
</span>
|
||||||
|
</Tooltip>
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Components
|
// Components
|
||||||
import { TabContext } from "@mui/lab";
|
import { TabContext } from "@mui/lab";
|
||||||
import { Tab, useTheme } from "@mui/material";
|
import { Tab } from "@mui/material";
|
||||||
import Settings from "./Settings";
|
import Settings from "./Settings";
|
||||||
import Content from "./Content";
|
import Content from "./Content";
|
||||||
|
|
||||||
@@ -22,8 +22,12 @@ const Tabs = ({
|
|||||||
tab,
|
tab,
|
||||||
setTab,
|
setTab,
|
||||||
TAB_LIST,
|
TAB_LIST,
|
||||||
|
handleDelete,
|
||||||
|
isDeleteOpen,
|
||||||
|
setIsDeleteOpen,
|
||||||
|
isDeleting,
|
||||||
|
isLoading,
|
||||||
}) => {
|
}) => {
|
||||||
const theme = useTheme();
|
|
||||||
return (
|
return (
|
||||||
<TabContext value={TAB_LIST[tab]}>
|
<TabContext value={TAB_LIST[tab]}>
|
||||||
<CustomTabList
|
<CustomTabList
|
||||||
@@ -32,7 +36,7 @@ const Tabs = ({
|
|||||||
}}
|
}}
|
||||||
aria-label="status page tabs"
|
aria-label="status page tabs"
|
||||||
>
|
>
|
||||||
{TAB_LIST.map((tabLabel, idx) => (
|
{TAB_LIST.map((tabLabel) => (
|
||||||
<Tab
|
<Tab
|
||||||
key={tabLabel}
|
key={tabLabel}
|
||||||
label={tabLabel}
|
label={tabLabel}
|
||||||
@@ -50,6 +54,11 @@ const Tabs = ({
|
|||||||
removeLogo={removeLogo}
|
removeLogo={removeLogo}
|
||||||
errors={errors}
|
errors={errors}
|
||||||
isCreate={isCreate}
|
isCreate={isCreate}
|
||||||
|
handleDelete={handleDelete}
|
||||||
|
isDeleteOpen={isDeleteOpen}
|
||||||
|
setIsDeleteOpen={setIsDeleteOpen}
|
||||||
|
isDeleting={isDeleting}
|
||||||
|
isLoading={isLoading}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Content
|
<Content
|
||||||
@@ -67,6 +76,7 @@ const Tabs = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
Tabs.propTypes = {
|
Tabs.propTypes = {
|
||||||
|
isCreate: PropTypes.bool,
|
||||||
form: PropTypes.object,
|
form: PropTypes.object,
|
||||||
errors: PropTypes.object,
|
errors: PropTypes.object,
|
||||||
monitors: PropTypes.array,
|
monitors: PropTypes.array,
|
||||||
@@ -79,6 +89,11 @@ Tabs.propTypes = {
|
|||||||
tab: PropTypes.number,
|
tab: PropTypes.number,
|
||||||
setTab: PropTypes.func,
|
setTab: PropTypes.func,
|
||||||
TAB_LIST: PropTypes.array,
|
TAB_LIST: PropTypes.array,
|
||||||
|
handleDelete: PropTypes.func,
|
||||||
|
isDeleteOpen: PropTypes.bool,
|
||||||
|
setIsDeleteOpen: PropTypes.func,
|
||||||
|
isDeleting: PropTypes.bool,
|
||||||
|
isLoading: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Tabs;
|
export default Tabs;
|
||||||
@@ -3,6 +3,8 @@ import { Stack, Button, Typography } from "@mui/material";
|
|||||||
import Tabs from "./Components/Tabs";
|
import Tabs from "./Components/Tabs";
|
||||||
import GenericFallback from "../../../Components/GenericFallback";
|
import GenericFallback from "../../../Components/GenericFallback";
|
||||||
import SkeletonLayout from "./Components/Skeleton";
|
import SkeletonLayout from "./Components/Skeleton";
|
||||||
|
import Dialog from "../../../Components/Dialog";
|
||||||
|
import Breadcrumbs from "../../../Components/Breadcrumbs";
|
||||||
//Utils
|
//Utils
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useState, useEffect, useRef, useCallback } from "react";
|
import { useState, useEffect, useRef, useCallback } from "react";
|
||||||
@@ -15,9 +17,8 @@ import { useNavigate } from "react-router-dom";
|
|||||||
import { useStatusPageFetch } from "../Status/Hooks/useStatusPageFetch";
|
import { useStatusPageFetch } from "../Status/Hooks/useStatusPageFetch";
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { useStatusPageDelete } from "../Status/Hooks/useStatusPageDelete";
|
||||||
//Constants
|
//Constants
|
||||||
const TAB_LIST = ["General settings", "Contents"];
|
|
||||||
|
|
||||||
const ERROR_TAB_MAPPING = [
|
const ERROR_TAB_MAPPING = [
|
||||||
["companyName", "url", "timezone", "color", "isPublished", "logo"],
|
["companyName", "url", "timezone", "color", "isPublished", "logo"],
|
||||||
["monitors", "showUptimePercentage", "showCharts", "showAdminLoginLink"],
|
["monitors", "showUptimePercentage", "showCharts", "showAdminLoginLink"],
|
||||||
@@ -28,6 +29,7 @@ const CreateStatusPage = () => {
|
|||||||
//Local state
|
//Local state
|
||||||
const [tab, setTab] = useState(0);
|
const [tab, setTab] = useState(0);
|
||||||
const [progress, setProgress] = useState({ value: 0, isLoading: false });
|
const [progress, setProgress] = useState({ value: 0, isLoading: false });
|
||||||
|
const [isDeleteOpen, setIsDeleteOpen] = useState(false);
|
||||||
const [form, setForm] = useState({
|
const [form, setForm] = useState({
|
||||||
isPublished: false,
|
isPublished: false,
|
||||||
companyName: "",
|
companyName: "",
|
||||||
@@ -52,13 +54,13 @@ const CreateStatusPage = () => {
|
|||||||
//Utils
|
//Utils
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const [monitors, isLoading, networkError] = useMonitorsFetch();
|
const [monitors, isLoading, networkError] = useMonitorsFetch();
|
||||||
const [createStatusPage, createStatusIsLoading, createStatusPageNetworkError] =
|
const [createStatusPage] = useCreateStatusPage(isCreate);
|
||||||
useCreateStatusPage(isCreate);
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const [statusPage, statusPageMonitors, statusPageIsLoading, statusPageNetworkError] =
|
const [statusPage, statusPageMonitors, statusPageIsLoading, , fetchStatusPage] =
|
||||||
useStatusPageFetch(isCreate, url);
|
useStatusPageFetch(isCreate, url);
|
||||||
|
const [deleteStatusPage, isDeleting] = useStatusPageDelete(fetchStatusPage, url);
|
||||||
|
|
||||||
console.log(JSON.stringify(form, null, 2));
|
console.log(JSON.stringify(form, null, 2));
|
||||||
// Handlers
|
// Handlers
|
||||||
@@ -124,6 +126,19 @@ const CreateStatusPage = () => {
|
|||||||
setProgress({ value: 0, isLoading: false });
|
setProgress({ value: 0, isLoading: false });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle status page deletion with optimistic UI update
|
||||||
|
* Immediately navigates away without waiting for the deletion to complete
|
||||||
|
* to prevent unnecessary network requests for the deleted page
|
||||||
|
*/
|
||||||
|
const handleDelete = async () => {
|
||||||
|
setIsDeleteOpen(false);
|
||||||
|
// Start deletion process but don't wait for it
|
||||||
|
deleteStatusPage();
|
||||||
|
// Immediately navigate away to prevent additional fetches for the deleted page
|
||||||
|
navigate("/status");
|
||||||
|
};
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
let toSubmit = {
|
let toSubmit = {
|
||||||
...form,
|
...form,
|
||||||
@@ -137,9 +152,7 @@ const CreateStatusPage = () => {
|
|||||||
const success = await createStatusPage({ form });
|
const success = await createStatusPage({ form });
|
||||||
if (success) {
|
if (success) {
|
||||||
createToast({
|
createToast({
|
||||||
body: isCreate
|
body: isCreate ? t("statusPage.createSuccess") : t("statusPage.updateSuccess"),
|
||||||
? "Status page created successfully"
|
|
||||||
: "Status page updated successfully",
|
|
||||||
});
|
});
|
||||||
navigate(`/status/uptime/${form.url}`);
|
navigate(`/status/uptime/${form.url}`);
|
||||||
}
|
}
|
||||||
@@ -162,7 +175,7 @@ const CreateStatusPage = () => {
|
|||||||
|
|
||||||
// If we get -1, there's an unknown error
|
// If we get -1, there's an unknown error
|
||||||
if (errorTabs[0] === -1) {
|
if (errorTabs[0] === -1) {
|
||||||
createToast({ body: "Unknown error" });
|
createToast({ body: t("common.toasts.unknownError") });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,6 +236,37 @@ const CreateStatusPage = () => {
|
|||||||
// Load fields
|
// Load fields
|
||||||
return (
|
return (
|
||||||
<Stack gap={theme.spacing(10)}>
|
<Stack gap={theme.spacing(10)}>
|
||||||
|
<Breadcrumbs
|
||||||
|
list={[
|
||||||
|
{ name: t("statusBreadCrumbsStatusPages", "Status"), path: "/status" },
|
||||||
|
{ name: t("statusBreadCrumbsDetails", "Details"), path: `/status/${url}` },
|
||||||
|
{ name: t("configure", "Configure"), path: `/status/create/${url}` },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
{!isCreate && (
|
||||||
|
<Stack
|
||||||
|
direction="row"
|
||||||
|
justifyContent="flex-end"
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
loading={isDeleting}
|
||||||
|
variant="contained"
|
||||||
|
color="error"
|
||||||
|
onClick={() => setIsDeleteOpen(true)}
|
||||||
|
>
|
||||||
|
{t("remove")}
|
||||||
|
</Button>
|
||||||
|
<Dialog
|
||||||
|
title={t("deleteStatusPage")}
|
||||||
|
onConfirm={handleDelete}
|
||||||
|
onCancel={() => setIsDeleteOpen(false)}
|
||||||
|
open={isDeleteOpen}
|
||||||
|
confirmationButtonLabel={t("deleteStatusPageConfirm")}
|
||||||
|
description={t("deleteStatusPageDescription")}
|
||||||
|
isLoading={isDeleting || statusPageIsLoading}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
)}
|
||||||
<Tabs
|
<Tabs
|
||||||
form={form}
|
form={form}
|
||||||
errors={errors}
|
errors={errors}
|
||||||
@@ -235,8 +279,16 @@ const CreateStatusPage = () => {
|
|||||||
removeLogo={removeLogo}
|
removeLogo={removeLogo}
|
||||||
tab={tab}
|
tab={tab}
|
||||||
setTab={setTab}
|
setTab={setTab}
|
||||||
TAB_LIST={TAB_LIST}
|
TAB_LIST={[
|
||||||
|
t("statusPage.generalSettings", "General settings"),
|
||||||
|
t("statusPage.contents", "Contents"),
|
||||||
|
]}
|
||||||
isCreate={isCreate}
|
isCreate={isCreate}
|
||||||
|
handleDelete={handleDelete}
|
||||||
|
isDeleteOpen={isDeleteOpen}
|
||||||
|
setIsDeleteOpen={setIsDeleteOpen}
|
||||||
|
isDeleting={isDeleting}
|
||||||
|
isLoading={statusPageIsLoading}
|
||||||
/>
|
/>
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { useLocation } from "react-router-dom";
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
const Controls = ({ isDeleteOpen, setIsDeleteOpen, isDeleting, url, type }) => {
|
const Controls = ({ url, type }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
@@ -27,16 +27,6 @@ const Controls = ({ isDeleteOpen, setIsDeleteOpen, isDeleting, url, type }) => {
|
|||||||
direction="row"
|
direction="row"
|
||||||
gap={theme.spacing(2)}
|
gap={theme.spacing(2)}
|
||||||
>
|
>
|
||||||
<Box>
|
|
||||||
<Button
|
|
||||||
variant="contained"
|
|
||||||
color="error"
|
|
||||||
onClick={() => setIsDeleteOpen(!isDeleteOpen)}
|
|
||||||
loading={isDeleting}
|
|
||||||
>
|
|
||||||
{t("delete")}
|
|
||||||
</Button>
|
|
||||||
</Box>
|
|
||||||
<Box>
|
<Box>
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
@@ -65,21 +55,10 @@ const Controls = ({ isDeleteOpen, setIsDeleteOpen, isDeleting, url, type }) => {
|
|||||||
|
|
||||||
Controls.propTypes = {
|
Controls.propTypes = {
|
||||||
type: PropTypes.string,
|
type: PropTypes.string,
|
||||||
isDeleting: PropTypes.bool,
|
|
||||||
url: PropTypes.string,
|
url: PropTypes.string,
|
||||||
isDeleteOpen: PropTypes.bool.isRequired,
|
|
||||||
setIsDeleteOpen: PropTypes.func.isRequired,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const ControlsHeader = ({
|
const ControlsHeader = ({ statusPage, isPublic, url, type = "uptime" }) => {
|
||||||
statusPage,
|
|
||||||
isPublic,
|
|
||||||
isDeleting,
|
|
||||||
isDeleteOpen,
|
|
||||||
setIsDeleteOpen,
|
|
||||||
url,
|
|
||||||
type = "uptime",
|
|
||||||
}) => {
|
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const publicUrl = `/status/uptime/public/${url}`;
|
const publicUrl = `/status/uptime/public/${url}`;
|
||||||
@@ -137,9 +116,6 @@ const ControlsHeader = ({
|
|||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
<Controls
|
<Controls
|
||||||
isDeleting={isDeleting}
|
|
||||||
isDeleteOpen={isDeleteOpen}
|
|
||||||
setIsDeleteOpen={setIsDeleteOpen}
|
|
||||||
url={url}
|
url={url}
|
||||||
type={type}
|
type={type}
|
||||||
/>
|
/>
|
||||||
@@ -152,9 +128,6 @@ ControlsHeader.propTypes = {
|
|||||||
url: PropTypes.string,
|
url: PropTypes.string,
|
||||||
statusPage: PropTypes.object,
|
statusPage: PropTypes.object,
|
||||||
isPublic: PropTypes.bool,
|
isPublic: PropTypes.bool,
|
||||||
isDeleting: PropTypes.bool,
|
|
||||||
isDeleteOpen: PropTypes.bool.isRequired,
|
|
||||||
setIsDeleteOpen: PropTypes.func.isRequired,
|
|
||||||
type: PropTypes.string,
|
type: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,35 @@
|
|||||||
import { useSelector } from "react-redux";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { networkService } from "../../../../main";
|
import { networkService } from "../../../../Utils/NetworkService";
|
||||||
import { createToast } from "../../../../Utils/toastUtils";
|
import { createToast } from "../../../../Utils/toastUtils";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hook for deleting a status page with optimistic UI update
|
||||||
|
* @param {Function} fetchStatusPage - Function to fetch status page data
|
||||||
|
* @param {string} url - URL of the status page
|
||||||
|
* @returns {Array} - [deleteStatusPage function, isLoading state]
|
||||||
|
*/
|
||||||
const useStatusPageDelete = (fetchStatusPage, url) => {
|
const useStatusPageDelete = (fetchStatusPage, url) => {
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a status page with optimistic UI update
|
||||||
|
* @returns {Promise<boolean>} - Success status
|
||||||
|
*/
|
||||||
const deleteStatusPage = async () => {
|
const deleteStatusPage = async () => {
|
||||||
|
// We don't need to call fetchStatusPage after deletion
|
||||||
|
// This prevents the 404 error when trying to fetch a deleted status page
|
||||||
try {
|
try {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
await networkService.deleteStatusPage({ url });
|
await networkService.deleteStatusPage({ url });
|
||||||
fetchStatusPage?.();
|
createToast({
|
||||||
|
body: t("statusPage.deleteSuccess", "Status page deleted successfully"),
|
||||||
|
});
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
createToast({
|
createToast({
|
||||||
body: error.message,
|
body: t("statusPage.deleteFailed", "Failed to delete status page"),
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import ControlsHeader from "./Components/ControlsHeader";
|
|||||||
import SkeletonLayout from "./Components/Skeleton";
|
import SkeletonLayout from "./Components/Skeleton";
|
||||||
import StatusBar from "./Components/StatusBar";
|
import StatusBar from "./Components/StatusBar";
|
||||||
import MonitorsList from "./Components/MonitorsList";
|
import MonitorsList from "./Components/MonitorsList";
|
||||||
import Dialog from "../../../Components/Dialog";
|
|
||||||
import Breadcrumbs from "../../../Components/Breadcrumbs/index.jsx";
|
import Breadcrumbs from "../../../Components/Breadcrumbs/index.jsx";
|
||||||
import TextLink from "../../../Components/TextLink";
|
import TextLink from "../../../Components/TextLink";
|
||||||
|
|
||||||
@@ -15,27 +14,19 @@ import { useStatusPageFetch } from "./Hooks/useStatusPageFetch";
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useIsAdmin } from "../../../Hooks/useIsAdmin";
|
import { useIsAdmin } from "../../../Hooks/useIsAdmin";
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
import { useStatusPageDelete } from "./Hooks/useStatusPageDelete";
|
|
||||||
import { useState } from "react";
|
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import { useNavigate } from "react-router-dom";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
const PublicStatus = () => {
|
const PublicStatus = () => {
|
||||||
const { url } = useParams();
|
const { url } = useParams();
|
||||||
|
|
||||||
// Local state
|
|
||||||
const [isDeleteOpen, setIsDeleteOpen] = useState(false);
|
|
||||||
// Utils
|
// Utils
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const navigate = useNavigate();
|
|
||||||
const isAdmin = useIsAdmin();
|
const isAdmin = useIsAdmin();
|
||||||
|
|
||||||
const [statusPage, monitors, isLoading, networkError, fetchStatusPage] =
|
const [statusPage, monitors, isLoading, networkError] = useStatusPageFetch(false, url);
|
||||||
useStatusPageFetch(false, url);
|
|
||||||
const [deleteStatusPage, isDeleting] = useStatusPageDelete(fetchStatusPage, url);
|
|
||||||
|
|
||||||
// Breadcrumbs
|
// Breadcrumbs
|
||||||
const crumbs = [
|
const crumbs = [
|
||||||
@@ -158,9 +149,6 @@ const PublicStatus = () => {
|
|||||||
{!isPublic && <Breadcrumbs list={crumbs} />}
|
{!isPublic && <Breadcrumbs list={crumbs} />}
|
||||||
<ControlsHeader
|
<ControlsHeader
|
||||||
statusPage={statusPage}
|
statusPage={statusPage}
|
||||||
isDeleting={isDeleting}
|
|
||||||
isDeleteOpen={isDeleteOpen}
|
|
||||||
setIsDeleteOpen={setIsDeleteOpen}
|
|
||||||
url={url}
|
url={url}
|
||||||
isPublic={isPublic}
|
isPublic={isPublic}
|
||||||
/>
|
/>
|
||||||
@@ -168,21 +156,6 @@ const PublicStatus = () => {
|
|||||||
<StatusBar monitors={monitors} />
|
<StatusBar monitors={monitors} />
|
||||||
<MonitorsList monitors={monitors} />
|
<MonitorsList monitors={monitors} />
|
||||||
{link}
|
{link}
|
||||||
<Dialog
|
|
||||||
title={t("deleteStatusPage")}
|
|
||||||
onConfirm={() => {
|
|
||||||
deleteStatusPage();
|
|
||||||
setIsDeleteOpen(false);
|
|
||||||
navigate("/status");
|
|
||||||
}}
|
|
||||||
onCancel={() => {
|
|
||||||
setIsDeleteOpen(false);
|
|
||||||
}}
|
|
||||||
open={isDeleteOpen}
|
|
||||||
confirmationButtonLabel={t("deleteStatusPageConfirm")}
|
|
||||||
description={t("deleteStatusPageDescription")}
|
|
||||||
isLoading={isDeleting || isLoading}
|
|
||||||
/>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -690,6 +690,7 @@
|
|||||||
},
|
},
|
||||||
"advancedMatching": "",
|
"advancedMatching": "",
|
||||||
"sendTestNotifications": "",
|
"sendTestNotifications": "",
|
||||||
|
"testNotificationsDisabled": "",
|
||||||
"selectAll": "",
|
"selectAll": "",
|
||||||
"showAdminLoginLink": "",
|
"showAdminLoginLink": "",
|
||||||
"logsPage": {
|
"logsPage": {
|
||||||
|
|||||||
@@ -690,6 +690,7 @@
|
|||||||
},
|
},
|
||||||
"advancedMatching": "",
|
"advancedMatching": "",
|
||||||
"sendTestNotifications": "",
|
"sendTestNotifications": "",
|
||||||
|
"testNotificationsDisabled": "",
|
||||||
"selectAll": "",
|
"selectAll": "",
|
||||||
"showAdminLoginLink": "",
|
"showAdminLoginLink": "",
|
||||||
"logsPage": {
|
"logsPage": {
|
||||||
|
|||||||
@@ -690,6 +690,7 @@
|
|||||||
},
|
},
|
||||||
"advancedMatching": "",
|
"advancedMatching": "",
|
||||||
"sendTestNotifications": "",
|
"sendTestNotifications": "",
|
||||||
|
"testNotificationsDisabled": "",
|
||||||
"selectAll": "",
|
"selectAll": "",
|
||||||
"showAdminLoginLink": "",
|
"showAdminLoginLink": "",
|
||||||
"logsPage": {
|
"logsPage": {
|
||||||
|
|||||||
@@ -802,6 +802,14 @@
|
|||||||
"statusPageStatusNoPage": "There's no status page here.",
|
"statusPageStatusNoPage": "There's no status page here.",
|
||||||
"statusPageStatusNotPublic": "This status page is not public.",
|
"statusPageStatusNotPublic": "This status page is not public.",
|
||||||
"statusPageStatusServiceStatus": "Service status",
|
"statusPageStatusServiceStatus": "Service status",
|
||||||
|
"statusPage": {
|
||||||
|
"deleteSuccess": "Status page deleted successfully",
|
||||||
|
"deleteFailed": "Failed to delete status page",
|
||||||
|
"createSuccess": "Status page created successfully",
|
||||||
|
"updateSuccess": "Status page updated successfully",
|
||||||
|
"generalSettings": "General settings",
|
||||||
|
"contents": "Contents"
|
||||||
|
},
|
||||||
"submit": "Submit",
|
"submit": "Submit",
|
||||||
"teamPanel": {
|
"teamPanel": {
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
@@ -827,6 +835,7 @@
|
|||||||
"teamMembers": "Team members"
|
"teamMembers": "Team members"
|
||||||
},
|
},
|
||||||
"testLocale": "testLocale",
|
"testLocale": "testLocale",
|
||||||
|
"testNotificationsDisabled": "There are no notifications setup for this monitor. You need to add one by clicking 'Configure' button",
|
||||||
"timeZoneInfo": "All dates and times are in GMT+0 time zone.",
|
"timeZoneInfo": "All dates and times are in GMT+0 time zone.",
|
||||||
"timezone": "Timezone",
|
"timezone": "Timezone",
|
||||||
"title": "Title",
|
"title": "Title",
|
||||||
|
|||||||
@@ -690,6 +690,7 @@
|
|||||||
},
|
},
|
||||||
"advancedMatching": "",
|
"advancedMatching": "",
|
||||||
"sendTestNotifications": "",
|
"sendTestNotifications": "",
|
||||||
|
"testNotificationsDisabled": "",
|
||||||
"selectAll": "",
|
"selectAll": "",
|
||||||
"showAdminLoginLink": "",
|
"showAdminLoginLink": "",
|
||||||
"logsPage": {
|
"logsPage": {
|
||||||
|
|||||||
@@ -690,6 +690,7 @@
|
|||||||
},
|
},
|
||||||
"advancedMatching": "",
|
"advancedMatching": "",
|
||||||
"sendTestNotifications": "",
|
"sendTestNotifications": "",
|
||||||
|
"testNotificationsDisabled": "",
|
||||||
"selectAll": "",
|
"selectAll": "",
|
||||||
"showAdminLoginLink": "",
|
"showAdminLoginLink": "",
|
||||||
"logsPage": {
|
"logsPage": {
|
||||||
|
|||||||
@@ -690,6 +690,7 @@
|
|||||||
},
|
},
|
||||||
"advancedMatching": "",
|
"advancedMatching": "",
|
||||||
"sendTestNotifications": "",
|
"sendTestNotifications": "",
|
||||||
|
"testNotificationsDisabled": "",
|
||||||
"selectAll": "",
|
"selectAll": "",
|
||||||
"showAdminLoginLink": "",
|
"showAdminLoginLink": "",
|
||||||
"logsPage": {
|
"logsPage": {
|
||||||
|
|||||||
@@ -690,6 +690,7 @@
|
|||||||
},
|
},
|
||||||
"advancedMatching": "",
|
"advancedMatching": "",
|
||||||
"sendTestNotifications": "",
|
"sendTestNotifications": "",
|
||||||
|
"testNotificationsDisabled": "",
|
||||||
"selectAll": "",
|
"selectAll": "",
|
||||||
"showAdminLoginLink": "",
|
"showAdminLoginLink": "",
|
||||||
"logsPage": {
|
"logsPage": {
|
||||||
|
|||||||
@@ -690,6 +690,7 @@
|
|||||||
},
|
},
|
||||||
"advancedMatching": "",
|
"advancedMatching": "",
|
||||||
"sendTestNotifications": "",
|
"sendTestNotifications": "",
|
||||||
|
"testNotificationsDisabled": "",
|
||||||
"selectAll": "",
|
"selectAll": "",
|
||||||
"showAdminLoginLink": "",
|
"showAdminLoginLink": "",
|
||||||
"logsPage": {
|
"logsPage": {
|
||||||
|
|||||||
@@ -690,6 +690,7 @@
|
|||||||
},
|
},
|
||||||
"advancedMatching": "",
|
"advancedMatching": "",
|
||||||
"sendTestNotifications": "Bildirimleri dene",
|
"sendTestNotifications": "Bildirimleri dene",
|
||||||
|
"testNotificationsDisabled": "",
|
||||||
"selectAll": "Tümünü seç",
|
"selectAll": "Tümünü seç",
|
||||||
"showAdminLoginLink": "",
|
"showAdminLoginLink": "",
|
||||||
"logsPage": {
|
"logsPage": {
|
||||||
|
|||||||
@@ -690,6 +690,7 @@
|
|||||||
},
|
},
|
||||||
"advancedMatching": "",
|
"advancedMatching": "",
|
||||||
"sendTestNotifications": "",
|
"sendTestNotifications": "",
|
||||||
|
"testNotificationsDisabled": "",
|
||||||
"selectAll": "",
|
"selectAll": "",
|
||||||
"showAdminLoginLink": "",
|
"showAdminLoginLink": "",
|
||||||
"logsPage": {
|
"logsPage": {
|
||||||
|
|||||||
Reference in new issue
Block a user