modify
This commit is contained in:
1 parent
77be1fc37f
commit
b4d74d370a
5 files changed
+11
-7
No files matched your search
@@ -19,10 +19,11 @@ import "./index.css";
|
|||||||
* @param {Array<string>} props.checks - An array of strings representing the checks to display.
|
* @param {Array<string>} props.checks - An array of strings representing the checks to display.
|
||||||
* @param {string} [props.link="/"] - The link to navigate to.
|
* @param {string} [props.link="/"] - The link to navigate to.
|
||||||
* @param {boolean} [props.vowelStart=false] - Whether the title starts with a vowel.
|
* @param {boolean} [props.vowelStart=false] - Whether the title starts with a vowel.
|
||||||
|
* @param {boolean} [props.showPageSpeedWarning=false] - Whether to show the PageSpeed API warning.
|
||||||
* @returns {JSX.Element} The rendered fallback UI.
|
* @returns {JSX.Element} The rendered fallback UI.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const Fallback = ({ title, checks, link = "/", isAdmin, vowelStart = false }) => {
|
const Fallback = ({ title, checks, link = "/", isAdmin, vowelStart = false, showPageSpeedWarning = false }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const mode = useSelector((state) => state.ui.mode);
|
const mode = useSelector((state) => state.ui.mode);
|
||||||
@@ -36,6 +37,7 @@ const Fallback = ({ title, checks, link = "/", isAdmin, vowelStart = false }) =>
|
|||||||
<Link
|
<Link
|
||||||
href="https://docs.checkmate.so/users-guide/quickstart#env-vars-server"
|
href="https://docs.checkmate.so/users-guide/quickstart#env-vars-server"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
sx={{
|
sx={{
|
||||||
textDecoration: "underline",
|
textDecoration: "underline",
|
||||||
color: "inherit",
|
color: "inherit",
|
||||||
@@ -45,9 +47,9 @@ const Fallback = ({ title, checks, link = "/", isAdmin, vowelStart = false }) =>
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("pageSpeedLearnMore")}
|
{t("pageSpeedLearnMoreLink")}
|
||||||
</Link>
|
</Link>
|
||||||
{" "} {t("pageSpeedAddApiKey")}
|
{" "}{t("pageSpeedAddApiKey")}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -118,7 +120,7 @@ const Fallback = ({ title, checks, link = "/", isAdmin, vowelStart = false }) =>
|
|||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{/* Warning box for PageSpeed monitor */}
|
{/* Warning box for PageSpeed monitor */}
|
||||||
{title === "pagespeed monitor" && (
|
{(title === "pagespeed monitor" && showPageSpeedWarning) && (
|
||||||
<Box sx={{ width: "80%", maxWidth: "600px", zIndex: 1 }}>
|
<Box sx={{ width: "80%", maxWidth: "600px", zIndex: 1 }}>
|
||||||
<Box sx={{
|
<Box sx={{
|
||||||
'& .alert.row-stack': {
|
'& .alert.row-stack': {
|
||||||
@@ -153,6 +155,7 @@ Fallback.propTypes = {
|
|||||||
link: PropTypes.string,
|
link: PropTypes.string,
|
||||||
isAdmin: PropTypes.bool,
|
isAdmin: PropTypes.bool,
|
||||||
vowelStart: PropTypes.bool,
|
vowelStart: PropTypes.bool,
|
||||||
|
showPageSpeedWarning: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Fallback;
|
export default Fallback;
|
||||||
@@ -52,6 +52,7 @@ const PageSpeed = () => {
|
|||||||
]}
|
]}
|
||||||
link="/pagespeed/create"
|
link="/pagespeed/create"
|
||||||
isAdmin={isAdmin}
|
isAdmin={isAdmin}
|
||||||
|
showPageSpeedWarning={true}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -377,6 +377,6 @@
|
|||||||
"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. Without it, the PageSpeed monitor won't function.",
|
"pageSpeedWarning": "Warning: You haven't added a Google PageSpeed API key. Without it, the PageSpeed monitor won't function.",
|
||||||
"pageSpeedLearnMore": "Click here to learn",
|
"pageSpeedLearnMoreLink": "Click here to learn",
|
||||||
"pageSpeedAddApiKey": "how to add your API key."
|
"pageSpeedAddApiKey": "how to add your API key."
|
||||||
}
|
}
|
||||||
+1
-1
@@ -362,6 +362,6 @@
|
|||||||
"uptimeCreateJsonPathQuery": "",
|
"uptimeCreateJsonPathQuery": "",
|
||||||
"maintenanceTableActionMenuDialogTitle": "",
|
"maintenanceTableActionMenuDialogTitle": "",
|
||||||
"pageSpeedWarning": "Предупреждение: Вы не добавили ключ API Google PageSpeed. Без него монитор PageSpeed не будет работать.",
|
"pageSpeedWarning": "Предупреждение: Вы не добавили ключ API Google PageSpeed. Без него монитор PageSpeed не будет работать.",
|
||||||
"pageSpeedLearnMore": "Нажмите здесь, чтобы узнать",
|
"pageSpeedLearnMoreLink": "Нажмите здесь, чтобы узнать",
|
||||||
"pageSpeedAddApiKey": "как добавить ваш ключ API."
|
"pageSpeedAddApiKey": "как добавить ваш ключ API."
|
||||||
}
|
}
|
||||||
+1
-1
@@ -377,6 +377,6 @@
|
|||||||
"errorInvalidFieldId": "",
|
"errorInvalidFieldId": "",
|
||||||
"inviteNoTokenFound": "",
|
"inviteNoTokenFound": "",
|
||||||
"pageSpeedWarning": "Uyarı: Google PageSpeed API anahtarı eklemediniz. Bu olmadan, PageSpeed monitörü çalışmayacaktır.",
|
"pageSpeedWarning": "Uyarı: Google PageSpeed API anahtarı eklemediniz. Bu olmadan, PageSpeed monitörü çalışmayacaktır.",
|
||||||
"pageSpeedLearnMore": "API anahtarınızı nasıl ekleyeceğinizi",
|
"pageSpeedLearnMoreLink": "API anahtarınızı nasıl ekleyeceğinizi",
|
||||||
"pageSpeedAddApiKey": "öğrenmek için buraya tıklayın."
|
"pageSpeedAddApiKey": "öğrenmek için buraya tıklayın."
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user