url settigns

This commit is contained in:
Alex Holliday
2026-02-18 21:02:08 +00:00
parent a59f7fd830
commit d4e72ee8a6
2 changed files with 56 additions and 2 deletions
+34 -2
View File
@@ -13,8 +13,8 @@ import { useIsAdmin } from "@/Hooks/useIsAdmin.js";
import type { SettingsFormData } from "@/Validation/settings";
import { useState } from "react";
import { Controller } from "react-hook-form";
import { TextField, FieldLabel, Button } from "@/Components/v2/inputs";
import { Typography, Box } from "@mui/material";
import { TextField, Button, FieldLabel } from "@/Components/v2/inputs";
import { Box } from "@mui/material";
import {
setTimezone,
@@ -268,6 +268,38 @@ export const SettingsPage = () => {
}
/>
)}
{/* URL Settings */}
<ConfigBox
title={t("pages.settings.form.url.title")}
subtitle={t("pages.settings.form.url.description")}
rightContent={
<Controller
name="showURL"
control={form.control}
defaultValue={defaults.showURL}
render={({ field, fieldState }) => (
<Select
{...field}
value={field.value === undefined ? "false" : field.value.toString()}
onChange={(e) => {
const value = e.target.value === "true";
field.onChange(value);
}}
fieldLabel={t("pages.settings.form.url.option.showURL.label")}
error={!!fieldState.error}
>
<MenuItem value="true">
{t("pages.settings.form.url.option.showURL.enabled")}
</MenuItem>
<MenuItem value="false">
{t("pages.settings.form.url.option.showURL.disabled")}
</MenuItem>
</Select>
)}
/>
}
/>
</Stack>
{/* Sticky Save Button */}
+22
View File
@@ -544,6 +544,17 @@
"label": "Temperature alert threshold (°C)"
}
}
},
"url": {
"title": "Monitor IP/URL on Status Page",
"description": "Display the IP address or URL of monitor on the public Status page. If it's disabled, only the monitor name will be shown to protect sensitive information.",
"option": {
"showURL": {
"label": "Display IP/URL on status page",
"enabled": "Enabled",
"disabled": "Disabled"
}
}
}
}
},
@@ -948,6 +959,17 @@
"placeholder": "Enter your Google PageSpeed API key"
}
}
},
"url": {
"title": "Monitor IP/URL on Status Page",
"description": "Display the IP address or URL of monitor on the public Status page. If it's disabled, only the monitor name will be shown to protect sensitive information.",
"option": {
"showURL": {
"label": "Display IP/URL on status page",
"enabled": "Enabled",
"disabled": "Disabled"
}
}
}
}
},