Merge pull request #2061 from nbgslv/feat/statuspages-breadcrumbs
Status Pages breadcrumbs
This commit is contained in:
3 files changed
+27
-2
No files matched your search
@@ -3,6 +3,7 @@ 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 Breadcrumbs from "../../../Components/Breadcrumbs/index.jsx";
|
||||||
//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";
|
||||||
@@ -58,6 +59,19 @@ const CreateStatusPage = () => {
|
|||||||
|
|
||||||
const [statusPage, statusPageMonitors, statusPageIsLoading, statusPageNetworkError] =
|
const [statusPage, statusPageMonitors, statusPageIsLoading, statusPageNetworkError] =
|
||||||
useStatusPageFetch(isCreate, url);
|
useStatusPageFetch(isCreate, url);
|
||||||
|
|
||||||
|
// Breadcrumbs
|
||||||
|
const crumbs = [
|
||||||
|
{ name: t("statusBreadCrumbsStatusPages"), path: "/status" },
|
||||||
|
];
|
||||||
|
if (isCreate) {
|
||||||
|
crumbs.push({ name: t("statusBreadCrumbsCreate"), path: "/status/uptime/create" });
|
||||||
|
} else {
|
||||||
|
crumbs.push(
|
||||||
|
{ name: t("statusBreadCrumbsDetails"), path: `/status/uptime/${statusPage?.url}` },
|
||||||
|
{ name: t("configure"), path: `/status/uptime/configure/${statusPage?.url}` }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Handlers
|
// Handlers
|
||||||
const handleFormChange = (e) => {
|
const handleFormChange = (e) => {
|
||||||
@@ -218,6 +232,7 @@ const CreateStatusPage = () => {
|
|||||||
// Load fields
|
// Load fields
|
||||||
return (
|
return (
|
||||||
<Stack gap={theme.spacing(10)}>
|
<Stack gap={theme.spacing(10)}>
|
||||||
|
<Breadcrumbs list={crumbs} />
|
||||||
<Tabs
|
<Tabs
|
||||||
form={form}
|
form={form}
|
||||||
errors={errors}
|
errors={errors}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ 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 Dialog from "../../../Components/Dialog";
|
||||||
|
import Breadcrumbs from "../../../Components/Breadcrumbs/index.jsx";
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import { useStatusPageFetch } from "./Hooks/useStatusPageFetch";
|
import { useStatusPageFetch } from "./Hooks/useStatusPageFetch";
|
||||||
@@ -32,6 +33,12 @@ const PublicStatus = () => {
|
|||||||
const [statusPage, monitors, isLoading, networkError, fetchStatusPage] =
|
const [statusPage, monitors, isLoading, networkError, fetchStatusPage] =
|
||||||
useStatusPageFetch(false, url);
|
useStatusPageFetch(false, url);
|
||||||
const [deleteStatusPage, isDeleting] = useStatusPageDelete(fetchStatusPage, url);
|
const [deleteStatusPage, isDeleting] = useStatusPageDelete(fetchStatusPage, url);
|
||||||
|
|
||||||
|
// Breadcrumbs
|
||||||
|
const crumbs = [
|
||||||
|
{ name: t("statusBreadCrumbsStatusPages"), path: "/status" },
|
||||||
|
{ name: t("statusBreadCrumbsDetails"), path: `/status/uptime/${statusPage?.url}` },
|
||||||
|
];
|
||||||
|
|
||||||
// Setup
|
// Setup
|
||||||
let sx = { paddingLeft: theme.spacing(20), paddingRight: theme.spacing(20) };
|
let sx = { paddingLeft: theme.spacing(20), paddingRight: theme.spacing(20) };
|
||||||
@@ -123,9 +130,9 @@ const PublicStatus = () => {
|
|||||||
return (
|
return (
|
||||||
<Stack
|
<Stack
|
||||||
gap={theme.spacing(10)}
|
gap={theme.spacing(10)}
|
||||||
alignItems="center"
|
|
||||||
sx={{ ...sx, position: "relative" }}
|
sx={{ ...sx, position: "relative" }}
|
||||||
>
|
>
|
||||||
|
{!isPublic && <Breadcrumbs list={crumbs} />}
|
||||||
<ControlsHeader
|
<ControlsHeader
|
||||||
statusPage={statusPage}
|
statusPage={statusPage}
|
||||||
isDeleting={isDeleting}
|
isDeleting={isDeleting}
|
||||||
|
|||||||
+4
-1
@@ -378,5 +378,8 @@
|
|||||||
"inviteNoTokenFound": "No invite token found",
|
"inviteNoTokenFound": "No invite token found",
|
||||||
"pageSpeedWarning": "Warning: You haven't added a Google PageSpeed API key. Without it, the PageSpeed monitor won't function.",
|
"pageSpeedWarning": "Warning: You haven't added a Google PageSpeed API key. Without it, the PageSpeed monitor won't function.",
|
||||||
"pageSpeedLearnMoreLink": "Click here to learn",
|
"pageSpeedLearnMoreLink": "Click here to learn",
|
||||||
"pageSpeedAddApiKey": "how to add your API key."
|
"pageSpeedAddApiKey": "how to add your API key.",
|
||||||
|
"statusBreadCrumbsDetails": "Details",
|
||||||
|
"statusBreadCrumbsCreate": "Create",
|
||||||
|
"statusBreadCrumbsStatusPages": "Status Pages"
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user