feat: add toggle to show/hide “Administrator? Login Here” link in status page settings
This commit is contained in:
1 parent
e6fd57d0bb
commit
4a36bd3157
6 files changed
+16
-1
No files matched your search
@@ -90,6 +90,13 @@ const Content = ({
|
|||||||
isChecked={form.showUptimePercentage}
|
isChecked={form.showUptimePercentage}
|
||||||
onChange={handleFormChange}
|
onChange={handleFormChange}
|
||||||
/>
|
/>
|
||||||
|
<Checkbox
|
||||||
|
id="showAdminLoginLink"
|
||||||
|
name="showAdminLoginLink"
|
||||||
|
label={t("showAdminLoginLink")}
|
||||||
|
isChecked={form.showAdminLoginLink}
|
||||||
|
onChange={handleFormChange}
|
||||||
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</ConfigStack>
|
</ConfigStack>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const TAB_LIST = ["General settings", "Contents"];
|
|||||||
|
|
||||||
const ERROR_TAB_MAPPING = [
|
const ERROR_TAB_MAPPING = [
|
||||||
["companyName", "url", "timezone", "color", "isPublished", "logo"],
|
["companyName", "url", "timezone", "color", "isPublished", "logo"],
|
||||||
["monitors", "showUptimePercentage", "showCharts"],
|
["monitors", "showUptimePercentage", "showCharts", "showAdminLoginLink"],
|
||||||
];
|
];
|
||||||
|
|
||||||
const CreateStatusPage = () => {
|
const CreateStatusPage = () => {
|
||||||
@@ -39,6 +39,7 @@ const CreateStatusPage = () => {
|
|||||||
monitors: [],
|
monitors: [],
|
||||||
showCharts: true,
|
showCharts: true,
|
||||||
showUptimePercentage: true,
|
showUptimePercentage: true,
|
||||||
|
showAdminLoginLink: false,
|
||||||
});
|
});
|
||||||
const [errors, setErrors] = useState({});
|
const [errors, setErrors] = useState({});
|
||||||
const [selectedMonitors, setSelectedMonitors] = useState([]);
|
const [selectedMonitors, setSelectedMonitors] = useState([]);
|
||||||
@@ -195,6 +196,7 @@ const CreateStatusPage = () => {
|
|||||||
logo: newLogo,
|
logo: newLogo,
|
||||||
showCharts: statusPage?.showCharts ?? true,
|
showCharts: statusPage?.showCharts ?? true,
|
||||||
showUptimePercentage: statusPage?.showUptimePercentage ?? true,
|
showUptimePercentage: statusPage?.showUptimePercentage ?? true,
|
||||||
|
showAdminLoginLink: statusPage?.showAdminLoginLink ?? false,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
setSelectedMonitors(statusPageMonitors);
|
setSelectedMonitors(statusPageMonitors);
|
||||||
|
|||||||
@@ -871,6 +871,9 @@ class NetworkService {
|
|||||||
if (form.showUptimePercentage !== undefined) {
|
if (form.showUptimePercentage !== undefined) {
|
||||||
fd.append("showUptimePercentage", String(form.showUptimePercentage));
|
fd.append("showUptimePercentage", String(form.showUptimePercentage));
|
||||||
}
|
}
|
||||||
|
if (form.showAdminLoginLink !== undefined) {
|
||||||
|
fd.append("showAdminLoginLink", String(form.showAdminLoginLink));
|
||||||
|
}
|
||||||
form.monitors &&
|
form.monitors &&
|
||||||
form.monitors.forEach((monitorId) => {
|
form.monitors.forEach((monitorId) => {
|
||||||
fd.append("monitors[]", monitorId);
|
fd.append("monitors[]", monitorId);
|
||||||
|
|||||||
@@ -277,6 +277,7 @@ const statusPageValidation = joi.object({
|
|||||||
logo: logoImageValidation,
|
logo: logoImageValidation,
|
||||||
showUptimePercentage: joi.boolean(),
|
showUptimePercentage: joi.boolean(),
|
||||||
showCharts: joi.boolean(),
|
showCharts: joi.boolean(),
|
||||||
|
showAdminLoginLink: joi.boolean(),
|
||||||
});
|
});
|
||||||
|
|
||||||
const settingsValidation = joi.object({
|
const settingsValidation = joi.object({
|
||||||
|
|||||||
@@ -319,6 +319,7 @@
|
|||||||
"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",
|
||||||
|
"showAdminLoginLink": "Show \"Administrator? Login Here\" link on the status page",
|
||||||
"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",
|
||||||
|
|||||||
@@ -312,6 +312,7 @@
|
|||||||
"statusPageCreateTabsContentFeaturesDescription": "Mostrar mais detalhes na página de status",
|
"statusPageCreateTabsContentFeaturesDescription": "Mostrar mais detalhes na página de status",
|
||||||
"showCharts": "Mostrar gráficos",
|
"showCharts": "Mostrar gráficos",
|
||||||
"showUptimePercentage": "Mostrar porcentagem de Uptime",
|
"showUptimePercentage": "Mostrar porcentagem de Uptime",
|
||||||
|
"showAdminLoginLink": "Mostrar o link \"Administrador? Efetue login aqui\" na página de status",
|
||||||
"removeLogo": "Remover logo",
|
"removeLogo": "Remover logo",
|
||||||
"statusPageStatus": "Uma página de status pública não está configurada.",
|
"statusPageStatus": "Uma página de status pública não está configurada.",
|
||||||
"statusPageStatusContactAdmin": "Entre em contato com seu administrador",
|
"statusPageStatusContactAdmin": "Entre em contato com seu administrador",
|
||||||
|
|||||||
Reference in new issue
Block a user