url settigns
This commit is contained in:
1 parent
a59f7fd830
commit
d4e72ee8a6
2 files changed
+56
-2
No files matched your search
@@ -13,8 +13,8 @@ import { useIsAdmin } from "@/Hooks/useIsAdmin.js";
|
|||||||
import type { SettingsFormData } from "@/Validation/settings";
|
import type { SettingsFormData } from "@/Validation/settings";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Controller } from "react-hook-form";
|
import { Controller } from "react-hook-form";
|
||||||
import { TextField, FieldLabel, Button } from "@/Components/v2/inputs";
|
import { TextField, Button, FieldLabel } from "@/Components/v2/inputs";
|
||||||
import { Typography, Box } from "@mui/material";
|
import { Box } from "@mui/material";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
setTimezone,
|
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>
|
</Stack>
|
||||||
|
|
||||||
{/* Sticky Save Button */}
|
{/* Sticky Save Button */}
|
||||||
|
|||||||
@@ -544,6 +544,17 @@
|
|||||||
"label": "Temperature alert threshold (°C)"
|
"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"
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user