Merge latest changes from develop branch

This commit is contained in:
mohadeseh safari committed 2025-05-12 11:27:08 -04:00
commit ef911731d6
47 files changed
+1699 -1245

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@ Fixes #123
const { t } = useTranslation(); const { t } = useTranslation();
<div>{t('add')}</div> <div>{t('add')}</div>
``` ```
- [ ] The issue I am working on is assigned to me. - [ ] I have **not** included any files that are not related to my pull request, including package-lock and package-json if dependencies have not changed
- [ ] I didn't use any hardcoded values (otherwise it will not scale, and will make it difficult to maintain consistency across the application). - [ ] I didn't use any hardcoded values (otherwise it will not scale, and will make it difficult to maintain consistency across the application).
- [ ] I made sure font sizes, color choices etc are all referenced from the theme. I have no hardcoded dimensions. - [ ] I made sure font sizes, color choices etc are all referenced from the theme. I have no hardcoded dimensions.
- [ ] My PR is granular and targeted to one specific feature. - [ ] My PR is granular and targeted to one specific feature.
@@ -156,7 +156,7 @@ const Select = ({
}; };
Select.propTypes = { Select.propTypes = {
id: PropTypes.string.isRequired, id: PropTypes.string,
name: PropTypes.string, name: PropTypes.string,
label: PropTypes.string, label: PropTypes.string,
placeholder: PropTypes.string, placeholder: PropTypes.string,
@@ -141,9 +141,9 @@ TextInput.displayName = "TextInput";
TextInput.propTypes = { TextInput.propTypes = {
type: PropTypes.string, type: PropTypes.string,
id: PropTypes.string.isRequired, id: PropTypes.string,
name: PropTypes.string, name: PropTypes.string,
value: PropTypes.string, value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
placeholder: PropTypes.string, placeholder: PropTypes.string,
isRequired: PropTypes.bool, isRequired: PropTypes.bool,
isOptional: PropTypes.bool, isOptional: PropTypes.bool,
@@ -6,7 +6,7 @@ import { useTheme } from "@emotion/react";
const CreateMonitorHeader = ({ const CreateMonitorHeader = ({
isAdmin, isAdmin,
label = "Create new", label,
isLoading = true, isLoading = true,
path, path,
bulkPath, bulkPath,
@@ -14,6 +14,8 @@ const CreateMonitorHeader = ({
const navigate = useNavigate(); const navigate = useNavigate();
const { t } = useTranslation(); const { t } = useTranslation();
const theme = useTheme(); const theme = useTheme();
// Use the provided label or fall back to the translated default
if (!isAdmin) return null; if (!isAdmin) return null;
@@ -30,7 +32,7 @@ const CreateMonitorHeader = ({
color="accent" color="accent"
onClick={() => navigate(path)} onClick={() => navigate(path)}
> >
{label} {label || t("createNew")}
</Button> </Button>
{bulkPath && ( {bulkPath && (
<Button <Button
+28 -20
View File
@@ -52,42 +52,42 @@ import { clearAuthState } from "../../Features/Auth/authSlice";
import { toggleSidebar } from "../../Features/UI/uiSlice"; import { toggleSidebar } from "../../Features/UI/uiSlice";
import { clearUptimeMonitorState } from "../../Features/UptimeMonitors/uptimeMonitorsSlice"; import { clearUptimeMonitorState } from "../../Features/UptimeMonitors/uptimeMonitorsSlice";
const menu = [ const getMenu = (t) => [
{ name: "Uptime", path: "uptime", icon: <Monitors /> }, { name: t("menu.uptime"), path: "uptime", icon: <Monitors /> },
{ name: "Pagespeed", path: "pagespeed", icon: <PageSpeed /> }, { name: t("menu.pagespeed"), path: "pagespeed", icon: <PageSpeed /> },
{ name: "Infrastructure", path: "infrastructure", icon: <Integrations /> }, { name: t("menu.infrastructure"), path: "infrastructure", icon: <Integrations /> },
{ {
name: "Distributed uptime", name: t("menu.distributedUptime"),
path: "distributed-uptime", path: "distributed-uptime",
icon: <DistributedUptimeIcon />, icon: <DistributedUptimeIcon />,
}, },
{ name: "Incidents", path: "incidents", icon: <Incidents /> }, { name: t("menu.incidents"), path: "incidents", icon: <Incidents /> },
{ name: "Status pages", path: "status", icon: <StatusPages /> }, { name: t("menu.statusPages"), path: "status", icon: <StatusPages /> },
{ name: "Maintenance", path: "maintenance", icon: <Maintenance /> }, { name: t("menu.maintenance"), path: "maintenance", icon: <Maintenance /> },
// { name: "Integrations", path: "integrations", icon: <Integrations /> }, // { name: t("menu.integrations"), path: "integrations", icon: <Integrations /> },
{ {
name: "Settings", name: t("menu.settings"),
icon: <Settings />, icon: <Settings />,
path: "settings", path: "settings",
}, },
]; ];
const otherMenuItems = [ const getOtherMenuItems = (t) => [
{ name: "Support", path: "support", icon: <Support /> }, { name: t("menu.support"), path: "support", icon: <Support /> },
{ {
name: "Discussions", name: t("menu.discussions"),
path: "discussions", path: "discussions",
icon: <Discussions />, icon: <Discussions />,
}, },
{ name: "Docs", path: "docs", icon: <Docs /> }, { name: t("menu.docs"), path: "docs", icon: <Docs /> },
{ name: "Changelog", path: "changelog", icon: <ChangeLog /> }, { name: t("menu.changelog"), path: "changelog", icon: <ChangeLog /> },
]; ];
const accountMenuItems = [ const getAccountMenuItems = (t) => [
{ name: "Profile", path: "account/profile", icon: <UserSvg /> }, { name: t("menu.profile"), path: "account/profile", icon: <UserSvg /> },
{ name: "Password", path: "account/password", icon: <LockSvg /> }, { name: t("menu.password"), path: "account/password", icon: <LockSvg /> },
{ name: "Team", path: "account/team", icon: <TeamSvg /> }, { name: t("menu.team"), path: "account/team", icon: <TeamSvg /> },
]; ];
/* TODO this could be a key in nested Path would be the link */ /* TODO this could be a key in nested Path would be the link */
@@ -121,6 +121,10 @@ function Sidebar() {
const dispatch = useDispatch(); const dispatch = useDispatch();
const { t } = useTranslation(); const { t } = useTranslation();
const authState = useSelector((state) => state.auth); const authState = useSelector((state) => state.auth);
const menu = getMenu(t);
const otherMenuItems = getOtherMenuItems(t);
const accountMenuItems = getAccountMenuItems(t);
const collapsed = useSelector((state) => state.ui.sidebar.collapsed); const collapsed = useSelector((state) => state.ui.sidebar.collapsed);
const [open, setOpen] = useState({ Dashboard: false, Account: false, Other: false }); const [open, setOpen] = useState({ Dashboard: false, Account: false, Other: false });
const [anchorEl, setAnchorEl] = useState(null); const [anchorEl, setAnchorEl] = useState(null);
@@ -728,7 +732,11 @@ function Sidebar() {
{authState.user?.firstName} {authState.user?.lastName} {authState.user?.firstName} {authState.user?.lastName}
</Typography> </Typography>
<Typography sx={{ textTransform: "capitalize" }}> <Typography sx={{ textTransform: "capitalize" }}>
{authState.user?.role} {authState.user?.role?.includes("superadmin") ? t("roles.superAdmin") :
authState.user?.role?.includes("admin") ? t("roles.admin") :
authState.user?.role?.includes("user") ? t("roles.teamMember") :
authState.user?.role?.includes("demo") ? t("roles.demoUser") :
authState.user?.role}
</Typography> </Typography>
</Box> </Box>
<Stack <Stack
@@ -2,11 +2,11 @@ import { useTheme } from "@emotion/react";
import TabPanel from "@mui/lab/TabPanel"; import TabPanel from "@mui/lab/TabPanel";
import { Button, ButtonGroup, Stack, Typography } from "@mui/material"; import { Button, ButtonGroup, Stack, Typography } from "@mui/material";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import TextInput from "../../Inputs/TextInput"; import TextInput from "../../Inputs/TextInput";
import { credentials } from "../../../Validation/validation"; import { credentials } from "../../../Validation/validation";
import { networkService } from "../../../main"; import { networkService } from "../../../main";
import { createToast } from "../../../Utils/toastUtils"; import { createToast } from "../../../Utils/toastUtils";
import { useSelector } from "react-redux";
import Select from "../../Inputs/Select"; import Select from "../../Inputs/Select";
import { GenericDialog } from "../../Dialog/genericDialog"; import { GenericDialog } from "../../Dialog/genericDialog";
import DataTable from "../../Table/"; import DataTable from "../../Table/";
@@ -21,6 +21,7 @@ import { useGetInviteToken } from "../../../Hooks/inviteHooks";
const TeamPanel = () => { const TeamPanel = () => {
const theme = useTheme(); const theme = useTheme();
const { t } = useTranslation();
const SPACING_GAP = theme.spacing(12); const SPACING_GAP = theme.spacing(12);
const [toInvite, setToInvite] = useState({ const [toInvite, setToInvite] = useState({
@@ -39,7 +40,7 @@ const TeamPanel = () => {
const headers = [ const headers = [
{ {
id: "name", id: "name",
content: "Name", content: t("teamPanel.table.name"),
render: (row) => { render: (row) => {
return ( return (
<Stack> <Stack>
@@ -47,16 +48,16 @@ const TeamPanel = () => {
{row.firstName + " " + row.lastName} {row.firstName + " " + row.lastName}
</Typography> </Typography>
<Typography> <Typography>
Created {new Date(row.createdAt).toLocaleDateString()} {t("teamPanel.table.created")} {new Date(row.createdAt).toLocaleDateString()}
</Typography> </Typography>
</Stack> </Stack>
); );
}, },
}, },
{ id: "email", content: "Email", render: (row) => row.email }, { id: "email", content: t("teamPanel.table.email"), render: (row) => row.email },
{ {
id: "role", id: "role",
content: "Role", content: t("teamPanel.table.role"),
render: (row) => row.role, render: (row) => row.role,
}, },
]; ];
@@ -78,10 +79,10 @@ const TeamPanel = () => {
useEffect(() => { useEffect(() => {
const ROLE_MAP = { const ROLE_MAP = {
superadmin: "Super admin", superadmin: t("roles.superAdmin"),
admin: "Admin", admin: t("roles.admin"),
user: "Team member", user: t("roles.teamMember"),
demo: "Demo User", demo: t("roles.demoUser"),
}; };
let team = members; let team = members;
if (filter !== "all") if (filter !== "all")
@@ -98,7 +99,7 @@ const TeamPanel = () => {
role: member.role.map((role) => ROLE_MAP[role]).join(","), role: member.role.map((role) => ROLE_MAP[role]).join(","),
})); }));
setData(team); setData(team);
}, [filter, members]); }, [members, filter, t]);
useEffect(() => { useEffect(() => {
setIsDisabled(Object.keys(errors).length !== 0 || toInvite.email === ""); setIsDisabled(Object.keys(errors).length !== 0 || toInvite.email === "");
@@ -197,7 +198,7 @@ const TeamPanel = () => {
spellCheck="false" spellCheck="false"
gap={SPACING_GAP} gap={SPACING_GAP}
> >
<Typography component="h1">Team members</Typography> <Typography component="h1">{t("teamPanel.teamMembers")}</Typography>
<Stack <Stack
direction="row" direction="row"
justifyContent="space-between" justifyContent="space-between"
@@ -214,21 +215,21 @@ const TeamPanel = () => {
filled={(filter === "all").toString()} filled={(filter === "all").toString()}
onClick={() => setFilter("all")} onClick={() => setFilter("all")}
> >
All {t("teamPanel.filter.all")}
</Button> </Button>
<Button <Button
variant="group" variant="group"
filled={(filter === "admin").toString()} filled={(filter === "admin").toString()}
onClick={() => setFilter("admin")} onClick={() => setFilter("admin")}
> >
Super admin {t("roles.superAdmin")}
</Button> </Button>
<Button <Button
variant="group" variant="group"
filled={(filter === "user").toString()} filled={(filter === "user").toString()}
onClick={() => setFilter("user")} onClick={() => setFilter("user")}
> >
Member {t("teamPanel.filter.member")}
</Button> </Button>
</ButtonGroup> </ButtonGroup>
</Stack> </Stack>
@@ -237,22 +238,20 @@ const TeamPanel = () => {
color="accent" color="accent"
onClick={() => setIsOpen(true)} onClick={() => setIsOpen(true)}
> >
Invite a team member {t("teamPanel.inviteTeamMember")}
</Button> </Button>
</Stack> </Stack>
<DataTable <DataTable
headers={headers} headers={headers}
data={data} data={data}
config={{ emptyView: "There are no team members with this role" }} config={{ emptyView: t("teamPanel.noMembers") }}
/> />
</Stack> </Stack>
<GenericDialog <GenericDialog
title={"Invite new team member"} title={t("teamPanel.inviteNewTeamMember")}
description={ description={t("teamPanel.inviteDescription")}
"When you add a new team member, they will get access to all monitors."
}
open={isOpen} open={isOpen}
onClose={closeInviteModal} onClose={closeInviteModal}
theme={theme} theme={theme}
@@ -261,7 +260,7 @@ const TeamPanel = () => {
marginBottom={SPACING_GAP} marginBottom={SPACING_GAP}
type="email" type="email"
id="input-team-member" id="input-team-member"
placeholder="Email" placeholder={t("teamPanel.email")}
value={toInvite.email} value={toInvite.email}
onChange={handleChange} onChange={handleChange}
error={errors.email ? true : false} error={errors.email ? true : false}
@@ -269,7 +268,7 @@ const TeamPanel = () => {
/> />
<Select <Select
id="team-member-role" id="team-member-role"
placeholder="Select role" placeholder={t("teamPanel.selectRole")}
isHidden={true} isHidden={true}
value={toInvite.role[0]} value={toInvite.role[0]}
onChange={(event) => onChange={(event) =>
@@ -279,11 +278,11 @@ const TeamPanel = () => {
})) }))
} }
items={[ items={[
{ _id: "admin", name: "Admin" }, { _id: "admin", name: t("roles.admin") },
{ _id: "user", name: "User" }, { _id: "user", name: t("roles.teamMember") },
]} ]}
/> />
{token && <Typography>Invite link</Typography>} {token && <Typography>{t("teamPanel.inviteLink")}</Typography>}
{token && ( {token && (
<TextInput <TextInput
id="invite-token" id="invite-token"
@@ -302,7 +301,7 @@ const TeamPanel = () => {
color="error" color="error"
onClick={closeInviteModal} onClick={closeInviteModal}
> >
Cancel {t("teamPanel.cancel")}
</Button> </Button>
<Button <Button
variant="contained" variant="contained"
@@ -311,7 +310,7 @@ const TeamPanel = () => {
loading={isSendingInvite} loading={isSendingInvite}
disabled={isDisabled} disabled={isDisabled}
> >
Get token {t("teamPanel.getToken")}
</Button> </Button>
<Button <Button
variant="contained" variant="contained"
@@ -320,7 +319,7 @@ const TeamPanel = () => {
loading={isSendingInvite} loading={isSendingInvite}
disabled={isDisabled} disabled={isDisabled}
> >
E-mail token {t("teamPanel.emailToken")}
</Button> </Button>
</Stack> </Stack>
</GenericDialog> </GenericDialog>
-1
View File
@@ -65,7 +65,6 @@ const DataTable = ({
backgroundColor: theme.palette.secondary.main, backgroundColor: theme.palette.secondary.main,
color: theme.palette.secondary.contrastText, color: theme.palette.secondary.contrastText,
fontWeight: 600, fontWeight: 600,
fontSize: "13px",
}, },
"& :is(td)": { "& :is(td)": {
backgroundColor: theme.palette.primary.main, backgroundColor: theme.palette.primary.main,
+24
View File
@@ -0,0 +1,24 @@
import { useState } from "react";
import { networkService } from "../main";
import { createToast } from "../Utils/toastUtils";
import { useTranslation } from "react-i18next";
const UseDeleteMonitorStats = () => {
const { t } = useTranslation();
const [isLoading, setIsLoading] = useState(false);
const deleteMonitorStats = async ({ teamId }) => {
setIsLoading(true);
try {
const res = await networkService.deleteChecksByTeamId({ teamId });
createToast({ body: t("settingsStatsCleared") });
} catch (error) {
createToast({ body: t("settingsFailedToClearStats") });
} finally {
setIsLoading(false);
}
};
return [deleteMonitorStats, isLoading];
};
export { UseDeleteMonitorStats };
+55
View File
@@ -0,0 +1,55 @@
import { useState, useEffect } from "react";
import { networkService } from "../main";
import { createToast } from "../Utils/toastUtils";
import { useTranslation } from "react-i18next";
const useFetchSettings = ({ setSettingsData }) => {
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState(undefined);
useEffect(() => {
const fetchSettings = async () => {
setIsLoading(true);
try {
const response = await networkService.getAppSettings();
setSettingsData(response?.data?.data);
} catch (error) {
createToast({ body: "Failed to fetch settings" });
setError(error);
} finally {
setIsLoading(false);
}
};
fetchSettings();
}, []);
return [isLoading, error];
};
const useSaveSettings = () => {
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState(undefined);
const { t } = useTranslation();
const saveSettings = async (settings) => {
setIsLoading(true);
try {
await networkService.updateAppSettings({ settings });
if (settings.checkTTL) {
await networkService.updateChecksTTL({
ttl: settings.checkTTL,
});
}
createToast({ body: t("settingsSuccessSaved") });
} catch (error) {
createToast({ body: t("settingsFailedToSave") });
setError(error);
} finally {
setIsLoading(false);
}
};
return [isLoading, error, saveSettings];
};
export { useFetchSettings, useSaveSettings };
@@ -0,0 +1,32 @@
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import ConfigBox from "../../Components/ConfigBox";
// Utils
import { useTheme } from "@emotion/react";
import { useTranslation } from "react-i18next";
import Link from "../../Components/Link";
const SettingsAbout = () => {
const theme = useTheme();
const { t } = useTranslation();
return (
<ConfigBox>
<Box>
<Typography component="h1">{t("settingsAbout")}</Typography>
</Box>
<Box>
<Typography component="h2">Checkmate {2.0}</Typography>
<Typography sx={{ mt: theme.spacing(2), mb: theme.spacing(6), opacity: 0.6 }}>
{t("settingsDevelopedBy")}
</Typography>
<Link
level="secondary"
url="https://github.com/bluewave-labs/checkmate"
label="https://github.com/bluewave-labs/checkmate"
/>
</Box>
</ConfigBox>
);
};
export default SettingsAbout;
@@ -0,0 +1,90 @@
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button";
import ConfigBox from "../../Components/ConfigBox";
// Utils
import { useTheme } from "@emotion/react";
import { PropTypes } from "prop-types";
import { useTranslation } from "react-i18next";
import Dialog from "../../Components/Dialog";
import { useState } from "react";
const SettingsDemoMonitors = ({ HEADER_SX, handleChange, isLoading }) => {
const { t } = useTranslation();
const theme = useTheme();
// Local state
const [isOpen, setIsOpen] = useState(false);
return (
<>
<ConfigBox>
<Box>
<Typography component="h1">{t("settingsDemoMonitors")}</Typography>
<Typography sx={HEADER_SX}>{t("settingsDemoMonitorsDescription")}</Typography>
</Box>
<Box>
<Typography>{t("settingsAddDemoMonitors")}</Typography>
<Button
variant="contained"
color="accent"
loading={isLoading}
onClick={() => {
const syntheticEvent = {
target: {
name: "demo",
},
};
handleChange(syntheticEvent);
}}
sx={{ mt: theme.spacing(4) }}
>
{t("settingsAddDemoMonitorsButton")}
</Button>
</Box>
</ConfigBox>
<ConfigBox>
<Box>
<Typography component="h1">{t("settingsSystemReset")}</Typography>
<Typography sx={{ mt: theme.spacing(2) }}>
{t("settingsSystemResetDescription")}
</Typography>
</Box>
<Box>
<Typography>{t("settingsRemoveAllMonitors")}</Typography>
<Button
variant="contained"
color="error"
loading={isLoading}
onClick={() => setIsOpen(true)}
sx={{ mt: theme.spacing(4) }}
>
{t("settingsRemoveAllMonitorsButton")}
</Button>
</Box>
<Dialog
open={isOpen}
theme={theme}
title={t("settingsRemoveAllMonitorsDialogTitle")}
onCancel={() => setIsOpen(false)}
confirmationButtonLabel={t("settingsRemoveAllMonitorsDialogConfirm")}
onConfirm={() => {
const syntheticEvent = {
target: {
name: "deleteMonitors",
},
};
handleChange(syntheticEvent);
setIsOpen(false);
}}
isLoading={isLoading}
/>
</ConfigBox>
</>
);
};
SettingsDemoMonitors.propTypes = {
handleChange: PropTypes.func,
HEADER_SX: PropTypes.object,
};
export default SettingsDemoMonitors;
+126
View File
@@ -0,0 +1,126 @@
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import ConfigBox from "../../Components/ConfigBox";
import TextInput from "../../Components/Inputs/TextInput";
import Button from "@mui/material/Button";
import Stack from "@mui/material/Stack";
// Utils
import { useTheme } from "@emotion/react";
import { PropTypes } from "prop-types";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { PasswordEndAdornment } from "../../Components/Inputs/TextInput/Adornments";
const SettingsEmail = ({
HEADER_SX,
handleChange,
settingsData,
setSettingsData,
isPasswordSet,
}) => {
const { t } = useTranslation();
const theme = useTheme();
const [password, setPassword] = useState("");
const [hasBeenReset, setHasBeenReset] = useState(false);
const handlePasswordChange = (e) => {
setPassword(e.target.value);
setSettingsData({
...settingsData,
settings: { ...settingsData.settings, systemEmailPassword: e.target.value },
});
};
return (
<ConfigBox>
<Box>
<Typography component="h1">{t("settingsEmail")}</Typography>
<Typography sx={HEADER_SX}>{t("settingsEmailDescription")}</Typography>
</Box>
<Box>
<Stack gap={theme.spacing(10)}>
<Box>
<Typography>{t("settingsEmailHost")}</Typography>
<TextInput
name="systemEmailHost"
placeholder="smtp.gmail.com"
value={settingsData?.settings?.systemEmailHost ?? ""}
onChange={handleChange}
/>
</Box>
<Box>
<Typography>{t("settingsEmailPort")}</Typography>
<TextInput
name="systemEmailPort"
placeholder="425"
type="number"
value={settingsData?.settings?.systemEmailPort ?? ""}
onChange={handleChange}
/>
</Box>
<Box>
<Typography>{t("settingsEmailUser")}</Typography>
<TextInput
name="systemEmailUser"
placeholder="Leave empty if not required"
value={settingsData?.settings?.systemEmailUser ?? ""}
onChange={handleChange}
/>
</Box>
<Box>
<Typography>{t("settingsEmailAddress")}</Typography>
<TextInput
name="systemEmailAddress"
placeholder="uptime@bluewavelabs.ca"
value={settingsData?.settings?.systemEmailAddress ?? ""}
onChange={handleChange}
/>
</Box>
{(isPasswordSet === false || hasBeenReset === true) && (
<Box>
<Typography>{t("settingsEmailPassword")}</Typography>
<TextInput
name="systemEmailPassword"
type="password"
placeholder="123 456 789 101112"
value={password}
onChange={handlePasswordChange}
endAdornment={<PasswordEndAdornment />}
/>
</Box>
)}
{isPasswordSet === true && hasBeenReset === false && (
<Box>
<Typography>{t("settingsEmailFieldResetLabel")}</Typography>
<Button
onClick={() => {
setPassword("");
setSettingsData({
...settingsData,
settings: { ...settingsData.settings, systemEmailPassword: "" },
});
setHasBeenReset(true);
}}
variant="contained"
color="error"
sx={{ mt: theme.spacing(4) }}
>
{t("reset")}
</Button>
</Box>
)}
</Stack>
</Box>
</ConfigBox>
);
};
SettingsEmail.propTypes = {
settingsData: PropTypes.object,
setSettingsData: PropTypes.func,
handleChange: PropTypes.func,
HEADER_SX: PropTypes.object,
isPasswordSet: PropTypes.bool,
};
export default SettingsEmail;
@@ -0,0 +1,87 @@
import Box from "@mui/material/Box";
import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button";
import ConfigBox from "../../Components/ConfigBox";
import TextInput from "../../Components/Inputs/TextInput";
import { PasswordEndAdornment } from "../../Components/Inputs/TextInput/Adornments";
// Utils
import { useTheme } from "@emotion/react";
import { PropTypes } from "prop-types";
import { useState, useEffect } from "react";
import { useTranslation } from "react-i18next";
const SettingsPagespeed = ({
HEADING_SX,
settingsData,
setSettingsData,
isApiKeySet,
}) => {
const { t } = useTranslation();
const theme = useTheme();
// Local state
const [apiKey, setApiKey] = useState("");
const [hasBeenReset, setHasBeenReset] = useState(false);
// Handler
const handleChange = (e) => {
setApiKey(e.target.value);
setSettingsData({
...settingsData,
settings: { ...settingsData.settings, pagespeedApiKey: e.target.value },
});
};
return (
<ConfigBox>
<Box>
<Typography component="h1">{t("pageSpeedApiKeyFieldTitle")}</Typography>
<Typography sx={HEADING_SX}>{t("pageSpeedApiKeyFieldDescription")}</Typography>
</Box>
<Stack gap={theme.spacing(20)}>
{(isApiKeySet === false || hasBeenReset === true) && (
<TextInput
name="pagespeedApiKey"
label={t("pageSpeedApiKeyFieldLabel")}
value={apiKey}
type={"password"}
onChange={handleChange}
optionalLabel="(Optional)"
endAdornment={<PasswordEndAdornment />}
/>
)}
{isApiKeySet === true && hasBeenReset === false && (
<Box>
<Typography>{t("pageSpeedApiKeyFieldResetLabel")}</Typography>
<Button
onClick={() => {
setApiKey("");
setSettingsData({
...settingsData,
settings: { ...settingsData.settings, pagespeedApiKey: "" },
});
setHasBeenReset(true);
}}
variant="contained"
color="error"
sx={{ mt: theme.spacing(4) }}
>
{t("reset")}
</Button>
</Box>
)}
</Stack>
</ConfigBox>
);
};
SettingsPagespeed.propTypes = {
HEADING_SX: PropTypes.object,
settingsData: PropTypes.object,
setSettingsData: PropTypes.func,
isApiKeySet: PropTypes.bool,
};
export default SettingsPagespeed;
@@ -0,0 +1,84 @@
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button";
import Stack from "@mui/material/Stack";
import ConfigBox from "../../Components/ConfigBox";
import TextInput from "../../Components/Inputs/TextInput";
import Dialog from "../../Components/Dialog";
// Utils
import { useTheme } from "@emotion/react";
import { PropTypes } from "prop-types";
import { useTranslation } from "react-i18next";
import { useState } from "react";
const SettingsStats = ({ HEADING_SX, handleChange, settingsData, errors }) => {
const theme = useTheme();
const { t } = useTranslation();
const [isOpen, setIsOpen] = useState(false);
return (
<ConfigBox>
<Box>
<Typography
component="h1"
sx={HEADING_SX}
>
{t("settingsHistoryAndMonitoring")}
</Typography>
<Typography sx={{ mt: theme.spacing(2) }}>
{t("settingsHistoryAndMonitoringDescription")}
</Typography>
</Box>
<Stack gap={theme.spacing(20)}>
<TextInput
name="checkTTL"
label={t("settingsTTLLabel")}
optionalLabel={t("settingsTTLOptionalLabel")}
value={settingsData?.settings?.checkTTL ?? ""}
onChange={handleChange}
type="number"
error={errors.checkTTL ? true : false}
helperText={errors.checkTTL}
/>
<Box>
<Typography>{t("settingsClearAllStats")}</Typography>
<Button
variant="contained"
color="error"
onClick={() => setIsOpen(true)}
sx={{ mt: theme.spacing(4) }}
>
{t("settingsClearAllStatsButton")}
</Button>
</Box>
</Stack>
<Dialog
open={isOpen}
theme={theme}
title={t("settingsClearAllStatsDialogTitle")}
description={t("settingsClearAllStatsDialogDescription")}
onCancel={() => setIsOpen(false)}
confirmationButtonLabel={t("settingsClearAllStatsDialogConfirm")}
onConfirm={() => {
const syntheticEvent = {
target: {
name: "deleteStats",
},
};
handleChange(syntheticEvent);
setIsOpen(false);
}}
isLoading={false}
/>
</ConfigBox>
);
};
SettingsStats.propTypes = {
HEADING_SX: PropTypes.object,
handleChange: PropTypes.func,
settingsData: PropTypes.object,
errors: PropTypes.object,
};
export default SettingsStats;
@@ -0,0 +1,43 @@
import Box from "@mui/material/Box";
import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography";
import ConfigBox from "../../Components/ConfigBox";
import Select from "../../Components/Inputs/Select";
import timezones from "../../Utils/timezones.json";
// Utils
import { useTheme } from "@emotion/react";
import { PropTypes } from "prop-types";
import { useTranslation } from "react-i18next";
const SettingsTimeZone = ({ HEADING_SX, handleChange, timezone }) => {
const theme = useTheme();
const { t } = useTranslation();
return (
<ConfigBox>
<Box>
<Typography component="h1">{t("settingsGeneralSettings")}</Typography>
<Typography sx={HEADING_SX}>
<Typography component="span">{t("settingsDisplayTimezone")}</Typography>-{" "}
{t("settingsDisplayTimezoneDescription")}
</Typography>
</Box>
<Stack gap={theme.spacing(20)}>
<Select
label={t("settingsDisplayTimezone")}
name="timezone"
value={timezone}
onChange={handleChange}
items={timezones}
/>
</Stack>
</ConfigBox>
);
};
SettingsTimeZone.propTypes = {
HEADING_SX: PropTypes.object,
handleChange: PropTypes.func,
timezone: PropTypes.string,
};
export default SettingsTimeZone;
+52
View File
@@ -0,0 +1,52 @@
import Box from "@mui/material/Box";
import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography";
import ConfigBox from "../../Components/ConfigBox";
import Select from "../../Components/Inputs/Select";
// Utils
import { useTheme } from "@emotion/react";
import { PropTypes } from "prop-types";
import { useTranslation } from "react-i18next";
const SettingsUI = ({ HEADING_SX, handleChange, mode, language }) => {
const { t, i18n } = useTranslation();
const theme = useTheme();
const languages = Object.keys(i18n.options.resources || {});
return (
<ConfigBox>
<Box>
<Typography component="h1">{t("settingsAppearance")}</Typography>
<Typography sx={HEADING_SX}>{t("settingsAppearanceDescription")}</Typography>
</Box>
<Stack gap={theme.spacing(20)}>
<Select
name="mode"
label={t("settingsThemeMode")}
value={mode}
onChange={handleChange}
items={[
{ _id: "light", name: "Light" },
{ _id: "dark", name: "Dark" },
]}
></Select>
<Select
name="language"
label={t("settingsLanguage")}
value={language}
onChange={handleChange}
items={languages.map((lang) => ({ _id: lang, name: lang.toUpperCase() }))}
></Select>
</Stack>
</ConfigBox>
);
};
SettingsUI.propTypes = {
HEADING_SX: PropTypes.object,
handleChange: PropTypes.func,
mode: PropTypes.string,
language: PropTypes.string,
};
export default SettingsUI;
+152 -472
View File
@@ -1,134 +1,69 @@
// Components import Stack from "@mui/material/Stack";
import { Box, Stack, Typography, Button, Switch } from "@mui/material"; import Typography from "@mui/material/Typography";
import TextInput from "../../Components/Inputs/TextInput"; import Breadcrumbs from "../../Components/Breadcrumbs";
import Link from "../../Components/Link"; import SettingsTimeZone from "./SettingsTimeZone";
import Select from "../../Components/Inputs/Select"; import SettingsUI from "./SettingsUI";
import { useIsAdmin } from "../../Hooks/useIsAdmin"; import SettingsPagespeed from "./SettingsPagespeed";
import Dialog from "../../Components/Dialog"; import SettingsDemoMonitors from "./SettingsDemoMonitors";
import ConfigBox from "../../Components/ConfigBox"; import SettingsAbout from "./SettingsAbout";
import { PasswordEndAdornment } from "../../Components/Inputs/TextInput/Adornments"; import SettingsEmail from "./SettingsEmail";
import { getAppSettings } from "../../Features/Settings/settingsSlice"; import Button from "@mui/material/Button";
// import { // Utils
// WalletMultiButton, import { settingsValidation } from "../../Validation/validation";
// WalletDisconnectButton,
// } from "@solana/wallet-adapter-react-ui";
//Utils
import { useTheme } from "@emotion/react";
import { logger } from "../../Utils/Logger";
import { useDispatch, useSelector } from "react-redux";
import { createToast } from "../../Utils/toastUtils"; import { createToast } from "../../Utils/toastUtils";
import { useState } from "react";
import { useTheme } from "@emotion/react";
import { useTranslation } from "react-i18next";
import { useSelector, useDispatch } from "react-redux";
import { setTimezone, setMode, setLanguage } from "../../Features/UI/uiSlice";
import SettingsStats from "./SettingsStats";
import { import {
deleteMonitorChecksByTeamId, deleteMonitorChecksByTeamId,
addDemoMonitors, addDemoMonitors,
deleteAllMonitors, deleteAllMonitors,
} from "../../Features/UptimeMonitors/uptimeMonitorsSlice"; } from "../../Features/UptimeMonitors/uptimeMonitorsSlice";
import { update } from "../../Features/Auth/authSlice"; import { useFetchSettings, useSaveSettings } from "../../Hooks/useFetchSettings";
import PropTypes from "prop-types"; import { UseDeleteMonitorStats } from "../../Hooks/useDeleteMonitorStats";
import {
setTimezone,
setMode,
setDistributedUptimeEnabled,
setLanguage,
} from "../../Features/UI/uiSlice";
import timezones from "../../Utils/timezones.json";
import { useState, useEffect } from "react";
import { networkService } from "../../main";
import { settingsValidation } from "../../Validation/validation";
import { updateAppSettings } from "../../Features/Settings/settingsSlice";
import { useTranslation } from "react-i18next";
// Constants // Constants
const SECONDS_PER_DAY = 86400; const BREADCRUMBS = [{ name: `Settings`, path: "/settings" }];
const Settings = () => { const Settings = () => {
const theme = useTheme(); // Redux state
const { t, i18n } = useTranslation(); const { mode, language, timezone } = useSelector((state) => state.ui);
const isAdmin = useIsAdmin();
const { user } = useSelector((state) => state.auth); const { user } = useSelector((state) => state.auth);
const { language } = useSelector((state) => state.ui);
const { checkTTL } = user; // Local state
const { isLoading } = useSelector((state) => state.uptimeMonitors); const [settingsData, setSettingsData] = useState({});
const { isLoading: authIsLoading } = useSelector((state) => state.auth);
const { timezone, distributedUptimeEnabled } = useSelector((state) => state.ui);
const { mode } = useSelector((state) => state.ui);
const [checksIsLoading, setChecksIsLoading] = useState(false);
const [form, setForm] = useState({
enableDistributedUptime: distributedUptimeEnabled,
ttl: checkTTL ? (checkTTL / SECONDS_PER_DAY).toString() : 0,
pagespeedApiKey: "",
});
const [version, setVersion] = useState("unknown");
const [apiKeyFieldType, setApiKeyFieldType] = useState("password");
const [isApiKeySet, setIsApiKeySet] = useState(false);
const [errors, setErrors] = useState({}); const [errors, setErrors] = useState({});
const deleteStatsMonitorsInitState = { deleteMonitors: false, deleteStats: false }; // Network
const [isOpen, setIsOpen] = useState(deleteStatsMonitorsInitState); const [isSettingsLoading, settingsError] = useFetchSettings({
setSettingsData,
});
const [isSaving, saveError, saveSettings] = useSaveSettings();
const [deleteMonitorStats, isDeletingMonitorStats] = UseDeleteMonitorStats();
// Setup
const theme = useTheme();
const HEADING_SX = { mt: theme.spacing(2), mb: theme.spacing(2) };
const { t, i18n } = useTranslation();
const dispatch = useDispatch(); const dispatch = useDispatch();
//Fetching latest release version from github // Handlers
useEffect(() => { const handleChange = async (e) => {
const fetchLatestVersion = async () => { const { name, value } = e.target;
let version = "unknown";
try { // Build next state early
const response = await networkService.fetchGithubLatestRelease(); const newSettingsData = {
if (!response.status === 200) { ...settingsData,
throw new Error("Failed to fetch latest version"); settings: { ...settingsData.settings, [name]: value },
}
version = response.data.tag_name;
} catch (error) {
createToast({ body: error.message || "Error fetching latest version" }); // Set error message
} finally {
setVersion(version);
}
}; };
fetchLatestVersion();
}, []);
useEffect(() => {
dispatch(getAppSettings());
}, []);
const { pagespeedApiKey } = useSelector((state) => state.settings);
useEffect(() => {
if (pagespeedApiKey) {
setIsApiKeySet(true);
setForm((prev) => ({
...prev,
pagespeedApiKey: t("maskedPageSpeedKeyPlaceholder"),
}));
} else {
setIsApiKeySet(false);
setForm((prev) => ({
...prev,
pagespeedApiKey: "",
}));
}
}, [pagespeedApiKey]);
const handleChange = (event) => {
const { type, checked, value, id } = event.target;
if (type === "checkbox") {
setForm((prev) => ({
...prev,
[id]: checked,
}));
return;
}
let inputValue = value;
if (id === "ttl") {
inputValue = value.replace(/[^0-9]/g, "");
}
const updatedForm = { ...form, [id]: inputValue };
const { error } = settingsValidation.validate(
updatedForm,
{ abortEarly: false }
);
// Validate
const { error } = settingsValidation.validate(newSettingsData.settings, {
abortEarly: false,
});
if (!error || error.details.length === 0) { if (!error || error.details.length === 0) {
setErrors({}); setErrors({});
} else { } else {
@@ -137,385 +72,130 @@ const Settings = () => {
newErrors[err.path[0]] = err.message; newErrors[err.path[0]] = err.message;
}); });
setErrors(newErrors); setErrors(newErrors);
logger.error("Validation errors:", error.details);
} }
setForm(updatedForm);
};
// TODO Handle saving if (name === "timezone") {
const handleSave = async () => { dispatch(setTimezone({ timezone: value }));
try {
setChecksIsLoading(true);
await networkService.updateChecksTTL({
ttl: form.ttl,
});
const updatedUser = { ...user, checkTTL: form.ttl };
const [userAction, settingsAction] = await Promise.all([
dispatch(update({ localData: updatedUser })),
dispatch(updateAppSettings({ settings: { language: language, pagespeedApiKey: form.pagespeedApiKey } })),
]);
if (userAction.payload.success && settingsAction.payload.success) {
createToast({ body: t("settingsSuccessSaved") });
} else {
throw new Error("Failed to save settings");
}
} catch (error) {
createToast({ body: t("settingsFailedToSave") });
} finally {
setChecksIsLoading(false);
} }
};
const handleClearStats = async () => { if (name === "mode") {
try { dispatch(setMode(value));
const action = await dispatch(deleteMonitorChecksByTeamId({ teamId: user.teamId }));
if (deleteMonitorChecksByTeamId.fulfilled.match(action)) {
createToast({ body: t("settingsStatsCleared") });
} else {
createToast({ body: t("settingsFailedToClearStats") });
}
} catch (error) {
logger.error(error);
createToast({ body: t("settingsFailedToClearStats") });
} finally {
setIsOpen(deleteStatsMonitorsInitState);
} }
};
const handleInsertDemoMonitors = async () => { if (name === "language") {
try { dispatch(setLanguage(value));
const action = await dispatch(addDemoMonitors()); i18n.changeLanguage(value);
if (addDemoMonitors.fulfilled.match(action)) { }
createToast({ body: t("settingsDemoMonitorsAdded") });
} else { if (name === "deleteStats") {
await deleteMonitorStats({ teamId: user.teamId });
return;
}
if (name === "demo") {
try {
const action = await dispatch(addDemoMonitors());
if (addDemoMonitors.fulfilled.match(action)) {
createToast({ body: t("settingsDemoMonitorsAdded") });
} else {
createToast({ body: t("settingsFailedToAddDemoMonitors") });
}
} catch (error) {
createToast({ body: t("settingsFailedToAddDemoMonitors") }); createToast({ body: t("settingsFailedToAddDemoMonitors") });
} }
} catch (error) { return;
logger.error(error);
createToast({ Body: t("settingsFailedToAddDemoMonitors") });
} }
};
const handleDeleteAllMonitors = async () => { if (name === "deleteMonitors") {
try { try {
const action = await dispatch(deleteAllMonitors()); const action = await dispatch(deleteAllMonitors());
if (deleteAllMonitors.fulfilled.match(action)) { if (deleteAllMonitors.fulfilled.match(action)) {
createToast({ body: t("settingsMonitorsDeleted") }); createToast({ body: t("settingsMonitorsDeleted") });
} else { } else {
createToast({ body: t("settingsFailedToDeleteMonitors") });
}
} catch (error) {
createToast({ body: t("settingsFailedToDeleteMonitors") }); createToast({ body: t("settingsFailedToDeleteMonitors") });
} }
} catch (error) { return;
logger.error(error);
createToast({ Body: t("settingsFailedToDeleteMonitors") });
} finally {
setIsOpen(deleteStatsMonitorsInitState);
} }
setSettingsData(newSettingsData);
}; };
const handleResetApiKey = () => { const handleSave = () => {
setIsApiKeySet(false); const { error } = settingsValidation.validate(settingsData.settings, {
setForm((prev) => ({ abortEarly: false,
...prev, });
pagespeedApiKey: "", if (!error || error.details.length === 0) {
})); setErrors({});
}; } else {
const newErrors = {};
const languages = Object.keys(i18n.options.resources || {}); error.details.forEach((err) => {
newErrors[err.path[0]] = err.message;
});
setErrors(newErrors);
}
saveSettings(settingsData?.settings);
};
return ( return (
<Box <Stack gap={theme.spacing(10)}>
className="settings" <Breadcrumbs list={BREADCRUMBS} />
style={{ <Typography variant="h1">Settings</Typography>
paddingBottom: 0, <SettingsTimeZone
}} HEADING_SX={HEADING_SX}
> handleChange={handleChange}
timezone={timezone}
/>
<SettingsUI
HEADING_SX={HEADING_SX}
handleChange={handleChange}
mode={mode}
language={language}
/>
<SettingsPagespeed
HEADING_SX={HEADING_SX}
settingsData={settingsData}
setSettingsData={setSettingsData}
isApiKeySet={settingsData?.pagespeedKeySet ?? false}
/>
<SettingsStats
HEADING_SX={HEADING_SX}
settingsData={settingsData}
handleChange={handleChange}
errors={errors}
/>
<SettingsDemoMonitors
HEADER_SX={HEADING_SX}
handleChange={handleChange}
isLoading={isSettingsLoading || isSaving || isDeletingMonitorStats}
/>
<SettingsEmail
HEADER_SX={HEADING_SX}
handleChange={handleChange}
settingsData={settingsData}
setSettingsData={setSettingsData}
isPasswordSet={settingsData?.emailPasswordSet ?? false}
/>
<SettingsAbout />
<Stack <Stack
component="form" direction="row"
gap={theme.spacing(12)} justifyContent="flex-end"
noValidate
spellCheck="false"
> >
<ConfigBox> <Button
<Box> loading={isSaving || isDeletingMonitorStats || isSettingsLoading}
<Typography component="h1">{t("settingsGeneralSettings")}</Typography> disabled={Object.keys(errors).length > 0}
<Typography sx={{ mt: theme.spacing(2), mb: theme.spacing(2) }}> variant="contained"
<Typography component="span">{t("settingsDisplayTimezone")}</Typography>-{" "} color="accent"
{t("settingsDisplayTimezoneDescription")} sx={{ px: theme.spacing(12), mt: theme.spacing(20) }}
</Typography> onClick={handleSave}
</Box>
<Stack gap={theme.spacing(20)}>
<Select
id="display-timezones"
label={t("settingsDisplayTimezone")}
value={timezone}
onChange={(e) => {
dispatch(setTimezone({ timezone: e.target.value }));
}}
items={timezones}
/>
</Stack>
</ConfigBox>
<ConfigBox>
<Box>
<Typography component="h1">{t("settingsAppearance")}</Typography>
<Typography sx={{ mt: theme.spacing(2), mb: theme.spacing(2) }}>
{t("settingsAppearanceDescription")}
</Typography>
</Box>
<Stack gap={theme.spacing(20)}>
<Select
id="theme-mode"
label={t("settingsThemeMode")}
value={mode}
onChange={(e) => {
dispatch(setMode(e.target.value));
}}
items={[
{ _id: "light", name: t("settingsThemeModeLight") },
{ _id: "dark", name: t("settingsThemeModeDark") },
]}
></Select>
<Select
id="language"
label={t("settingsLanguage")}
value={language}
onChange={(e) => {
dispatch(setLanguage(e.target.value));
i18n.changeLanguage(e.target.value);
}}
items={languages.map((lang) => ({ _id: lang, name: lang.toUpperCase() }))}
></Select>
</Stack>
</ConfigBox>
{/* {isAdmin && (
<ConfigBox>
<Box>
<Typography component="h1">{t("settingsDistributedUptime")}</Typography>
<Typography sx={{ mt: theme.spacing(2), mb: theme.spacing(2) }}>
{t("settingsDistributedUptimeDescription")}
</Typography>
</Box>
<Box>
<Switch
id="enableDistributedUptime"
color="accent"
checked={distributedUptimeEnabled}
onChange={(e) => {
dispatch(setDistributedUptimeEnabled(e.target.checked));
}}
/>
{distributedUptimeEnabled === true
? t("settingsEnabled")
: t("settingsDisabled")}
</Box>
</ConfigBox>
)} */}
<ConfigBox>
<Box>
<Typography component="h1">{t("pageSpeedApiKeyFieldTitle")}</Typography>
<Typography sx={{ mt: theme.spacing(2), mb: theme.spacing(2) }}>
{t("pageSpeedApiKeyFieldDescription")}
</Typography>
</Box>
<Stack gap={theme.spacing(20)}>
<TextInput
id="pagespeedApiKey"
label={t("pageSpeedApiKeyFieldLabel")}
value={form.pagespeedApiKey}
type={apiKeyFieldType}
onChange={handleChange}
disabled={isApiKeySet}
optionalLabel="(Optional)"
error={!!errors.pagespeedApiKey}
helperText={errors.pagespeedApiKey}
endAdornment={
!isApiKeySet && (
<PasswordEndAdornment
fieldType={apiKeyFieldType}
setFieldType={setApiKeyFieldType}
/>
)
}
/>
{isApiKeySet && (
<Box>
<Typography>{t("pageSpeedApiKeyFieldResetLabel")}</Typography>
<Button onClick={handleResetApiKey} variant="contained" color="error" sx={{ mt: theme.spacing(4) }}>
{t("reset")}
</Button>
</Box>
)}
</Stack>
</ConfigBox>
{/* {isAdmin && (
<ConfigBox>
<Box>
<Typography component="h1">{t("settingsWallet")}</Typography>
<Typography sx={{ mt: theme.spacing(2) }}>
{t("settingsWalletDescription")}
</Typography>
</Box>
<Box
sx={{
display: "flex",
flexWrap: "wrap",
justifyContent: "flex-start",
gap: 2,
}}
>
<Stack
direction="row"
spacing={2}
>
<WalletMultiButton />
<WalletDisconnectButton />
</Stack>
</Box>
</ConfigBox>
)} */}
{isAdmin && (
<ConfigBox>
<Box>
<Typography component="h1">{t("settingsHistoryAndMonitoring")}</Typography>
<Typography sx={{ mt: theme.spacing(2) }}>
{t("settingsHistoryAndMonitoringDescription")}
</Typography>
</Box>
<Stack gap={theme.spacing(20)}>
<TextInput
id="ttl"
label={t("settingsTTLLabel")}
optionalLabel={t("settingsTTLOptionalLabel")}
value={form.ttl}
onChange={handleChange}
error={errors.ttl ? true : false}
helperText={errors.ttl}
/>
<Box>
<Typography>{t("settingsClearAllStats")}</Typography>
<Button
variant="contained"
color="error"
onClick={() =>
setIsOpen({ ...deleteStatsMonitorsInitState, deleteStats: true })
}
sx={{ mt: theme.spacing(4) }}
>
{t("settingsClearAllStatsButton")}
</Button>
</Box>
</Stack>
<Dialog
open={isOpen.deleteStats}
theme={theme}
title={t("settingsClearAllStatsDialogTitle")}
description={t("settingsClearAllStatsDialogDescription")}
onCancel={() => setIsOpen(deleteStatsMonitorsInitState)}
confirmationButtonLabel={t("settingsClearAllStatsDialogConfirm")}
onConfirm={handleClearStats}
isLoading={isLoading || authIsLoading || checksIsLoading}
/>
</ConfigBox>
)}
{isAdmin && (
<>
{/* Demo Monitors Section */}
<ConfigBox>
<Box>
<Typography component="h1">{t("settingsDemoMonitors")}</Typography>
<Typography sx={{ mt: theme.spacing(2) }}>
{t("settingsDemoMonitorsDescription")}
</Typography>
</Box>
<Box>
<Typography>{t("settingsAddDemoMonitors")}</Typography>
<Button
variant="contained"
color="accent"
loading={isLoading || authIsLoading || checksIsLoading}
onClick={handleInsertDemoMonitors}
sx={{ mt: theme.spacing(4) }}
>
{t("settingsAddDemoMonitorsButton")}
</Button>
</Box>
</ConfigBox>
{/* System Reset Section */}
<ConfigBox>
<Box>
<Typography component="h1">{t("settingsSystemReset")}</Typography>
<Typography sx={{ mt: theme.spacing(2) }}>
{t("settingsSystemResetDescription")}
</Typography>
</Box>
<Box>
<Typography>{t("settingsRemoveAllMonitors")}</Typography>
<Button
variant="contained"
color="error"
loading={isLoading || authIsLoading || checksIsLoading}
onClick={() =>
setIsOpen({ ...deleteStatsMonitorsInitState, deleteMonitors: true })
}
sx={{ mt: theme.spacing(4) }}
>
{t("settingsRemoveAllMonitorsButton")}
</Button>
</Box>
<Dialog
open={isOpen.deleteMonitors}
theme={theme}
title={t("settingsRemoveAllMonitorsDialogTitle")}
onCancel={() => setIsOpen(deleteStatsMonitorsInitState)}
confirmationButtonLabel={t("settingsRemoveAllMonitorsDialogConfirm")}
onConfirm={handleDeleteAllMonitors}
isLoading={isLoading || authIsLoading || checksIsLoading}
/>
</ConfigBox>
</>
)}
<ConfigBox>
<Box>
<Typography component="h1">{t("settingsAbout")}</Typography>
</Box>
<Box>
<Typography component="h2">Checkmate {version}</Typography>
<Typography sx={{ mt: theme.spacing(2), mb: theme.spacing(6), opacity: 0.6 }}>
{t("settingsDevelopedBy")}
</Typography>
<Link
level="secondary"
url="https://github.com/bluewave-labs/checkmate"
label="https://github.com/bluewave-labs/checkmate"
/>
</Box>
</ConfigBox>
<Stack
direction="row"
justifyContent="flex-end"
> >
<Button {t("settingsSave")}
loading={isLoading || authIsLoading || checksIsLoading} </Button>
disabled={Object.keys(errors).length > 0}
variant="contained"
color="accent"
sx={{ px: theme.spacing(12), mt: theme.spacing(20) }}
onClick={handleSave}
>
{t("settingsSave")}
</Button>
</Stack>
</Stack> </Stack>
</Box> </Stack>
); );
}; };
Settings.propTypes = {
isAdmin: PropTypes.bool,
};
export default Settings; export default Settings;
+19 -19
View File
@@ -54,7 +54,7 @@ const CreateStatusPage = () => {
const [createStatusPage, createStatusIsLoading, createStatusPageNetworkError] = const [createStatusPage, createStatusIsLoading, createStatusPageNetworkError] =
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, statusPageNetworkError] =
useStatusPageFetch(isCreate, url); useStatusPageFetch(isCreate, url);
@@ -89,29 +89,29 @@ const CreateStatusPage = () => {
const handleImageChange = useCallback((fileObj) => { const handleImageChange = useCallback((fileObj) => {
if (!fileObj || !fileObj.file) return; if (!fileObj || !fileObj.file) return;
setForm((prev) => ({ setForm((prev) => ({
...prev, ...prev,
logo: { logo: {
src: fileObj.src, src: fileObj.src,
name: fileObj.name, name: fileObj.name,
type: fileObj.file.type, type: fileObj.file.type,
size: fileObj.file.size, size: fileObj.file.size,
}, },
})); }));
intervalRef.current = setInterval(() => { intervalRef.current = setInterval(() => {
const buffer = 12; const buffer = 12;
setProgress((prev) => { setProgress((prev) => {
if (prev.value + buffer >= 100) { if (prev.value + buffer >= 100) {
clearInterval(intervalRef.current); clearInterval(intervalRef.current);
return { value: 100, isLoading: false }; return { value: 100, isLoading: false };
} }
return { ...prev, value: prev.value + buffer }; return { ...prev, value: prev.value + buffer };
}); });
}, 120); }, 120);
}, []); }, []);
const removeLogo = () => { const removeLogo = () => {
setForm((prev) => ({ setForm((prev) => ({
...prev, ...prev,
@@ -27,22 +27,14 @@ import { useTranslation } from "react-i18next";
* @returns {JSX.Element} The rendered Filter component. * @returns {JSX.Element} The rendered Filter component.
*/ */
const typeOptions = [ const getTypeOptions = () => [
{ value: "http", label: "HTTP(S)" }, { value: "http", label: "HTTP(S)" },
{ value: "ping", label: "Ping" }, { value: "ping", label: "Ping" },
{ value: "docker", label: "Docker" }, { value: "docker", label: "Docker" },
{ value: "port", label: "Port" }, { value: "port", label: "Port" },
]; ];
const statusOptions = [ // These functions were moved inline to ensure translations are applied correctly
{ value: "Up", label: "Up" },
{ value: "Down", label: "Down" },
];
const stateOptions = [
{ value: "Active", label: "Active" },
{ value: "Paused", label: "Paused" },
];
const Filter = ({ const Filter = ({
selectedTypes, selectedTypes,
@@ -58,6 +50,18 @@ const Filter = ({
const theme = useTheme(); const theme = useTheme();
const { t } = useTranslation(); const { t } = useTranslation();
const typeOptions = getTypeOptions();
// Create status options with translations
const statusOptions = [
{ value: "Up", label: t("monitorStatus.up") },
{ value: "Down", label: t("monitorStatus.down") },
];
// Create state options with translations
const stateOptions = [
{ value: "Active", label: t("monitorState.active") },
{ value: "Paused", label: t("monitorState.paused") },
];
const handleTypeChange = (event) => { const handleTypeChange = (event) => {
const selectedValues = event.target.value; const selectedValues = event.target.value;
setSelectedTypes(selectedValues.length > 0 ? selectedValues : undefined); setSelectedTypes(selectedValues.length > 0 ? selectedValues : undefined);
@@ -2,10 +2,12 @@ import PropTypes from "prop-types";
import { Stack } from "@mui/material"; import { Stack } from "@mui/material";
import StatusBox from "./statusBox"; import StatusBox from "./statusBox";
import { useTheme } from "@emotion/react"; import { useTheme } from "@emotion/react";
import { useTranslation } from "react-i18next";
import SkeletonLayout from "./skeleton"; import SkeletonLayout from "./skeleton";
const StatusBoxes = ({ shouldRender, monitorsSummary }) => { const StatusBoxes = ({ shouldRender, monitorsSummary }) => {
const theme = useTheme(); const theme = useTheme();
const { t } = useTranslation();
if (!shouldRender) return <SkeletonLayout shouldRender={shouldRender} />; if (!shouldRender) return <SkeletonLayout shouldRender={shouldRender} />;
return ( return (
<Stack <Stack
@@ -14,15 +16,15 @@ const StatusBoxes = ({ shouldRender, monitorsSummary }) => {
justifyContent="space-between" justifyContent="space-between"
> >
<StatusBox <StatusBox
title="up" title={t("monitorStatus.up")}
value={monitorsSummary?.upMonitors ?? 0} value={monitorsSummary?.upMonitors ?? 0}
/> />
<StatusBox <StatusBox
title="down" title={t("monitorStatus.down")}
value={monitorsSummary?.downMonitors ?? 0} value={monitorsSummary?.downMonitors ?? 0}
/> />
<StatusBox <StatusBox
title="paused" title={t("monitorStatus.paused")}
value={monitorsSummary?.pausedMonitors ?? 0} value={monitorsSummary?.pausedMonitors ?? 0}
/> />
</Stack> </Stack>
@@ -31,6 +33,7 @@ const StatusBoxes = ({ shouldRender, monitorsSummary }) => {
StatusBoxes.propTypes = { StatusBoxes.propTypes = {
monitorsSummary: PropTypes.object, monitorsSummary: PropTypes.object,
shouldRender: PropTypes.bool,
}; };
export default StatusBoxes; export default StatusBoxes;
+5 -2
View File
@@ -31,11 +31,11 @@ import PropTypes from "prop-types";
import useFetchMonitorsWithSummary from "../../../Hooks/useFetchMonitorsWithSummary"; import useFetchMonitorsWithSummary from "../../../Hooks/useFetchMonitorsWithSummary";
import useFetchMonitorsWithChecks from "../../../Hooks/useFetchMonitorsWithChecks"; import useFetchMonitorsWithChecks from "../../../Hooks/useFetchMonitorsWithChecks";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
const BREADCRUMBS = [{ name: `Uptime`, path: "/uptime" }];
const TYPES = ["http", "ping", "docker", "port"]; const TYPES = ["http", "ping", "docker", "port"];
const CreateMonitorButton = ({ shouldRender }) => { const CreateMonitorButton = ({ shouldRender }) => {
// Utils // Utils
const navigate = useNavigate(); const navigate = useNavigate();
const { t } = useTranslation();
if (shouldRender === false) { if (shouldRender === false) {
return; return;
} }
@@ -49,7 +49,7 @@ const CreateMonitorButton = ({ shouldRender }) => {
navigate("/uptime/create"); navigate("/uptime/create");
}} }}
> >
Create new {t("createNew")}
</Button> </Button>
</Box> </Box>
); );
@@ -78,10 +78,13 @@ const UptimeMonitors = () => {
// Utils // Utils
const theme = useTheme(); const theme = useTheme();
const navigate = useNavigate();
const isAdmin = useIsAdmin(); const isAdmin = useIsAdmin();
const dispatch = useDispatch(); const dispatch = useDispatch();
const { t } = useTranslation(); const { t } = useTranslation();
const BREADCRUMBS = [{ name: t("menu.uptime"), path: "/uptime" }];
// Handlers // Handlers
const handleChangePage = (event, newPage) => { const handleChangePage = (event, newPage) => {
setPage(newPage); setPage(newPage);
+2 -2
View File
@@ -9,7 +9,7 @@ const shadow =
const baseTheme = (palette) => ({ const baseTheme = (palette) => ({
typography: { typography: {
fontFamily: fontFamilyPrimary, fontFamily: fontFamilyPrimary,
fontSize: 14, fontSize: typographyLevels.base,
h1: { h1: {
fontSize: typographyLevels.xl, fontSize: typographyLevels.xl,
color: palette.primary.contrastText, color: palette.primary.contrastText,
@@ -253,6 +253,7 @@ const baseTheme = (palette) => ({
MuiTableCell: { MuiTableCell: {
styleOverrides: { styleOverrides: {
root: ({ theme }) => ({ root: ({ theme }) => ({
fontSize: typographyLevels.base,
borderBottomColor: theme.palette.primary.lowContrast, borderBottomColor: theme.palette.primary.lowContrast,
}), }),
}, },
@@ -376,7 +377,6 @@ const baseTheme = (palette) => ({
MuiTab: { MuiTab: {
styleOverrides: { styleOverrides: {
root: ({ theme }) => ({ root: ({ theme }) => ({
fontSize: theme.typography.fontSize - 1,
color: theme.palette.tertiary.contrastText, color: theme.palette.tertiary.contrastText,
height: "34px", height: "34px",
minHeight: "34px", minHeight: "34px",
+5 -3
View File
@@ -3,6 +3,7 @@ import { useTheme } from "@emotion/react";
import { Box, Typography } from "@mui/material"; import { Box, Typography } from "@mui/material";
import { useDispatch, useSelector } from "react-redux"; import { useDispatch, useSelector } from "react-redux";
import { useEffect } from "react"; import { useEffect } from "react";
import { useTranslation } from "react-i18next";
import { setGreeting } from "../Features/UI/uiSlice"; import { setGreeting } from "../Features/UI/uiSlice";
const early = [ const early = [
@@ -133,6 +134,7 @@ const evening = [
const Greeting = ({ type = "" }) => { const Greeting = ({ type = "" }) => {
const theme = useTheme(); const theme = useTheme();
const dispatch = useDispatch(); const dispatch = useDispatch();
const { t } = useTranslation();
const { firstName } = useSelector((state) => state.auth.user); const { firstName } = useSelector((state) => state.auth.user);
const index = useSelector((state) => state.ui.greeting.index); const index = useSelector((state) => state.ui.greeting.index);
const lastUpdate = useSelector((state) => state.ui.greeting.lastUpdate); const lastUpdate = useSelector((state) => state.ui.greeting.lastUpdate);
@@ -147,7 +149,7 @@ const Greeting = ({ type = "" }) => {
let random = Math.floor(Math.random() * 5); let random = Math.floor(Math.random() * 5);
dispatch(setGreeting({ index: random, lastUpdate: hour })); dispatch(setGreeting({ index: random, lastUpdate: hour }));
} }
}, [dispatch, hour]); }, [dispatch, hour, lastUpdate]);
let greetingArray = let greetingArray =
hour < 6 ? early : hour < 12 ? morning : hour < 18 ? afternoon : evening; hour < 6 ? early : hour < 12 ? morning : hour < 18 ? afternoon : evening;
@@ -165,7 +167,7 @@ const Greeting = ({ type = "" }) => {
fontSize="inherit" fontSize="inherit"
color={theme.palette.primary.contrastTextTertiary} color={theme.palette.primary.contrastTextTertiary}
> >
{prepend},{" "} {t("greeting.prepend", { defaultValue: prepend })}, {" "}
</Typography> </Typography>
<Typography <Typography
component="span" component="span"
@@ -181,7 +183,7 @@ const Greeting = ({ type = "" }) => {
lineHeight={1} lineHeight={1}
color={theme.palette.primary.contrastTextTertiary} color={theme.palette.primary.contrastTextTertiary}
> >
{append} — Here’s an overview of your {type} monitors. {t("greeting.append", { defaultValue: append })} — {t("greeting.overview", { type: t(`menu.${type}`) })}
</Typography> </Typography>
</Box> </Box>
); );
+31 -21
View File
@@ -11,7 +11,8 @@ const nameSchema = joi
.messages({ .messages({
"string.empty": "Name is required", "string.empty": "Name is required",
"string.max": "Name must be less than 50 characters", "string.max": "Name must be less than 50 characters",
"string.pattern.base": "Name must contain only letters, spaces, apostrophes, or hyphens" "string.pattern.base":
"Name must contain only letters, spaces, apostrophes, or hyphens",
}); });
const passwordSchema = joi const passwordSchema = joi
@@ -152,20 +153,21 @@ const monitorValidation = joi.object({
"string.invalidUrl": "Please enter a valid URL with optional port", "string.invalidUrl": "Please enter a valid URL with optional port",
"string.pattern.base": "Please enter a valid container ID.", "string.pattern.base": "Please enter a valid container ID.",
}), }),
port: joi.number() port: joi
.integer() .number()
.min(1) .integer()
.max(65535) .min(1)
.when("type", { .max(65535)
is: "port", .when("type", {
then: joi.required().messages({ is: "port",
"number.base": "Port must be a number.", then: joi.required().messages({
"number.min": "Port must be at least 1.", "number.base": "Port must be a number.",
"number.max": "Port must be at most 65535.", "number.min": "Port must be at least 1.",
"any.required": "Port is required for port monitors.", "number.max": "Port must be at most 65535.",
"any.required": "Port is required for port monitors.",
}),
otherwise: joi.optional(),
}), }),
otherwise: joi.optional(),
}),
name: joi.string().trim().max(50).allow("").messages({ name: joi.string().trim().max(50).allow("").messages({
"string.max": "This field should not exceed the 50 characters limit.", "string.max": "This field should not exceed the 50 characters limit.",
}), }),
@@ -253,14 +255,19 @@ const statusPageValidation = joi.object({
showCharts: joi.boolean(), showCharts: joi.boolean(),
}); });
const settingsValidation = joi.object({ const settingsValidation = joi.object({
ttl: joi.number().required().messages({ checkTTL: joi.number().required().messages({
"string.empty": "Please enter a value", "string.empty": "Please enter a value",
"number.base": "Please enter a valid number", "number.base": "Please enter a valid number",
"any.required": "Please enter a value" "any.required": "Please enter a value",
}), }),
pagespeedApiKey: joi.string().allow("").optional(), pagespeedApiKey: joi.string().allow("").optional(),
}) language: joi.string().required(),
.unknown(true); systemEmailHost: joi.string().allow(""),
systemEmailPort: joi.number().allow(null, ""),
systemEmailAddress: joi.string().allow(""),
systemEmailPassword: joi.string().allow(""),
systemEmailUser: joi.string().allow(""),
});
const dayjsValidator = (value, helpers) => { const dayjsValidator = (value, helpers) => {
if (!dayjs(value).isValid()) { if (!dayjs(value).isValid()) {
@@ -363,9 +370,12 @@ const infrastructureMonitorValidation = joi.object({
notifications: joi.array().items( notifications: joi.array().items(
joi.object({ joi.object({
type: joi.string().valid("email").required(), type: joi.string().valid("email").required(),
address: joi.string().email({ tlds: { allow: false } }).required(), address: joi
.string()
.email({ tlds: { allow: false } })
.required(),
}) })
) ),
}); });
export { export {
@@ -377,5 +387,5 @@ export {
advancedSettingsValidation, advancedSettingsValidation,
infrastructureMonitorValidation, infrastructureMonitorValidation,
statusPageValidation, statusPageValidation,
logoImageValidation logoImageValidation,
}; };
+512 -448
View File
@@ -1,451 +1,515 @@
{ {
"dontHaveAccount": "Don't have account", "dontHaveAccount": "Don't have account",
"doNotHaveAccount": "Do not have an account?", "doNotHaveAccount": "Do not have an account?",
"registerHere": "Register here", "registerHere": "Register here",
"email": "E-mail", "email": "E-mail",
"forgotPassword": "Forgot Password", "forgotPassword": "Forgot Password",
"password": "Password", "password": "Password",
"signUp": "Sign Up", "signUp": "Sign Up",
"submit": "Submit", "submit": "Submit",
"title": "Title", "title": "Title",
"continue": "Continue", "continue": "Continue",
"enterEmail": "Enter your email", "enterEmail": "Enter your email",
"authLoginTitle": "Log In", "authLoginTitle": "Log In",
"authLoginEnterPassword": "Enter your password", "authLoginEnterPassword": "Enter your password",
"commonPassword": "Password", "commonPassword": "Password",
"commonBack": "Back", "commonBack": "Back",
"authForgotPasswordTitle": "Forgot password?", "authForgotPasswordTitle": "Forgot password?",
"authForgotPasswordResetPassword": "Reset password", "authForgotPasswordResetPassword": "Reset password",
"authForgotPasswordInstructions": "No worries, we'll send you reset instructions.", "createPassword": "Create your password",
"createPassword": "Create your password", "createAPassword": "Password",
"createAPassword": "Password", "authRegisterAlreadyHaveAccount": "Already have an account?",
"authRegisterAlreadyHaveAccount": "Already have an account?", "authRegisterLoginLink": "Log In",
"authRegisterLoginLink": "Log In", "commonAppName": "Checkmate",
"commonAppName": "Checkmate", "welcomeBack": "Welcome back! You're successfully logged in.",
"welcomeBack": "Welcome back! You're successfully logged in.", "authLoginEnterEmail": "Enter your email",
"authLoginEnterEmail": "Enter your email", "authRegisterTitle": "Create an account",
"authRegisterTitle": "Create an account", "authRegisterStepOneTitle": "Create your account",
"authRegisterStepOneTitle": "Create your account", "authRegisterStepOneDescription": "Enter your details to get started",
"authRegisterStepOneDescription": "Enter your details to get started", "authRegisterStepTwoTitle": "Set up your profile",
"authRegisterStepTwoTitle": "Set up your profile", "authRegisterStepTwoDescription": "Tell us more about yourself",
"authRegisterStepTwoDescription": "Tell us more about yourself", "authRegisterStepThreeTitle": "Almost done!",
"authRegisterStepThreeTitle": "Almost done!", "authRegisterStepThreeDescription": "Review your information",
"authRegisterStepThreeDescription": "Review your information", "authForgotPasswordDescription": "No worries, we'll send you reset instructions.",
"authForgotPasswordDescription": "No worries, we'll send you reset instructions.", "authForgotPasswordSendInstructions": "Send instructions",
"authForgotPasswordSendInstructions": "Send instructions", "authForgotPasswordBackTo": "Back to",
"authForgotPasswordBackTo": "Back to", "authCheckEmailTitle": "Check your email",
"authCheckEmailTitle": "Check your email", "authCheckEmailDescription": "We sent a password reset link to",
"authCheckEmailDescription": "We sent a password reset link to", "authCheckEmailResendEmail": "Resend email",
"authCheckEmailResendEmail": "Resend email", "authCheckEmailBackTo": "Back to",
"authCheckEmailBackTo": "Back to", "goBackTo": "Go back to",
"goBackTo": "Go back to", "authCheckEmailDidntReceiveEmail": "Didn't receive the email?",
"authCheckEmailDidntReceiveEmail": "Didn't receive the email?", "authCheckEmailClickToResend": "Click to resend",
"authCheckEmailClickToResend": "Click to resend", "authSetNewPasswordTitle": "Set new password",
"authSetNewPasswordTitle": "Set new password", "authSetNewPasswordDescription": "Your new password must be different from previously used passwords.",
"authSetNewPasswordDescription": "Your new password must be different from previously used passwords.", "authSetNewPasswordNewPassword": "New password",
"authSetNewPasswordNewPassword": "New password", "authSetNewPasswordConfirmPassword": "Confirm password",
"authSetNewPasswordConfirmPassword": "Confirm password", "confirmPassword": "Re-enter password to confirm",
"confirmPassword": "Re-enter password to confirm", "authSetNewPasswordResetPassword": "Reset password",
"authSetNewPasswordResetPassword": "Reset password", "authSetNewPasswordBackTo": "Back to",
"authSetNewPasswordBackTo": "Back to", "authPasswordMustBeAtLeast": "Must be at least",
"authPasswordMustBeAtLeast": "Must be at least", "authPasswordCharactersLong": "8 characters long",
"authPasswordCharactersLong": "8 characters long", "authPasswordMustContainAtLeast": "Must contain at least",
"authPasswordMustContainAtLeast": "Must contain at least", "authPasswordSpecialCharacter": "one special character",
"authPasswordSpecialCharacter": "one special character", "authPasswordOneNumber": "one number",
"authPasswordOneNumber": "one number", "authPasswordUpperCharacter": "one upper character",
"authPasswordUpperCharacter": "one upper character", "authPasswordLowerCharacter": "one lower character",
"authPasswordLowerCharacter": "one lower character", "authPasswordConfirmAndPassword": "Confirm password and password",
"authPasswordConfirmAndPassword": "Confirm password and password", "authPasswordMustMatch": "Passwords must match",
"authPasswordMustMatch": "Passwords must match", "validationNameRequired": "Please enter your name",
"validationNameRequired": "Please enter your name", "validationNameTooLong": "Name should be less than 50 characters",
"validationNameTooLong": "Name should be less than 50 characters", "validationNameInvalidCharacters": "Please use only letters, spaces, apostrophes, or hyphens",
"validationNameInvalidCharacters": "Please use only letters, spaces, apostrophes, or hyphens", "authRegisterCreateAccount": "Create your account to get started",
"authRegisterCreateAccount": "Create your account to get started", "authRegisterCreateSuperAdminAccount": "Create your super admin account to get started",
"authRegisterCreateSuperAdminAccount": "Create your super admin account to get started", "authRegisterSignUpWithEmail": "Create super admin account",
"authRegisterSignUpWithEmail": "Create super admin account", "authRegisterBySigningUp": "By creating an account, you agree to our <a1>Terms of Service</a1> and <a2>Privacy Policy</a2>.",
"authRegisterBySigningUp": "By creating an account, you agree to our <a1>Terms of Service</a1> and <a2>Privacy Policy</a2>.", "distributedStatusHeaderText": "Real-time, real-device coverage",
"distributedStatusHeaderText": "Real-time, real-device coverage", "distributedStatusSubHeaderText": "Powered by millions devices worldwide, view a system performance by global region, country or city",
"distributedStatusSubHeaderText": "Powered by millions devices worldwide, view a system performance by global region, country or city", "settingsGeneralSettings": "General settings",
"settingsGeneralSettings": "General settings", "settingsDisplayTimezone": "Display timezone",
"settingsDisplayTimezone": "Display timezone", "settingsDisplayTimezoneDescription": "Select the timezone used to display dates and times throughout the application.",
"settingsDisplayTimezoneDescription": "Select the timezone used to display dates and times throughout the application.", "settingsAppearance": "Appearance",
"settingsAppearance": "Appearance", "settingsAppearanceDescription": "Switch between light and dark mode, or change user interface language",
"settingsAppearanceDescription": "Switch between light and dark mode, or change user interface language", "settingsThemeMode": "Theme Mode",
"settingsThemeMode": "Theme Mode", "settingsLanguage": "Language",
"settingsThemeModeLight": "Light", "settingsDistributedUptime": "Distributed uptime",
"settingsThemeModeDark": "Dark", "settingsDistributedUptimeDescription": "Enable/disable distributed uptime monitoring.",
"settingsLanguage": "Language", "settingsEnabled": "Enabled",
"settingsDistributedUptime": "Distributed uptime", "settingsDisabled": "Disabled",
"settingsDistributedUptimeDescription": "Enable/disable distributed uptime monitoring.", "settingsHistoryAndMonitoring": "History of monitoring",
"settingsEnabled": "Enabled", "settingsHistoryAndMonitoringDescription": "Define how long you want to retain historical data. You can also clear all existing data.",
"settingsDisabled": "Disabled", "settingsTTLLabel": "The days you want to keep monitoring history.",
"settingsHistoryAndMonitoring": "History of monitoring", "settingsTTLOptionalLabel": "0 for infinite",
"settingsHistoryAndMonitoringDescription": "Define how long you want to retain historical data. You can also clear all existing data.", "settingsClearAllStats": "Clear all stats. This is irreversible.",
"settingsTTLLabel": "The days you want to keep monitoring history.", "settingsClearAllStatsButton": "Clear all stats",
"settingsTTLOptionalLabel": "0 for infinite", "settingsClearAllStatsDialogTitle": "Do you want to clear all stats?",
"settingsClearAllStats": "Clear all stats. This is irreversible.", "settingsClearAllStatsDialogDescription": "Once removed, the monitoring history and stats cannot be retrieved.",
"settingsClearAllStatsButton": "Clear all stats", "settingsClearAllStatsDialogConfirm": "Yes, clear all stats",
"settingsClearAllStatsDialogTitle": "Do you want to clear all stats?", "settingsDemoMonitors": "Demo monitors",
"settingsClearAllStatsDialogDescription": "Once removed, the monitoring history and stats cannot be retrieved.", "settingsDemoMonitorsDescription": "Add sample monitors for demonstration purposes.",
"settingsClearAllStatsDialogConfirm": "Yes, clear all stats", "settingsAddDemoMonitors": "Adding demo monitors",
"settingsDemoMonitors": "Demo monitors", "settingsAddDemoMonitorsButton": "Add demo monitors",
"settingsDemoMonitorsDescription": "Add sample monitors for demonstration purposes.", "settingsSystemReset": "System reset",
"settingsAddDemoMonitors": "Adding demo monitors", "settingsSystemResetDescription": "Remove all monitors from your system.",
"settingsAddDemoMonitorsButton": "Add demo monitors", "settingsRemoveAllMonitors": "Removing all monitors",
"settingsSystemReset": "System reset", "settingsRemoveAllMonitorsButton": "Remove all monitors",
"settingsSystemResetDescription": "Remove all monitors from your system.", "settingsRemoveAllMonitorsDialogTitle": "Do you want to remove all monitors?",
"settingsRemoveAllMonitors": "Removing all monitors", "settingsRemoveAllMonitorsDialogConfirm": "Yes, remove all monitors",
"settingsRemoveAllMonitorsButton": "Remove all monitors", "settingsWallet": "Wallet",
"settingsRemoveAllMonitorsDialogTitle": "Do you want to remove all monitors?", "settingsWalletDescription": "Connect your wallet here. This is required for the Distributed Uptime monitor to connect to multiple nodes globally.",
"settingsRemoveAllMonitorsDialogConfirm": "Yes, remove all monitors", "settingsAbout": "About",
"settingsWallet": "Wallet", "settingsDevelopedBy": "Developed by Bluewave Labs.",
"settingsWalletDescription": "Connect your wallet here. This is required for the Distributed Uptime monitor to connect to multiple nodes globally.", "settingsSave": "Save",
"settingsAbout": "About", "settingsSuccessSaved": "Settings saved successfully",
"settingsDevelopedBy": "Developed by Bluewave Labs.", "settingsFailedToSave": "Failed to save settings",
"settingsSave": "Save", "settingsStatsCleared": "Stats cleared successfully",
"settingsSuccessSaved": "Settings saved successfully", "settingsFailedToClearStats": "Failed to clear stats",
"settingsFailedToSave": "Failed to save settings", "settingsDemoMonitorsAdded": "Successfully added demo monitors",
"settingsStatsCleared": "Stats cleared successfully", "settingsFailedToAddDemoMonitors": "Failed to add demo monitors",
"settingsFailedToClearStats": "Failed to clear stats", "settingsMonitorsDeleted": "Successfully deleted all monitors",
"settingsDemoMonitorsAdded": "Successfully added demo monitors", "settingsFailedToDeleteMonitors": "Failed to delete all monitors",
"settingsFailedToAddDemoMonitors": "Failed to add demo monitors", "settingsEmail": "Email settings",
"settingsMonitorsDeleted": "Successfully deleted all monitors", "settingsEmailDescription": "Configure email settings",
"settingsFailedToDeleteMonitors": "Failed to delete all monitors", "settingsEmailHost": "Email host",
"backendUnreachable": "Server Connection Error", "settingsEmailPort": "Email port",
"backendUnreachableMessage": "We're unable to connect to the server. Please check your internet connection or verify your deployment configuration if the problem persists.", "settingsEmailAddress": "Email address",
"backendUnreachableError": "Cannot connect to the server. Please try again later.", "settingsEmailPassword": "Email password",
"retryConnection": "Retry connection", "settingsEmailUser": "Email user",
"retryingConnection": "Connecting...", "settingsEmailFieldResetLabel": "Password is set. Click Reset to change it.",
"backendReconnected": "Successfully reconnected to the server.", "backendUnreachable": "Server Connection Error",
"backendStillUnreachable": "Server is still unreachable. Please try again later.", "backendUnreachableMessage": "We're unable to connect to the server. Please check your internet connection or verify your deployment configuration if the problem persists.",
"backendConnectionError": "Error connecting to the server. Please check your network connection.", "backendUnreachableError": "Cannot connect to the server. Please try again later.",
"starPromptTitle": "Star Checkmate", "retryConnection": "Retry connection",
"starPromptDescription": "See the latest releases and help grow the community on GitHub", "retryingConnection": "Connecting...",
"https": "HTTPS", "backendReconnected": "Successfully reconnected to the server.",
"http": "HTTP", "backendStillUnreachable": "Server is still unreachable. Please try again later.",
"monitor": "monitor", "backendConnectionError": "Error connecting to the server. Please check your network connection.",
"aboutus": "About Us", "starPromptTitle": "Star Checkmate",
"starPromptDescription": "See the latest releases and help grow the community on GitHub",
"https": "HTTPS",
"http": "HTTP",
"monitor": "monitor",
"aboutus": "About Us",
"now": "Now", "now": "Now",
"delete": "Delete", "delete": "Delete",
"configure": "Configure", "configure": "Configure",
"networkError": "Network error", "networkError": "Network error",
"responseTime": "Response time", "responseTime": "Response time",
"ms": "ms", "ms": "ms",
"bar": "Bar", "bar": "Bar",
"area": "Area", "area": "Area",
"country": "COUNTRY", "country": "COUNTRY",
"city": "CITY", "city": "CITY",
"response": "RESPONSE", "response": "RESPONSE",
"checkConnection": "Please check your connection", "checkConnection": "Please check your connection",
"passwordreset": "Password Reset", "passwordreset": "Password Reset",
"authRegisterStepOnePersonalDetails": "Enter your personal details", "authRegisterStepOnePersonalDetails": "Enter your personal details",
"authCheckEmailOpenEmailButton": "Open email app", "authCheckEmailOpenEmailButton": "Open email app",
"authNewPasswordConfirmed": "Your password has been successfully reset. Click below to log in magically.", "authNewPasswordConfirmed": "Your password has been successfully reset. Click below to log in magically.",
"monitorStatusUp": "Monitor {name} ({url}) is now UP and responding", "monitorStatusUp": "Monitor {name} ({url}) is now UP and responding",
"monitorStatusDown": "Monitor {name} ({url}) is DOWN and not responding", "monitorStatusDown": "Monitor {name} ({url}) is DOWN and not responding",
"webhookSendSuccess": "Webhook notification sent successfully", "webhookSendSuccess": "Webhook notification sent successfully",
"webhookSendError": "Error sending webhook notification to {platform}", "webhookSendError": "Error sending webhook notification to {platform}",
"webhookUnsupportedPlatform": "Unsupported platform: {platform}", "webhookUnsupportedPlatform": "Unsupported platform: {platform}",
"distributedRightCategoryTitle": "Monitor", "distributedRightCategoryTitle": "Monitor",
"distributedStatusServerMonitors": "Server Monitors", "distributedStatusServerMonitors": "Server Monitors",
"distributedStatusServerMonitorsDescription": "Monitor status of related servers", "distributedStatusServerMonitorsDescription": "Monitor status of related servers",
"distributedUptimeCreateSelectURL": "Here you can select the URL of the host, together with the type of monitor.", "distributedUptimeCreateSelectURL": "Here you can select the URL of the host, together with the type of monitor.",
"distributedUptimeCreateChecks": "Checks to perform", "distributedUptimeCreateChecks": "Checks to perform",
"distributedUptimeCreateChecksDescription": "You can always add or remove checks after adding your site.", "distributedUptimeCreateChecksDescription": "You can always add or remove checks after adding your site.",
"distributedUptimeCreateIncidentNotification": "Incident notifications", "distributedUptimeCreateIncidentNotification": "Incident notifications",
"distributedUptimeCreateIncidentDescription": "When there is an incident, notify users.", "distributedUptimeCreateIncidentDescription": "When there is an incident, notify users.",
"distributedUptimeCreateAdvancedSettings": "Advanced settings", "distributedUptimeCreateAdvancedSettings": "Advanced settings",
"distributedUptimeDetailsNoMonitorHistory": "There is no check history for this monitor yet.", "distributedUptimeDetailsNoMonitorHistory": "There is no check history for this monitor yet.",
"distributedUptimeDetailsFooterHeading": "Made with ❤️ by UpRock & Bluewave Labs", "distributedUptimeDetailsFooterHeading": "Made with ❤️ by UpRock & Bluewave Labs",
"distributedUptimeDetailsFooterBuilt": "Built on", "distributedUptimeDetailsFooterBuilt": "Built on",
"distributedUptimeDetailsFooterSolana": "Solana", "distributedUptimeDetailsFooterSolana": "Solana",
"distributedUptimeDetailsMonitorHeader": "Distributed Uptime Monitoring powered by DePIN", "distributedUptimeDetailsMonitorHeader": "Distributed Uptime Monitoring powered by DePIN",
"distributedUptimeDetailsStatusHeaderUptime": "Uptime:", "distributedUptimeDetailsStatusHeaderUptime": "Uptime:",
"distributedUptimeDetailsStatusHeaderLastUpdate": "Last updated", "distributedUptimeDetailsStatusHeaderLastUpdate": "Last updated",
"notifications": { "notifications": {
"enableNotifications": "Enable {{platform}} notifications", "enableNotifications": "Enable {{platform}} notifications",
"testNotification": "Test notification", "testNotification": "Test notification",
"addOrEditNotifications": "Add or edit notifications", "addOrEditNotifications": "Add or edit notifications",
"slack": { "slack": {
"label": "Slack", "label": "Slack",
"description": "To enable Slack notifications, create a Slack app and enable incoming webhooks. After that, simply provide the webhook URL here.", "description": "To enable Slack notifications, create a Slack app and enable incoming webhooks. After that, simply provide the webhook URL here.",
"webhookLabel": "Webhook URL", "webhookLabel": "Webhook URL",
"webhookPlaceholder": "https://hooks.slack.com/services/...", "webhookPlaceholder": "https://hooks.slack.com/services/...",
"webhookRequired": "Slack webhook URL is required" "webhookRequired": "Slack webhook URL is required"
}, },
"discord": { "discord": {
"label": "Discord", "label": "Discord",
"description": "To send data to a Discord channel from Checkmate via Discord notifications using webhooks, you can use Discord's incoming Webhooks feature.", "description": "To send data to a Discord channel from Checkmate via Discord notifications using webhooks, you can use Discord's incoming Webhooks feature.",
"webhookLabel": "Discord Webhook URL", "webhookLabel": "Discord Webhook URL",
"webhookPlaceholder": "https://discord.com/api/webhooks/...", "webhookPlaceholder": "https://discord.com/api/webhooks/...",
"webhookRequired": "Discord webhook URL is required" "webhookRequired": "Discord webhook URL is required"
}, },
"telegram": { "telegram": {
"label": "Telegram", "label": "Telegram",
"description": "To enable Telegram notifications, create a Telegram bot using BotFather, an official bot for creating and managing Telegram bots. Then, get the API token and chat ID and write them down here.", "description": "To enable Telegram notifications, create a Telegram bot using BotFather, an official bot for creating and managing Telegram bots. Then, get the API token and chat ID and write them down here.",
"tokenLabel": "Your bot token", "tokenLabel": "Your bot token",
"tokenPlaceholder": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11", "tokenPlaceholder": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11",
"chatIdLabel": "Your Chat ID", "chatIdLabel": "Your Chat ID",
"chatIdPlaceholder": "-1001234567890", "chatIdPlaceholder": "-1001234567890",
"fieldsRequired": "Telegram token and chat ID are required" "fieldsRequired": "Telegram token and chat ID are required"
}, },
"webhook": { "webhook": {
"label": "Webhooks", "label": "Webhooks",
"description": "You can set up a custom webhook to receive notifications when incidents occur.", "description": "You can set up a custom webhook to receive notifications when incidents occur.",
"urlLabel": "Webhook URL", "urlLabel": "Webhook URL",
"urlPlaceholder": "https://your-server.com/webhook", "urlPlaceholder": "https://your-server.com/webhook",
"urlRequired": "Webhook URL is required" "urlRequired": "Webhook URL is required"
}, },
"testNotificationDevelop": "Test notification 2", "testNotificationDevelop": "Test notification 2",
"integrationButton": "Notification Integration", "integrationButton": "Notification Integration",
"testSuccess": "Test notification sent successfully!", "testSuccess": "Test notification sent successfully!",
"testFailed": "Failed to send test notification", "testFailed": "Failed to send test notification",
"unsupportedType": "Unsupported notification type", "unsupportedType": "Unsupported notification type",
"networkError": "Network error occurred" "networkError": "Network error occurred"
}, },
"testLocale": "testLocale", "testLocale": "testLocale",
"add": "Add", "add": "Add",
"monitors": "monitors", "monitors": "monitors",
"distributedUptimeStatusCreateStatusPage": "status page", "distributedUptimeStatusCreateStatusPage": "status page",
"distributedUptimeStatusCreateStatusPageAccess": "Access", "distributedUptimeStatusCreateStatusPageAccess": "Access",
"distributedUptimeStatusCreateStatusPageReady": "If your status page is ready, you can mark it as published.", "distributedUptimeStatusCreateStatusPageReady": "If your status page is ready, you can mark it as published.",
"distributedUptimeStatusBasicInfoHeader": "Basic Information", "distributedUptimeStatusBasicInfoHeader": "Basic Information",
"distributedUptimeStatusBasicInfoDescription": "Define company name and the subdomain that your status page points to.", "distributedUptimeStatusBasicInfoDescription": "Define company name and the subdomain that your status page points to.",
"distributedUptimeStatusLogoHeader": "Logo", "distributedUptimeStatusLogoHeader": "Logo",
"distributedUptimeStatusLogoDescription": "Upload a logo for your status page", "distributedUptimeStatusLogoDescription": "Upload a logo for your status page",
"distributedUptimeStatusLogoUploadButton": "Upload logo", "distributedUptimeStatusLogoUploadButton": "Upload logo",
"distributedUptimeStatusStandardMonitorsHeader": "Standard Monitors", "distributedUptimeStatusStandardMonitorsHeader": "Standard Monitors",
"distributedUptimeStatusStandardMonitorsDescription": "Attach standard monitors to your status page.", "distributedUptimeStatusStandardMonitorsDescription": "Attach standard monitors to your status page.",
"distributedUptimeStatusCreateYour": "Create your", "distributedUptimeStatusCreateYour": "Create your",
"distributedUptimeStatusEditYour": "Edit your", "distributedUptimeStatusEditYour": "Edit your",
"distributedUptimeStatusPublishedLabel": "Published and visible to the public", "distributedUptimeStatusPublishedLabel": "Published and visible to the public",
"distributedUptimeStatusCompanyNameLabel": "Company name", "distributedUptimeStatusCompanyNameLabel": "Company name",
"distributedUptimeStatusPageAddressLabel": "Your status page address", "distributedUptimeStatusPageAddressLabel": "Your status page address",
"distributedUptimeStatus30Days": "30 days", "distributedUptimeStatus30Days": "30 days",
"distributedUptimeStatus60Days": "60 days", "distributedUptimeStatus60Days": "60 days",
"distributedUptimeStatus90Days": "90 days", "distributedUptimeStatus90Days": "90 days",
"distributedUptimeStatusPageNotSetUp": "A status page is not set up.", "distributedUptimeStatusPageNotSetUp": "A status page is not set up.",
"distributedUptimeStatusContactAdmin": "Please contact your administrator", "distributedUptimeStatusContactAdmin": "Please contact your administrator",
"distributedUptimeStatusPageNotPublic": "This status page is not public.", "distributedUptimeStatusPageNotPublic": "This status page is not public.",
"distributedUptimeStatusPageDeleteDialog": "Do you want to delete this status page?", "distributedUptimeStatusPageDeleteDialog": "Do you want to delete this status page?",
"distributedUptimeStatusPageDeleteConfirm": "Yes, delete status page", "distributedUptimeStatusPageDeleteConfirm": "Yes, delete status page",
"distributedUptimeStatusPageDeleteDescription": "Once deleted, your status page cannot be retrieved.", "distributedUptimeStatusPageDeleteDescription": "Once deleted, your status page cannot be retrieved.",
"distributedUptimeStatusDevices": "Devices", "distributedUptimeStatusDevices": "Devices",
"distributedUptimeStatusUpt": "UPT", "distributedUptimeStatusUpt": "UPT",
"distributedUptimeStatusUptBurned": "UPT Burned", "distributedUptimeStatusUptBurned": "UPT Burned",
"distributedUptimeStatusUptLogo": "Upt Logo", "distributedUptimeStatusUptLogo": "Upt Logo",
"incidentsTableNoIncidents": "No incidents recorded", "incidentsTableNoIncidents": "No incidents recorded",
"incidentsTablePaginationLabel": "incidents", "incidentsTablePaginationLabel": "incidents",
"incidentsTableMonitorName": "Monitor Name", "incidentsTableMonitorName": "Monitor Name",
"incidentsTableStatus": "Status", "incidentsTableStatus": "Status",
"incidentsTableDateTime": "Date & Time", "incidentsTableDateTime": "Date & Time",
"incidentsTableStatusCode": "Status Code", "incidentsTableStatusCode": "Status Code",
"incidentsTableMessage": "Message", "incidentsTableMessage": "Message",
"incidentsOptionsHeader": "Incidents for:", "incidentsOptionsHeader": "Incidents for:",
"incidentsOptionsHeaderFilterBy": "Filter by:", "incidentsOptionsHeaderFilterBy": "Filter by:",
"incidentsOptionsHeaderFilterAll": "All", "incidentsOptionsHeaderFilterAll": "All",
"incidentsOptionsHeaderFilterDown": "Down", "incidentsOptionsHeaderFilterDown": "Down",
"incidentsOptionsHeaderFilterCannotResolve": "Cannot resolve", "incidentsOptionsHeaderFilterCannotResolve": "Cannot resolve",
"incidentsOptionsHeaderShow": "Show:", "incidentsOptionsHeaderShow": "Show:",
"incidentsOptionsHeaderLastHour": "Last hour", "incidentsOptionsHeaderLastHour": "Last hour",
"incidentsOptionsHeaderLastDay": "Last day", "incidentsOptionsHeaderLastDay": "Last day",
"incidentsOptionsHeaderLastWeek": "Last week", "incidentsOptionsHeaderLastWeek": "Last week",
"incidentsOptionsPlaceholderAllServers": "All servers", "incidentsOptionsPlaceholderAllServers": "All servers",
"infrastructureCreateYour": "Create your", "infrastructureCreateYour": "Create your",
"infrastructureCreateGeneralSettingsDescription": "Here you can select the URL of the host, together with the friendly name and authorization secret to connect to the server agent.", "infrastructureCreateGeneralSettingsDescription": "Here you can select the URL of the host, together with the friendly name and authorization secret to connect to the server agent.",
"infrastructureServerRequirement": "The server you are monitoring must be running the", "infrastructureServerRequirement": "The server you are monitoring must be running the",
"infrastructureCustomizeAlerts": "Customize alerts", "infrastructureCustomizeAlerts": "Customize alerts",
"infrastructureAlertNotificationDescription": "Send a notification to user(s) when thresholds exceed a specified percentage.", "infrastructureAlertNotificationDescription": "Send a notification to user(s) when thresholds exceed a specified percentage.",
"infrastructureCreateMonitor": "Create Infrastructure Monitor", "infrastructureCreateMonitor": "Create Infrastructure Monitor",
"infrastructureProtocol": "Protocol", "infrastructureProtocol": "Protocol",
"infrastructureServerUrlLabel": "Server URL", "infrastructureServerUrlLabel": "Server URL",
"infrastructureDisplayNameLabel": "Display name", "infrastructureDisplayNameLabel": "Display name",
"infrastructureAuthorizationSecretLabel": "Authorization secret", "infrastructureAuthorizationSecretLabel": "Authorization secret",
"gb": "GB", "gb": "GB",
"mb": "MB", "mb": "MB",
"mem": "Mem", "mem": "Mem",
"memoryUsage": "Memory usage", "memoryUsage": "Memory usage",
"cpu": "CPU", "cpu": "CPU",
"cpuUsage": "CPU usage", "cpuUsage": "CPU usage",
"cpuTemperature": "CPU Temperature", "cpuTemperature": "CPU Temperature",
"diskUsage": "Disk Usage", "diskUsage": "Disk Usage",
"used": "Used", "used": "Used",
"total": "Total", "total": "Total",
"cores": "Cores", "cores": "Cores",
"frequency": "Frequency", "frequency": "Frequency",
"status": "Status", "status": "Status",
"cpuPhysical": "CPU (Physical)", "cpuPhysical": "CPU (Physical)",
"cpuLogical": "CPU (Logical)", "cpuLogical": "CPU (Logical)",
"cpuFrequency": "CPU Frequency", "cpuFrequency": "CPU Frequency",
"avgCpuTemperature": "Average CPU Temperature", "avgCpuTemperature": "Average CPU Temperature",
"memory": "Memory", "memory": "Memory",
"disk": "Disk", "disk": "Disk",
"uptime": "Uptime", "uptime": "Uptime",
"os": "OS", "os": "OS",
"host": "Host", "host": "Host",
"actions": "Actions", "actions": "Actions",
"integrations": "Integrations", "integrations": "Integrations",
"integrationsPrism": "Connect Prism to your favorite service.", "integrationsPrism": "Connect Prism to your favorite service.",
"integrationsSlack": "Slack", "integrationsSlack": "Slack",
"integrationsSlackInfo": "Connect with Slack and see incidents in a channel", "integrationsSlackInfo": "Connect with Slack and see incidents in a channel",
"integrationsDiscord": "Discord", "integrationsDiscord": "Discord",
"integrationsDiscordInfo": "Connect with Discord and view incidents directly in a channel", "integrationsDiscordInfo": "Connect with Discord and view incidents directly in a channel",
"integrationsZapier": "Zapier", "integrationsZapier": "Zapier",
"integrationsZapierInfo": "Send all incidents to Zapier, and then see them everywhere", "integrationsZapierInfo": "Send all incidents to Zapier, and then see them everywhere",
"commonSave": "Save", "commonSave": "Save",
"createYour": "Create your", "createYour": "Create your",
"createMonitor": "Create monitor", "createMonitor": "Create monitor",
"pause": "Pause", "pause": "Pause",
"resume": "Resume", "resume": "Resume",
"editing": "Editing...", "editing": "Editing...",
"url": "URL", "url": "URL",
"access": "Access", "access": "Access",
"timezone": "Timezone", "timezone": "Timezone",
"features": "Features", "features": "Features",
"administrator": "Administrator?", "administrator": "Administrator?",
"loginHere": "Login here", "loginHere": "Login here",
"displayName": "Display name", "displayName": "Display name",
"urlMonitor": "URL to monitor", "urlMonitor": "URL to monitor",
"portToMonitor": "Port to monitor", "portToMonitor": "Port to monitor",
"websiteMonitoring": "Website monitoring", "websiteMonitoring": "Website monitoring",
"websiteMonitoringDescription": "Use HTTP(s) to monitor your website or API endpoint.", "websiteMonitoringDescription": "Use HTTP(s) to monitor your website or API endpoint.",
"pingMonitoring": "Ping monitoring", "pingMonitoring": "Ping monitoring",
"pingMonitoringDescription": "Check whether your server is available or not.", "pingMonitoringDescription": "Check whether your server is available or not.",
"dockerContainerMonitoring": "Docker container monitoring", "dockerContainerMonitoring": "Docker container monitoring",
"dockerContainerMonitoringDescription": "Check whether your Docker container is running or not.", "dockerContainerMonitoringDescription": "Check whether your Docker container is running or not.",
"portMonitoring": "Port monitoring", "portMonitoring": "Port monitoring",
"portMonitoringDescription": "Check whether your port is open or not.", "portMonitoringDescription": "Check whether your port is open or not.",
"createMaintenanceWindow": "Create maintenance window", "createMaintenanceWindow": "Create maintenance window",
"createMaintenance": "Create maintenance", "createMaintenance": "Create maintenance",
"editMaintenance": "Edit maintenance", "editMaintenance": "Edit maintenance",
"maintenanceWindowName": "Maintenance Window Name", "maintenanceWindowName": "Maintenance Window Name",
"friendlyNameInput": "Friendly name", "friendlyNameInput": "Friendly name",
"friendlyNamePlaceholder": "Maintenance at __ : __ for ___ minutes", "friendlyNamePlaceholder": "Maintenance at __ : __ for ___ minutes",
"maintenanceRepeat": "Maintenance Repeat", "maintenanceRepeat": "Maintenance Repeat",
"maintenance": "maintenance", "maintenance": "maintenance",
"duration": "Duration", "duration": "Duration",
"addMonitors": "Add monitors", "addMonitors": "Add monitors",
"window": "window", "window": "window",
"cancel": "Cancel", "cancel": "Cancel",
"message": "Message", "message": "Message",
"low": "low", "low": "low",
"high": "high", "high": "high",
"statusCode": "Status code", "statusCode": "Status code",
"date&Time": "Date & Time", "date&Time": "Date & Time",
"type": "Type", "type": "Type",
"statusPageName": "Status page name", "statusPageName": "Status page name",
"publicURL": "Public URL", "publicURL": "Public URL",
"repeat": "Repeat", "repeat": "Repeat",
"edit": "Edit", "edit": "Edit",
"createA": "Create a", "createA": "Create a",
"remove": "Remove", "remove": "Remove",
"maintenanceWindowDescription": "Your pings won't be sent during this time frame", "maintenanceWindowDescription": "Your pings won't be sent during this time frame",
"startTime": "Start time", "startTime": "Start time",
"timeZoneInfo": "All dates and times are in GMT+0 time zone.", "timeZoneInfo": "All dates and times are in GMT+0 time zone.",
"monitorsToApply": "Monitors to apply maintenance window to", "monitorsToApply": "Monitors to apply maintenance window to",
"nextWindow": "Next window", "nextWindow": "Next window",
"notFoundButton": "Go to the main dashboard", "notFoundButton": "Go to the main dashboard",
"pageSpeedConfigureSettingsDescription": "Here you can select the URL of the host, together with the type of monitor.", "pageSpeedConfigureSettingsDescription": "Here you can select the URL of the host, together with the type of monitor.",
"monitorDisplayName": "Monitor display name", "monitorDisplayName": "Monitor display name",
"whenNewIncident": "When there is a new incident,", "whenNewIncident": "When there is a new incident,",
"notifySMS": "Notify via SMS (coming soon)", "notifySMS": "Notify via SMS (coming soon)",
"notifyEmails": "Also notify via email to multiple addresses (coming soon)", "notifyEmails": "Also notify via email to multiple addresses (coming soon)",
"seperateEmails": "You can separate multiple emails with a comma", "seperateEmails": "You can separate multiple emails with a comma",
"checkFrequency": "Check frequency", "checkFrequency": "Check frequency",
"matchMethod": "Match Method", "matchMethod": "Match Method",
"expectedValue": "Expected value", "expectedValue": "Expected value",
"deleteDialogTitle": "Do you really want to delete this monitor?", "deleteDialogTitle": "Do you really want to delete this monitor?",
"deleteDialogDescription": "Once deleted, this monitor cannot be retrieved.", "deleteDialogDescription": "Once deleted, this monitor cannot be retrieved.",
"pageSpeedMonitor": "PageSpeed monitor", "pageSpeedMonitor": "PageSpeed monitor",
"shown": "Shown", "shown": "Shown",
"ago": "ago", "ago": "ago",
"companyName": "Company name", "companyName": "Company name",
"pageSpeedDetailsPerformanceReport": "Values are estimated and may vary.", "pageSpeedDetailsPerformanceReport": "Values are estimated and may vary.",
"pageSpeedDetailsPerformanceReportCalculator": "See calculator", "pageSpeedDetailsPerformanceReportCalculator": "See calculator",
"checkingEvery": "Checking every", "checkingEvery": "Checking every",
"statusPageCreateSettings": "If your status page is ready, you can mark it as published.", "statusPageCreateSettings": "If your status page is ready, you can mark it as published.",
"basicInformation": "Basic Information", "basicInformation": "Basic Information",
"statusPageCreateBasicInfoDescription": "Define company name and the subdomain that your status page points to.", "statusPageCreateBasicInfoDescription": "Define company name and the subdomain that your status page points to.",
"statusPageCreateSelectTimeZoneDescription": "Select the timezone that your status page will be displayed in.", "statusPageCreateSelectTimeZoneDescription": "Select the timezone that your status page will be displayed in.",
"statusPageCreateAppearanceDescription": "Define the default look and feel of your public status page.", "statusPageCreateAppearanceDescription": "Define the default look and feel of your public status page.",
"statusPageCreateSettingsCheckboxLabel": "Published and visible to the public", "statusPageCreateSettingsCheckboxLabel": "Published and visible to the public",
"statusPageCreateBasicInfoStatusPageAddress": "Your status page address", "statusPageCreateBasicInfoStatusPageAddress": "Your status page address",
"statusPageCreateTabsContent": "Status page servers", "statusPageCreateTabsContent": "Status page servers",
"statusPageCreateTabsContentDescription": "You can add any number of servers that you monitor to your status page. You can also reorder them for the best viewing experience.", "statusPageCreateTabsContentDescription": "You can add any number of servers that you monitor to your status page. You can also reorder them for the best viewing experience.",
"statusPageCreateTabsContentFeaturesDescription": "Show more details on the status page", "statusPageCreateTabsContentFeaturesDescription": "Show more details on the status page",
"showCharts": "Show charts", "showCharts": "Show charts",
"showUptimePercentage": "Show uptime percentage", "showUptimePercentage": "Show uptime percentage",
"removeLogo": "Remove Logo", "removeLogo": "Remove Logo",
"statusPageStatus": "A public status page is not set up.", "statusPageStatus": "A public status page is not set up.",
"statusPageStatusContactAdmin": "Please contact to your administrator", "statusPageStatusContactAdmin": "Please contact to your administrator",
"statusPageStatusNotPublic": "This status page is not public.", "statusPageStatusNotPublic": "This status page is not public.",
"statusPageStatusNoPage": "There's no status page here.", "statusPageStatusNoPage": "There's no status page here.",
"statusPageStatusServiceStatus": "Service status", "statusPageStatusServiceStatus": "Service status",
"deleteStatusPage": "Do you want to delete this status page?", "deleteStatusPage": "Do you want to delete this status page?",
"deleteStatusPageConfirm": "Yes, delete status page", "deleteStatusPageConfirm": "Yes, delete status page",
"deleteStatusPageDescription": "Once deleted, your status page cannot be retrieved.", "deleteStatusPageDescription": "Once deleted, your status page cannot be retrieved.",
"uptimeCreate": "The expected value is used to match against response result, and the match determines the status.", "uptimeCreate": "The expected value is used to match against response result, and the match determines the status.",
"uptimeCreateJsonPath": "This expression will be evaluated against the reponse JSON data and the result will be used to match against the expected value. See", "uptimeCreateJsonPath": "This expression will be evaluated against the reponse JSON data and the result will be used to match against the expected value. See",
"uptimeCreateJsonPathQuery": "for query language documentation.", "uptimeCreateJsonPathQuery": "for query language documentation.",
"maintenanceTableActionMenuDialogTitle": "Do you really want to remove this maintenance window?", "maintenanceTableActionMenuDialogTitle": "Do you really want to remove this maintenance window?",
"infrastructureEditYour": "Edit your", "infrastructureEditYour": "Edit your",
"infrastructureEditMonitor": "Save Infrastructure Monitor", "infrastructureEditMonitor": "Save Infrastructure Monitor",
"infrastructureMonitorCreated": "Infrastructure monitor created successfully!", "infrastructureMonitorCreated": "Infrastructure monitor created successfully!",
"infrastructureMonitorUpdated": "Infrastructure monitor updated successfully!", "infrastructureMonitorUpdated": "Infrastructure monitor updated successfully!",
"errorInvalidTypeId": "Invalid notification type provided", "errorInvalidTypeId": "Invalid notification type provided",
"errorInvalidFieldId": "Invalid field ID provided", "errorInvalidFieldId": "Invalid field ID provided",
"inviteNoTokenFound": "No invite token found", "inviteNoTokenFound": "No invite token found",
"pageSpeedWarning": "Warning: You haven't added a Google PageSpeed API key yet. Without it, the PageSpeed monitor won't function.", "pageSpeedWarning": "Warning: You haven't added a Google PageSpeed API key yet. Without it, the PageSpeed monitor won't function.",
"pageSpeedLearnMoreLink": "Click here", "pageSpeedLearnMoreLink": "Click here",
"pageSpeedAddApiKey": "to add your API key.", "pageSpeedAddApiKey": "to add your API key.",
"update": "Update", "update": "Update",
"invalidFileFormat": "Unsupported file format!", "invalidFileFormat": "Unsupported file format!",
"invalidFileSize": "File size is too large!", "invalidFileSize": "File size is too large!",
"ClickUpload": "Click to upload", "ClickUpload": "Click to upload",
"DragandDrop": "drag and drop", "DragandDrop": "drag and drop",
"MaxSize": "Maximum Size", "MaxSize": "Maximum Size",
"SupportedFormats": "Supported formats", "SupportedFormats": "Supported formats",
"FirstName": "First name", "FirstName": "First name",
"LastName": "Last name", "LastName": "Last name",
"EmailDescriptionText": "This is your current email address — it cannot be changed.", "EmailDescriptionText": "This is your current email address — it cannot be changed.",
"ignoreTLSError": "Ignore TLS/SSL error", "ignoreTLSError": "Ignore TLS/SSL error",
"tlsErrorIgnored": "TLS/SSL errors ignored", "tlsErrorIgnored": "TLS/SSL errors ignored",
"ignoreTLSErrorDescription": "Ignore TLS/SSL errors and continue checking the website's availability", "ignoreTLSErrorDescription": "Ignore TLS/SSL errors and continue checking the website's availability",
"YourPhoto": "Profile photo", "YourPhoto": "Profile photo",
"PhotoDescriptionText": "This photo will be displayed in your profile page.", "PhotoDescriptionText": "This photo will be displayed in your profile page.",
"save": "Save", "save": "Save",
"DeleteAccountTitle": "Remove account", "DeleteAccountTitle": "Remove account",
"DeleteAccountButton": "Remove account", "DeleteAccountButton": "Remove account",
"DeleteDescriptionText": "This will remove the account and all associated data from the server. This isn't reversible.", "DeleteDescriptionText": "This will remove the account and all associated data from the server. This isn't reversible.",
"DeleteAccountWarning": "Removing your account means you won't be able to sign in again and all your data will be removed. This isn't reversible.", "DeleteAccountWarning": "Removing your account means you won't be able to sign in again and all your data will be removed. This isn't reversible.",
"DeleteWarningTitle": "Really remove this account?", "DeleteWarningTitle": "Really remove this account?",
"authRegisterFirstName": "Name", "authRegisterFirstName": "Name",
"authRegisterLastName": "Surname", "authRegisterLastName": "Surname",
"authRegisterEmail": "Email", "authRegisterEmail": "Email",
"authRegisterEmailRequired": "To continue, please enter your email address", "authRegisterEmailRequired": "To continue, please enter your email address",
"authRegisterEmailInvalid": "Please enter a valid email address", "authRegisterEmailInvalid": "Please enter a valid email address",
"bulkImport": { "bulkImport": {
"title": "Bulk Import", "title": "Bulk Import",
"selectFileTips": "Select CSV file to upload", "selectFileTips": "Select CSV file to upload",
"selectFileDescription": "You can download our <template>template</template> or <sample>sample</sample>", "selectFileDescription": "You can download our <template>template</template> or <sample>sample</sample>",
"selectFile": "Select File", "selectFile": "Select File",
"parsingFailed": "Parsing failed", "parsingFailed": "Parsing failed",
"uploadSuccess": "Monitors created successfully!", "uploadSuccess": "Monitors created successfully!",
"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", "publicLink": "Public link",
"maskedPageSpeedKeyPlaceholder": "*************************************", "maskedPageSpeedKeyPlaceholder": "*************************************",
"pageSpeedApiKeyFieldTitle": "Google PageSpeed API key", "pageSpeedApiKeyFieldTitle": "Google PageSpeed API key",
"pageSpeedApiKeyFieldLabel": "PageSpeed API key", "pageSpeedApiKeyFieldLabel": "PageSpeed API key",
"pageSpeedApiKeyFieldDescription": "Enter your Google PageSpeed API key to enable pagespeed monitoring. Click Reset to update the key.", "pageSpeedApiKeyFieldDescription": "Enter your Google PageSpeed API key to enable pagespeed monitoring. Click Reset to update the key.",
"pageSpeedApiKeyFieldResetLabel": "API key is set. Click Reset to change it.", "pageSpeedApiKeyFieldResetLabel": "API key is set. Click Reset to change it.",
"reset": "Reset",
"statusBreadCrumbsStatusPages": "Status Pages", "reset": "Reset",
"statusBreadCrumbsDetails": "Details", "createNew": "Create new",
"uptimeCreateSelectURL": "Enter the URL or IP to monitor (e.g., https://example.com/ or 192.168.1.100) and add a clear display name that appears on the dashboard.", "greeting": {
"navControls": "Controls" "prepend": "Hey there",
"append": "The afternoon is your playground—let's make it epic!",
"overview": "Here's an overview of your {{type}} monitors."
},
"monitorStatus": {
"up": "up",
"down": "down",
"paused": "paused"
},
"roles": {
"superAdmin": "Super admin",
"admin": "Admin",
"teamMember": "Team member",
"demoUser": "Demo user"
},
"teamPanel": {
"teamMembers": "Team members",
"filter": {
"all": "All",
"member": "Member"
},
"inviteTeamMember": "Invite a team member",
"inviteNewTeamMember": "Invite new team member",
"inviteDescription": "When you add a new team member, they will get access to all monitors.",
"email": "Email",
"selectRole": "Select role",
"inviteLink": "Invite link",
"cancel": "Cancel",
"noMembers": "There are no team members with this role",
"getToken": "Get token",
"emailToken": "E-mail token",
"table": {
"name": "Name",
"email": "Email",
"role": "Role",
"created": "Created"
}
},
"monitorState": {
"paused": "paused",
"resumed": "resumed",
"active": "active"
},
"menu": {
"uptime": "Uptime",
"pagespeed": "Pagespeed",
"infrastructure": "Infrastructure",
"distributedUptime": "Distributed uptime",
"incidents": "Incidents",
"statusPages": "Status pages",
"maintenance": "Maintenance",
"integrations": "Integrations",
"settings": "Settings",
"support": "Support",
"discussions": "Discussions",
"docs": "Docs",
"changelog": "Changelog",
"profile": "Profile",
"password": "Password",
"team": "Team"
}
} }
+75 -11
View File
@@ -16,7 +16,6 @@
"commonBack": "Назад", "commonBack": "Назад",
"authForgotPasswordTitle": "Забыли пароль?", "authForgotPasswordTitle": "Забыли пароль?",
"authForgotPasswordResetPassword": "Сбросить пароль", "authForgotPasswordResetPassword": "Сбросить пароль",
"authForgotPasswordInstructions": "Не волнуйтесь, мы отправим вам инструкции по сбросу пароля.",
"createPassword": "Создайте свой пароль", "createPassword": "Создайте свой пароль",
"createAPassword": "Пароль", "createAPassword": "Пароль",
"authRegisterAlreadyHaveAccount": "Уже есть аккаунт?", "authRegisterAlreadyHaveAccount": "Уже есть аккаунт?",
@@ -66,7 +65,18 @@
"authRegisterLastName": "Фамилия", "authRegisterLastName": "Фамилия",
"authRegisterEmail": "Эл. почта", "authRegisterEmail": "Эл. почта",
"authRegisterEmailRequired": "Чтобы продолжить, пожалуйста, введите ваш адрес электронной почты", "authRegisterEmailRequired": "Чтобы продолжить, пожалуйста, введите ваш адрес электронной почты",
"authRegisterEmailInvalid": "Пожалуйста, введите корректный адрес электронной почты", "authRegisterEmailInvalid": "Пожалуйста, введите действительный адрес электронной почты",
"bulkImport": {
"title": "Массовый импорт",
"selectFileTips": "Выберите CSV-файл для загрузки",
"selectFileDescription": "Вы можете скачать наш <template>шаблон</template> или <sample>пример</sample>",
"selectFile": "Выбрать файл",
"parsingFailed": "Ошибка анализа",
"uploadSuccess": "Мониторы успешно созданы!",
"validationFailed": "Ошибка проверки",
"noFileSelected": "Файл не выбран",
"fallbackPage": "Импортируйте файл для загрузки списка серверов"
},
"distributedStatusHeaderText": "Охват реального времени и реального устройства", "distributedStatusHeaderText": "Охват реального времени и реального устройства",
"distributedStatusSubHeaderText": "Работает на миллионах устройств по всему миру, просматривайте производительность системы по глобальному региону, стране или городу", "distributedStatusSubHeaderText": "Работает на миллионах устройств по всему миру, просматривайте производительность системы по глобальному региону, стране или городу",
"settingsGeneralSettings": "Общие настройки", "settingsGeneralSettings": "Общие настройки",
@@ -75,8 +85,6 @@
"settingsAppearance": "Внешний вид", "settingsAppearance": "Внешний вид",
"settingsAppearanceDescription": "Переключение между светлым и темным режимом или изменение языка пользовательского интерфейса", "settingsAppearanceDescription": "Переключение между светлым и темным режимом или изменение языка пользовательского интерфейса",
"settingsThemeMode": "Тема", "settingsThemeMode": "Тема",
"settingsThemeModeLight": "Светлая",
"settingsThemeModeDark": "Темная",
"settingsLanguage": "Язык", "settingsLanguage": "Язык",
"settingsDistributedUptime": "Distributed uptime", "settingsDistributedUptime": "Distributed uptime",
"settingsDistributedUptimeDescription": "Включить/выключить distributed uptime monitoring.", "settingsDistributedUptimeDescription": "Включить/выключить distributed uptime monitoring.",
@@ -397,11 +405,67 @@
"pageSpeedWarning": "Предупреждение: Вы не добавили ключ API Google PageSpeed. Без него монитор PageSpeed не будет работать.", "pageSpeedWarning": "Предупреждение: Вы не добавили ключ API Google PageSpeed. Без него монитор PageSpeed не будет работать.",
"pageSpeedLearnMoreLink": "Нажмите здесь, чтобы узнать", "pageSpeedLearnMoreLink": "Нажмите здесь, чтобы узнать",
"pageSpeedAddApiKey": "как добавить ваш ключ API.", "pageSpeedAddApiKey": "как добавить ваш ключ API.",
"pageSpeedApiKeyFieldDescription": "Введите ваш API-ключ Google PageSpeed для включения мониторинга скорости страницы. Нажмите Сбросить, чтобы обновить ключ.", "createNew": "Создать новый",
"pageSpeedApiKeyFieldResetLabel": "API-ключ установлен. Нажмите Сбросить, чтобы изменить его.", "greeting": {
"reset": "Сбросить", "prepend": "Привет",
"statusBreadCrumbsStatusPages": "Страницы статуса", "append": "День прекрасен для новых достижений!",
"statusBreadCrumbsDetails": "Подробности", "overview": "Вот обзор ваших мониторов {{type}}."
"uptimeCreateSelectURL": "Введите URL или IP-адрес для мониторинга (например, https://example.com/ или 192.168.1.100) и добавьте понятное отображаемое имя, которое будет показано на панели управления.", },
"navControls": "Управление" "monitorStatus": {
"up": "работает",
"down": "не работает",
"paused": "приостановлен"
},
"roles": {
"superAdmin": "Суперадминистратор",
"admin": "Администратор",
"teamMember": "Член команды",
"demoUser": "Демо-пользователь"
},
"teamPanel": {
"teamMembers": "Члены команды",
"filter": {
"all": "Все",
"member": "Член"
},
"inviteTeamMember": "Пригласить члена команды",
"inviteNewTeamMember": "Пригласить нового члена команды",
"inviteDescription": "Когда вы добавляете нового члена команды, он получит доступ ко всем мониторам.",
"email": "Эл. почта",
"selectRole": "Выберите роль",
"inviteLink": "Ссылка для приглашения",
"cancel": "Отмена",
"noMembers": "Нет членов команды с этой ролью",
"getToken": "Получить токен",
"emailToken": "Отправить токен по эл. почте",
"table": {
"name": "Имя",
"email": "Эл. почта",
"role": "Роль",
"created": "Создан"
}
},
"monitorState": {
"paused": "приостановлен",
"resumed": "возобновлен",
"active": "активный"
},
"menu": {
"uptime": "Аптайм",
"pagespeed": "Скорость страницы",
"infrastructure": "Инфраструктура",
"distributedUptime": "Распределенный аптайм",
"incidents": "Инциденты",
"statusPages": "Страницы статуса",
"maintenance": "Обслуживание",
"integrations": "Интеграции",
"settings": "Настройки",
"support": "Поддержка",
"discussions": "Обсуждения",
"docs": "Документация",
"changelog": "История изменений",
"profile": "Профиль",
"password": "Пароль",
"team": "Команда"
}
} }
+74 -18
View File
@@ -14,9 +14,8 @@
"authLoginEnterPassword": "Parolanızı girin", "authLoginEnterPassword": "Parolanızı girin",
"commonPassword": "Parola", "commonPassword": "Parola",
"commonBack": "Geri", "commonBack": "Geri",
"authForgotPasswordTitle": "Şifrenizi mi unuttunuz?", "authForgotPasswordTitle": "Parolanızı mı unuttunuz?",
"authForgotPasswordResetPassword": "Şifreyi sıfırla", "authForgotPasswordResetPassword": "Parola sıfırla",
"authForgotPasswordInstructions": "Endişelenmeyin, size sıfırlama talimatlarını göndereceğiz.",
"createPassword": "Parolanızı oluşturun", "createPassword": "Parolanızı oluşturun",
"createAPassword": "Parola", "createAPassword": "Parola",
"authRegisterAlreadyHaveAccount": "Zaten hesabınız var mı?", "authRegisterAlreadyHaveAccount": "Zaten hesabınız var mı?",
@@ -70,8 +69,6 @@
"settingsAppearance": "Görünüm", "settingsAppearance": "Görünüm",
"settingsAppearanceDescription": "Açık ve koyu mod arasında geçiş yapın veya kullanıcı arayüzü dilini değiştirin", "settingsAppearanceDescription": "Açık ve koyu mod arasında geçiş yapın veya kullanıcı arayüzü dilini değiştirin",
"settingsThemeMode": "Tema", "settingsThemeMode": "Tema",
"settingsThemeModeLight": "Açık",
"settingsThemeModeDark": "Koyu",
"settingsLanguage": "Dil", "settingsLanguage": "Dil",
"settingsDistributedUptime": "Dağıtılmış çalışma süresi", "settingsDistributedUptime": "Dağıtılmış çalışma süresi",
"settingsDistributedUptimeDescription": "Dağıtılmış çalışma süresi izlemeyi etkinleştirin/devre dışı bırakın.", "settingsDistributedUptimeDescription": "Dağıtılmış çalışma süresi izlemeyi etkinleştirin/devre dışı bırakın.",
@@ -421,18 +418,77 @@
"authRegisterEmailRequired": "Devam etmek için lütfen e-posta adresinizi girin", "authRegisterEmailRequired": "Devam etmek için lütfen e-posta adresinizi girin",
"authRegisterEmailInvalid": "Lütfen geçerli bir e-posta adresi girin", "authRegisterEmailInvalid": "Lütfen geçerli bir e-posta adresi girin",
"bulkImport": { "bulkImport": {
"title": "", "title": "Toplu İçe Aktar",
"selectFileTips": "", "selectFileTips": "Yüklemek için CSV dosyası seçin",
"selectFileDescription": "", "selectFileDescription": "<template>Şablonumuzu</template> veya <sample>örneğimizi</sample> indirebilirsiniz",
"selectFile": "", "selectFile": "Dosya Seç",
"parsingFailed": "", "parsingFailed": "Ayrıştırma başarısız oldu",
"uploadSuccess": "", "uploadSuccess": "Monitörler başarıyla oluşturuldu!",
"validationFailed": "", "validationFailed": "Doğrulama başarısız oldu",
"noFileSelected": "", "noFileSelected": "Dosya seçilmedi",
"fallbackPage": "" "fallbackPage": "Sunucuların listesini toplu olarak yüklemek için bir dosya içe aktarın"
}, },
"statusBreadCrumbsStatusPages": "Durum Sayfaları", "createNew": "Yeni oluştur",
"statusBreadCrumbsDetails": "Detaylar", "greeting": {
"uptimeCreateSelectURL": "İzlenecek URL veya IP adresini girin (örneğin, https://example.com/ veya 192.168.1.100) ve kontrol panelinde görünecek net bir görüntü adı ekleyin.", "prepend": "Merhaba",
"navControls": "Kontroller" "append": "Öğleden sonra senin oyun alanın—hadi onu muhteşem yapalım!",
"overview": "İşte {{type}} monitörlerinizin genel görünümü."
},
"monitorStatus": {
"up": "aktif",
"down": "devre dışı",
"paused": "duraklatıldı"
},
"roles": {
"superAdmin": "Süper yönetici",
"admin": "Yönetici",
"teamMember": "Takım üyesi",
"demoUser": "Demo kullanıcı"
},
"teamPanel": {
"teamMembers": "Takım üyeleri",
"filter": {
"all": "Tümü",
"member": "Üye"
},
"inviteTeamMember": "Takım üyesi davet et",
"inviteNewTeamMember": "Yeni takım üyesi davet et",
"inviteDescription": "Yeni bir takım üyesi eklediğinizde, tüm monitörlere erişim hakkı alacaktır.",
"email": "E-posta",
"selectRole": "Rol seçin",
"inviteLink": "Davet bağlantısı",
"cancel": "İptal",
"noMembers": "Bu role sahip takım üyesi bulunmamaktadır",
"getToken": "Token al",
"emailToken": "Token e-posta ile gönder",
"table": {
"name": "Ad",
"email": "E-posta",
"role": "Rol",
"created": "Oluşturuldu"
}
},
"monitorState": {
"paused": "duraklatıldı",
"resumed": "devam ettirildi",
"active": "aktif"
},
"menu": {
"uptime": "Çalışma Süresi",
"pagespeed": "Sayfa Hızı",
"infrastructure": "Altyapı",
"distributedUptime": "Dağıtılmış Çalışma Süresi",
"incidents": "Olaylar",
"statusPages": "Durum Sayfaları",
"maintenance": "Bakım",
"integrations": "Entegrasyonlar",
"settings": "Ayarlar",
"support": "Destek",
"discussions": "Tartışmalar",
"docs": "Belgeler",
"changelog": "Değişiklik Günlüğü",
"profile": "Profil",
"password": "Şifre",
"team": "Takım"
}
} }
+2 -6
View File
@@ -5,7 +5,7 @@ services:
ports: ports:
- "80:80" - "80:80"
environment: environment:
UPTIME_APP_API_BASE_URL: "http://localhost:5000/api/v1" UPTIME_APP_API_BASE_URL: "http://localhost:52345/api/v1"
UPTIME_APP_CLIENT_HOST: "http://localhost" UPTIME_APP_CLIENT_HOST: "http://localhost"
volumes: volumes:
- ./nginx/conf.d:/etc/nginx/conf.d/ - ./nginx/conf.d:/etc/nginx/conf.d/
@@ -15,7 +15,7 @@ services:
image: uptime_server:latest image: uptime_server:latest
restart: always restart: always
ports: ports:
- "5000:5000" - "52345:52345"
env_file: env_file:
- server.env - server.env
depends_on: depends_on:
@@ -24,8 +24,6 @@ services:
redis: redis:
image: uptime_redis:latest image: uptime_redis:latest
restart: always restart: always
ports:
- "6379:6379"
volumes: volumes:
- ./redis/data:/data - ./redis/data:/data
healthcheck: healthcheck:
@@ -38,8 +36,6 @@ services:
image: uptime_mongo:latest image: uptime_mongo:latest
restart: always restart: always
command: ["mongod", "--quiet", "--replSet", "rs0", "--bind_ip_all"] command: ["mongod", "--quiet", "--replSet", "rs0", "--bind_ip_all"]
ports:
- "27017:27017"
volumes: volumes:
- ./mongo/data:/data/db - ./mongo/data:/data/db
healthcheck: healthcheck:
+9 -9
View File
@@ -12,7 +12,7 @@ server {
} }
# location /api/ { # location /api/ {
# proxy_pass http://server:5000/api/; # proxy_pass http://server:52345/api/;
# proxy_http_version 1.1; # proxy_http_version 1.1;
# proxy_set_header Host $host; # proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr; # proxy_set_header X-Real-IP $remote_addr;
@@ -24,12 +24,12 @@ server {
# proxy_cache off; # proxy_cache off;
# } # }
location /api-docs/ { # location /api-docs/ {
proxy_pass http://server:5000/api-docs/; # proxy_pass http://server:52345/api-docs/;
proxy_http_version 1.1; # proxy_http_version 1.1;
proxy_set_header Host $host; # proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; # proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; # proxy_set_header X-Forwarded-Proto $scheme;
} # }
} }
+1 -1
View File
@@ -8,6 +8,6 @@ RUN npm install
COPY ./server/ ./ COPY ./server/ ./
EXPOSE 5000 EXPOSE 52345
CMD ["node", "index.js"] CMD ["node", "index.js"]
+1 -5
View File
@@ -14,7 +14,7 @@ services:
image: ghcr.io/bluewave-labs/checkmate:backend-dist image: ghcr.io/bluewave-labs/checkmate:backend-dist
restart: always restart: always
ports: ports:
- "5000:5000" - "52345:52345"
depends_on: depends_on:
- redis - redis
- mongodb - mongodb
@@ -27,8 +27,6 @@ services:
redis: redis:
image: ghcr.io/bluewave-labs/checkmate:redis-dist image: ghcr.io/bluewave-labs/checkmate:redis-dist
restart: always restart: always
ports:
- "6379:6379"
volumes: volumes:
- ./redis/data:/data - ./redis/data:/data
healthcheck: healthcheck:
@@ -43,8 +41,6 @@ services:
volumes: volumes:
- ./mongo/data:/data/db - ./mongo/data:/data/db
command: ["mongod", "--quiet", "--replSet", "rs0", "--bind_ip_all"] command: ["mongod", "--quiet", "--replSet", "rs0", "--bind_ip_all"]
ports:
- "27017:27017"
healthcheck: healthcheck:
test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'mongodb:27017'}]}) }" | mongosh --port 27017 --quiet test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'mongodb:27017'}]}) }" | mongosh --port 27017 --quiet
interval: 5s interval: 5s
+1 -1
View File
@@ -8,6 +8,6 @@ RUN npm install
COPY ./server/ ./ COPY ./server/ ./
EXPOSE 5000 EXPOSE 52345
CMD ["node", "index.js"] CMD ["node", "index.js"]
+1 -5
View File
@@ -25,7 +25,7 @@ services:
image: ghcr.io/bluewave-labs/checkmate:backend-demo image: ghcr.io/bluewave-labs/checkmate:backend-demo
restart: always restart: always
ports: ports:
- "5000:5000" - "52345:52345"
env_file: env_file:
- server.env - server.env
depends_on: depends_on:
@@ -36,8 +36,6 @@ services:
redis: redis:
image: ghcr.io/bluewave-labs/checkmate:redis-demo image: ghcr.io/bluewave-labs/checkmate:redis-demo
restart: always restart: always
ports:
- "6379:6379"
volumes: volumes:
- ./redis/data:/data - ./redis/data:/data
healthcheck: healthcheck:
@@ -50,8 +48,6 @@ services:
image: ghcr.io/bluewave-labs/checkmate:mongo-demo image: ghcr.io/bluewave-labs/checkmate:mongo-demo
restart: always restart: always
command: ["mongod", "--quiet", "--replSet", "rs0", "--bind_ip_all"] command: ["mongod", "--quiet", "--replSet", "rs0", "--bind_ip_all"]
ports:
- "27017:27017"
volumes: volumes:
- ./mongo/data:/data/db - ./mongo/data:/data/db
# - ./mongo/init/init.js:/docker-entrypoint-initdb.d/init.js // No longer needed # - ./mongo/init/init.js:/docker-entrypoint-initdb.d/init.js // No longer needed
+4 -4
View File
@@ -16,7 +16,7 @@ server {
} }
location /api/ { location /api/ {
proxy_pass http://server:5000/api/; proxy_pass http://server:52345/api/;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
@@ -25,7 +25,7 @@ server {
} }
location /api-docs/ { location /api-docs/ {
proxy_pass http://server:5000/api-docs/; proxy_pass http://server:52345/api-docs/;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
@@ -50,7 +50,7 @@ server {
} }
location /api/ { location /api/ {
proxy_pass http://server:5000/api/; proxy_pass http://server:52345/api/;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
@@ -59,7 +59,7 @@ server {
} }
location /api-docs/ { location /api-docs/ {
proxy_pass http://server:5000/api-docs/; proxy_pass http://server:52345/api-docs/;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
+1 -1
View File
@@ -10,6 +10,6 @@ RUN npm install
COPY ./server ./ COPY ./server ./
EXPOSE 5000 EXPOSE 52345
CMD ["node", "index.js"] CMD ["node", "index.js"]
+1 -1
View File
@@ -27,7 +27,7 @@ services:
image: ghcr.io/bluewave-labs/checkmate:backend-staging image: ghcr.io/bluewave-labs/checkmate:backend-staging
restart: always restart: always
ports: ports:
- "5000:5000" - "52345:52345"
env_file: env_file:
- server.env - server.env
depends_on: depends_on:
+4 -4
View File
@@ -16,7 +16,7 @@ server {
} }
location /api/ { location /api/ {
proxy_pass http://server:5000/api/; proxy_pass http://server:52345/api/;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
@@ -29,7 +29,7 @@ server {
} }
location /api-docs/ { location /api-docs/ {
proxy_pass http://server:5000/api-docs/; proxy_pass http://server:52345/api-docs/;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
@@ -54,7 +54,7 @@ server {
} }
location /api/ { location /api/ {
proxy_pass http://server:5000/api/; proxy_pass http://server:52345/api/;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
@@ -67,7 +67,7 @@ server {
} }
location /api-docs/ { location /api-docs/ {
proxy_pass http://server:5000/api-docs/; proxy_pass http://server:52345/api-docs/;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
+1 -1
View File
@@ -10,6 +10,6 @@ RUN npm install
COPY ./server ./ COPY ./server ./
EXPOSE 5000 EXPOSE 52345
CMD ["node", "index.js"] CMD ["node", "index.js"]
+1 -2
View File
@@ -649,9 +649,8 @@ class MonitorController {
sendTestEmail = async (req, res, next) => { sendTestEmail = async (req, res, next) => {
try { try {
const { to } = req.body; const { to } = req.body;
if (!to || typeof to !== "string") { if (!to || typeof to !== "string") {
return res.error({ msg: this.stringService.errorForValidEmailAddress }); throw new Error(this.stringService.errorForValidEmailAddress);
} }
const subject = this.stringService.testEmailSubject; const subject = this.stringService.testEmailSubject;
+21 -9
View File
@@ -11,16 +11,28 @@ class SettingsController {
} }
getAppSettings = async (req, res, next) => { getAppSettings = async (req, res, next) => {
try { const dbSettings = await this.settingsService.getDBSettings();
const settings = { ...(await this.settingsService.getSettings()) }; const sanitizedSettings = { ...dbSettings };
delete settings.jwtSecret;
return res.success({ const returnSettings = {
msg: this.stringService.getAppSettings, pagespeedKeySet: false,
data: settings, emailPasswordSet: false,
}); };
} catch (error) {
next(handleError(error, SERVICE_NAME, "getAppSettings")); if (typeof sanitizedSettings.pagespeedApiKey !== "undefined") {
returnSettings.pagespeedKeySet = true;
delete sanitizedSettings.pagespeedApiKey;
} }
if (typeof sanitizedSettings.systemEmailPassword !== "undefined") {
returnSettings.emailPasswordSet = true;
delete sanitizedSettings.systemEmailPassword;
}
returnSettings.settings = sanitizedSettings;
return res.success({
msg: this.stringService.getAppSettings,
data: returnSettings,
});
}; };
updateAppSettings = async (req, res, next) => { updateAppSettings = async (req, res, next) => {
+9 -42
View File
@@ -2,64 +2,31 @@ import mongoose from "mongoose";
const AppSettingsSchema = mongoose.Schema( const AppSettingsSchema = mongoose.Schema(
{ {
apiBaseUrl: { checkTTL: {
type: String, type: Number,
required: true, default: 30,
default: "http://localhost:5000/api/v1",
}, },
logLevel: { language: {
type: String, type: String,
default: "debug", default: "gb",
enum: ["debug", "none", "error", "warn"],
},
clientHost: {
type: String,
required: true,
default: "http://localhost:5173",
},
jwtSecret: {
type: String,
required: true,
default: "my_secret",
},
dbType: {
type: String,
required: true,
default: "MongoDB",
},
dbConnectionString: {
type: String,
required: true,
default: "mongodb://localhost:27017/uptime_db",
},
redisUrl: {
type: String,
default: "redis://127.0.0.1:6379",
},
jwtTTL: {
type: String,
required: true,
default: "2h",
}, },
pagespeedApiKey: { pagespeedApiKey: {
type: String, type: String,
default: "",
}, },
systemEmailHost: { systemEmailHost: {
type: String, type: String,
default: "smtp.gmail.com",
}, },
systemEmailPort: { systemEmailPort: {
type: Number, type: Number,
default: 465,
}, },
systemEmailAddress: { systemEmailAddress: {
type: String, type: String,
default: "",
}, },
systemEmailPassword: { systemEmailPassword: {
type: String, type: String,
default: "", },
systemEmailUser: {
type: String,
}, },
singleton: { singleton: {
type: Boolean, type: Boolean,
@@ -73,4 +40,4 @@ const AppSettingsSchema = mongoose.Schema(
} }
); );
export default mongoose.model("AppSettings", AppSettingsSchema); export default mongoose.model("AppSettings", AppSettingsSchema);
+3 -3
View File
@@ -76,7 +76,8 @@ import * as diagnosticModule from "./modules/diagnosticModule.js";
class MongoDB { class MongoDB {
static SERVICE_NAME = "MongoDB"; static SERVICE_NAME = "MongoDB";
constructor() { constructor({ appSettings }) {
this.appSettings = appSettings;
Object.assign(this, userModule); Object.assign(this, userModule);
Object.assign(this, inviteModule); Object.assign(this, inviteModule);
Object.assign(this, recoveryModule); Object.assign(this, recoveryModule);
@@ -95,8 +96,7 @@ class MongoDB {
connect = async () => { connect = async () => {
try { try {
const connectionString = const connectionString =
process.env.DB_CONNECTION_STRING || "mongodb://localhost:27017/uptime_db"; this.appSettings.dbConnectionString || "mongodb://localhost:27017/uptime_db";
console.log("Connecting to MongoDB with connection string:", connectionString);
await mongoose.connect(connectionString); await mongoose.connect(connectionString);
// If there are no AppSettings, create one // If there are no AppSettings, create one
await AppSettings.findOneAndUpdate( await AppSettings.findOneAndUpdate(
+16 -5
View File
@@ -14,11 +14,22 @@ const getAppSettings = async () => {
const updateAppSettings = async (newSettings) => { const updateAppSettings = async (newSettings) => {
try { try {
const settings = await AppSettings.findOneAndUpdate( const update = { $set: { ...newSettings } };
{},
{ $set: newSettings }, if (newSettings.pagespeedApiKey === "") {
{ new: true } update.$unset = { pagespeedApiKey: "" };
); delete update.$set.pagespeedApiKey;
}
if (newSettings.systemEmailPassword === "") {
update.$unset = { systemEmailPassword: "" };
delete update.$set.systemEmailPassword;
}
const settings = await AppSettings.findOneAndUpdate({}, update, {
new: true,
upsert: true,
});
return settings; return settings;
} catch (error) { } catch (error) {
error.service = SERVICE_NAME; error.service = SERVICE_NAME;
+12 -11
View File
@@ -100,8 +100,6 @@ const openApiSpec = JSON.parse(
let server; let server;
const PORT = 5000;
const shutdown = async () => { const shutdown = async () => {
if (isShuttingDown) { if (isShuttingDown) {
return; return;
@@ -139,19 +137,21 @@ const shutdown = async () => {
// Need to wrap server setup in a function to handle async nature of JobQueue // Need to wrap server setup in a function to handle async nature of JobQueue
const startApp = async () => { const startApp = async () => {
const app = express(); const app = express();
const allowedOrigin = process.env.CLIENT_HOST;
// Create and Register Primary services // Create and Register Primary services
const translationService = new TranslationService(logger); const translationService = new TranslationService(logger);
const stringService = new StringService(translationService); const stringService = new StringService(translationService);
ServiceRegistry.register(StringService.SERVICE_NAME, stringService); ServiceRegistry.register(StringService.SERVICE_NAME, stringService);
// Create DB
const db = new MongoDB();
await db.connect();
// Create services // Create services
const settingsService = new SettingsService(AppSettings); const settingsService = new SettingsService(AppSettings);
await settingsService.loadSettings(); const appSettings = settingsService.loadSettings();
// Create DB
const db = new MongoDB({ appSettings });
await db.connect();
// Set allowed origin
const allowedOrigin = appSettings.clientHost;
const networkService = new NetworkService( const networkService = new NetworkService(
axios, axios,
@@ -215,8 +215,9 @@ const startApp = async () => {
await translationService.initialize(); await translationService.initialize();
server = app.listen(PORT, () => { const port = appSettings.port || 52345;
logger.info({ message: `server started on port:${PORT}` }); server = app.listen(port, () => {
logger.info({ message: `Server started on port:${port}` });
}); });
process.on("SIGUSR2", shutdown); process.on("SIGUSR2", shutdown);
@@ -237,7 +238,7 @@ const startApp = async () => {
ServiceRegistry.get(SettingsService.SERVICE_NAME), ServiceRegistry.get(SettingsService.SERVICE_NAME),
ServiceRegistry.get(JobQueue.SERVICE_NAME), ServiceRegistry.get(JobQueue.SERVICE_NAME),
ServiceRegistry.get(StringService.SERVICE_NAME), ServiceRegistry.get(StringService.SERVICE_NAME),
ServiceRegistry.get(EmailService.SERVICE_NAME), ServiceRegistry.get(EmailService.SERVICE_NAME)
); );
const settingsController = new SettingsController( const settingsController = new SettingsController(
+27 -22
View File
@@ -29,7 +29,10 @@ class EmailService {
this.mjml2html = mjml2html; this.mjml2html = mjml2html;
this.nodemailer = nodemailer; this.nodemailer = nodemailer;
this.logger = logger; this.logger = logger;
this.init();
}
init = async () => {
/** /**
* Loads an email template from the filesystem. * Loads an email template from the filesystem.
* *
@@ -67,34 +70,14 @@ class EmailService {
serverIsUpTemplate: this.loadTemplate("serverIsUp"), serverIsUpTemplate: this.loadTemplate("serverIsUp"),
passwordResetTemplate: this.loadTemplate("passwordReset"), passwordResetTemplate: this.loadTemplate("passwordReset"),
hardwareIncidentTemplate: this.loadTemplate("hardwareIncident"), hardwareIncidentTemplate: this.loadTemplate("hardwareIncident"),
testEmailTemplate: this.loadTemplate("testEmailTemplate") testEmailTemplate: this.loadTemplate("testEmailTemplate"),
}; };
/** /**
* The email transporter used to send emails. * The email transporter used to send emails.
* @type {Object} * @type {Object}
*/ */
};
const {
systemEmailHost,
systemEmailPort,
systemEmailUser,
systemEmailAddress,
systemEmailPassword,
} = this.settingsService.getSettings();
const emailConfig = {
host: systemEmailHost,
port: systemEmailPort,
secure: true,
auth: {
user: systemEmailUser || systemEmailAddress,
pass: systemEmailPassword,
},
};
this.transporter = this.nodemailer.createTransport(emailConfig);
}
/** /**
* Asynchronously builds and sends an email using a specified template and context. * Asynchronously builds and sends an email using a specified template and context.
@@ -106,6 +89,28 @@ class EmailService {
* @returns {Promise<string>} A promise that resolves to the messageId of the sent email. * @returns {Promise<string>} A promise that resolves to the messageId of the sent email.
*/ */
buildAndSendEmail = async (template, context, to, subject) => { buildAndSendEmail = async (template, context, to, subject) => {
// TODO - Consider an update transporter method so this only needs to be recreated when smtp settings change
const {
systemEmailHost,
systemEmailPort,
systemEmailUser,
systemEmailAddress,
systemEmailPassword,
} = await this.settingsService.getDBSettings();
const emailConfig = {
host: systemEmailHost,
port: systemEmailPort,
secure: true,
auth: {
user: systemEmailUser || systemEmailAddress,
pass: systemEmailPassword,
},
connectionTimeout: 5000,
};
this.transporter = this.nodemailer.createTransport(emailConfig);
const buildHtml = async (template, context) => { const buildHtml = async (template, context) => {
try { try {
const mjml = this.templateLookup[template](context); const mjml = this.templateLookup[template](context);
+31 -40
View File
@@ -1,27 +1,26 @@
const SERVICE_NAME = "SettingsService"; const SERVICE_NAME = "SettingsService";
import dotenv from "dotenv";
dotenv.config();
const envConfig = { const envConfig = {
nodeEnv: process.env.NODE_ENV,
logLevel: process.env.LOG_LEVEL, logLevel: process.env.LOG_LEVEL,
clientHost: process.env.CLIENT_HOST,
jwtSecret: process.env.JWT_SECRET,
dbType: process.env.DB_TYPE,
dbConnectionString: process.env.DB_CONNECTION_STRING,
redisUrl: process.env.REDIS_URL,
jwtTTL: process.env.TOKEN_TTL,
pagespeedApiKey: process.env.PAGESPEED_API_KEY,
systemEmailHost: process.env.SYSTEM_EMAIL_HOST, systemEmailHost: process.env.SYSTEM_EMAIL_HOST,
systemEmailPort: process.env.SYSTEM_EMAIL_PORT, systemEmailPort: process.env.SYSTEM_EMAIL_PORT,
systemEmailUser: process.env.SYSTEM_EMAIL_USER, systemEmailUser: process.env.SYSTEM_EMAIL_USER,
systemEmailAddress: process.env.SYSTEM_EMAIL_ADDRESS, systemEmailAddress: process.env.SYSTEM_EMAIL_ADDRESS,
systemEmailPassword: process.env.SYSTEM_EMAIL_PASSWORD, systemEmailPassword: process.env.SYSTEM_EMAIL_PASSWORD,
jwtSecret: process.env.JWT_SECRET,
jwtTTL: process.env.TOKEN_TTL,
clientHost: process.env.CLIENT_HOST,
dbConnectionString: process.env.DB_CONNECTION_STRING,
redisUrl: process.env.REDIS_URL,
callbackUrl: process.env.CALLBACK_URL,
port: process.env.PORT,
pagespeedApiKey: process.env.PAGESPEED_API_KEY,
uprockApiKey: process.env.UPROCK_API_KEY,
}; };
/** /**
* SettingsService * SettingsService
* *
* This service is responsible for loading and managing the application settings. * This service is responsible for loading and managing the application settings.
* It gives priority to environment variables and will only load settings
* from the database if they are not set in the environment.
*/ */
class SettingsService { class SettingsService {
static SERVICE_NAME = SERVICE_NAME; static SERVICE_NAME = SERVICE_NAME;
@@ -34,40 +33,17 @@ class SettingsService {
this.settings = { ...envConfig }; this.settings = { ...envConfig };
} }
/** /**
* Load settings from the database and merge with environment settings. * Load settings from env settings
* If there are any settings that weren't set by environment variables, use user settings from the database. * @returns {Object>} The settings.
* @returns {Promise<Object>} The merged settings. */
* @throws Will throw an error if settings are not found in the database or if settings have not been loaded. loadSettings() {
*/ async loadSettings() { return this.settings;
try {
const dbSettings = await this.appSettings.findOne();
if (!this.settings) {
throw new Error("Settings not found");
}
// If there are any settings that weren't set by environment variables, use user settings from DB
for (const key in envConfig) {
if (
typeof envConfig?.[key] === "undefined" &&
typeof dbSettings?.[key] !== "undefined"
) {
this.settings[key] = dbSettings[key];
}
}
await this.appSettings.updateOne({}, { $set: this.settings }, { upsert: true });
return this.settings;
} catch (error) {
error.service === undefined ? (error.service = SERVICE_NAME) : null;
error.method === undefined ? (error.method = "loadSettings") : null;
throw error;
}
} }
/** /**
* Reload settings by calling loadSettings. * Reload settings by calling loadSettings.
* @returns {Promise<Object>} The reloaded settings. * @returns {Promise<Object>} The reloaded settings.
*/ */
async reloadSettings() { reloadSettings() {
return this.loadSettings(); return this.loadSettings();
} }
/** /**
@@ -81,6 +57,21 @@ class SettingsService {
} }
return this.settings; return this.settings;
} }
async getDBSettings() {
let settings = await this.appSettings
.findOne({ singleton: true })
.select("-__v -_id -createdAt -updatedAt -singleton")
.lean();
if (settings === null) {
await this.appSettings.create({});
settings = await this.appSettings
.findOne({ singleton: true })
.select("-__v -_id -createdAt -updatedAt -singleton")
.lean();
}
return settings;
}
} }
export default SettingsService; export default SettingsService;
+2 -9
View File
@@ -424,21 +424,14 @@ const editMaintenanceByIdWindowBodyValidation = joi.object({
// SettingsValidation // SettingsValidation
//**************************************** //****************************************
const updateAppSettingsBodyValidation = joi.object({ const updateAppSettingsBodyValidation = joi.object({
apiBaseUrl: joi.string().allow(""), checkTTL: joi.number().allow(""),
logLevel: joi.string().valid("debug", "none", "error", "warn").allow(""),
clientHost: joi.string().allow(""),
dbType: joi.string().allow(""),
dbConnectionString: joi.string().allow(""),
redisHost: joi.string().allow(""),
redisPort: joi.number().allow(null, ""),
redisUrl: joi.string().allow(""),
jwtTTL: joi.string().allow(""),
pagespeedApiKey: joi.string().allow(""), pagespeedApiKey: joi.string().allow(""),
language: joi.string().allow(""), language: joi.string().allow(""),
systemEmailHost: joi.string().allow(""), systemEmailHost: joi.string().allow(""),
systemEmailPort: joi.number().allow(""), systemEmailPort: joi.number().allow(""),
systemEmailAddress: joi.string().allow(""), systemEmailAddress: joi.string().allow(""),
systemEmailPassword: joi.string().allow(""), systemEmailPassword: joi.string().allow(""),
systemEmailUser: joi.string().allow(""),
}); });
//**************************************** //****************************************