Added Public Link Button on Status Page if published
This commit is contained in:
1 parent
d44d733dfd
commit
cb113f642a
3 files changed
+29
-1
No files matched your search
@@ -3,6 +3,7 @@ import { Box, Stack, Typography, Button } from "@mui/material";
|
|||||||
import Image from "../../../../../Components/Image";
|
import Image from "../../../../../Components/Image";
|
||||||
import SettingsIcon from "../../../../../assets/icons/settings-bold.svg?react";
|
import SettingsIcon from "../../../../../assets/icons/settings-bold.svg?react";
|
||||||
import ThemeSwitch from "../../../../../Components/ThemeSwitch";
|
import ThemeSwitch from "../../../../../Components/ThemeSwitch";
|
||||||
|
import ArrowOutwardIcon from "@mui/icons-material/ArrowOutward";
|
||||||
//Utils
|
//Utils
|
||||||
import { useTheme } from "@mui/material/styles";
|
import { useTheme } from "@mui/material/styles";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
@@ -86,6 +87,11 @@ const ControlsHeader = ({
|
|||||||
type = "uptime",
|
type = "uptime",
|
||||||
}) => {
|
}) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const publicUrl =
|
||||||
|
type === "uptime"
|
||||||
|
? `/status/uptime/public/${url}`
|
||||||
|
: `/status/distributed/public/${url}`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack
|
<Stack
|
||||||
@@ -118,6 +124,26 @@ const ControlsHeader = ({
|
|||||||
>
|
>
|
||||||
{statusPage?.companyName}
|
{statusPage?.companyName}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
{statusPage?.isPublished && !isPublic && (
|
||||||
|
<Stack
|
||||||
|
direction="row"
|
||||||
|
alignItems="center"
|
||||||
|
justifyContent="center"
|
||||||
|
onClick={() => {
|
||||||
|
window.open(publicUrl, "_blank", "noopener,noreferrer");
|
||||||
|
}}
|
||||||
|
sx={{
|
||||||
|
display: "inline-flex",
|
||||||
|
":hover": {
|
||||||
|
cursor: "pointer",
|
||||||
|
borderBottom: 1,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Typography>{t("publicLink")}</Typography>
|
||||||
|
<ArrowOutwardIcon />
|
||||||
|
</Stack>
|
||||||
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
<Controls
|
<Controls
|
||||||
isDeleting={isDeleting}
|
isDeleting={isDeleting}
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ const PublicStatus = () => {
|
|||||||
isDeleteOpen={isDeleteOpen}
|
isDeleteOpen={isDeleteOpen}
|
||||||
setIsDeleteOpen={setIsDeleteOpen}
|
setIsDeleteOpen={setIsDeleteOpen}
|
||||||
url={url}
|
url={url}
|
||||||
|
isPublic={isPublic}
|
||||||
/>
|
/>
|
||||||
<Typography variant="h2">{t("statusPageStatusServiceStatus")}</Typography>
|
<Typography variant="h2">{t("statusPageStatusServiceStatus")}</Typography>
|
||||||
<StatusBar monitors={monitors} />
|
<StatusBar monitors={monitors} />
|
||||||
|
|||||||
@@ -410,5 +410,6 @@
|
|||||||
"validationFailed": "Validation failed",
|
"validationFailed": "Validation failed",
|
||||||
"noFileSelected": "No file selected",
|
"noFileSelected": "No file selected",
|
||||||
"fallbackPage": "Import a file to upload a list of servers in bulk"
|
"fallbackPage": "Import a file to upload a list of servers in bulk"
|
||||||
}
|
},
|
||||||
|
"publicLink": "Public Link"
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user