Update based on meeting

- Query only uptime monitors without checks
- Change log validation from 640Kb  to 3Mb, fixed validation error text contrast issue
- Word/syntax updates, suburl is disabled and provided via env
This commit is contained in:
Shemy Gan committed 2025-01-10 11:06:36 -05:00
1 parent e8d9f310c1
commit a1d4ec4185
5 files changed
+26 -37

No files matched your search

+1 -4
View File
@@ -29,10 +29,7 @@ const ConfigBox = styled(Stack)(({ theme }) => ({
},
"& h1, & h2": {
color: theme.palette.text.secondary,
},
"& p": {
color: theme.palette.text.tertiary,
},
}
}));
export default ConfigBox;
@@ -30,8 +30,8 @@ const ContentPanel = () => {
const response = await networkService.getMonitorsByTeamId({
authToken: authToken,
teamId: user.teamId,
limit: 50,
types: ["http", "ping", "pagespeed", "hardware"],
limit: null, // donot return any checks for the monitors
types: ["http"], // status page is available only for the uptime type
});
if(response.data.data.monitors.length==0){
setErrors({monitors: "Please config monitors to setup status page"})
@@ -31,6 +31,7 @@ const GeneralSettingsPanel = () => {
const intervalRef = useRef(null);
const SUBDOAMIN_PREFIX =
import.meta.env.VITE_STATUS_PAGE_SUBDOMAIN_PREFIX ?? "http://localhost/";
const STATUS_PAGE = import.meta.env.VITE_STATU_PAGE_URL?? "status-page";
// Clears specific error from errors state
const clearError = (err) => {
@@ -91,19 +92,15 @@ const GeneralSettingsPanel = () => {
let error = validateField({ type: pic?.type, size: pic?.size }, logoImageValidation);
if (error) return;
const newLogo = {
src: URL.createObjectURL(pic),
name: pic.name,
type: pic.type,
size: pic.size,
}
setProgress((prev) => ({ ...prev, isLoading: true }));
setLogo({
src: URL.createObjectURL(pic),
name: pic.name,
type: pic.type,
size: pic.size,
});
setForm({...form, logo: {
src: URL.createObjectURL(pic),
name: pic.name,
type: pic.type,
size: pic.size,
}})
setLogo(newLogo);
setForm({ ...form, logo: newLogo });
intervalRef.current = setInterval(() => {
const buffer = 12;
setProgress((prev) => {
@@ -118,12 +115,7 @@ const GeneralSettingsPanel = () => {
return (
<TabPanel
value="General Settings"
sx={{
"& h1, & p, & input": {
color: theme.palette.text.tertiary,
},
}}
value="General settings"
>
<Stack
component="form"
@@ -176,14 +168,15 @@ const GeneralSettingsPanel = () => {
<TextInput
id="url"
type="url"
label="SubURL"
value={form.url}
startAdornment={
<HttpAdornment
prefix={SUBDOAMIN_PREFIX}
https={false}
/>
}
label="Your status page address"
disabled
value={SUBDOAMIN_PREFIX+ STATUS_PAGE}
// startAdornment={
// <HttpAdornment
// prefix={SUBDOAMIN_PREFIX}
// https={false}
// />
// }
onChange={handleChange}
onBlur={handleBlur}
helperText={errors["url"]}
@@ -217,7 +210,6 @@ const GeneralSettingsPanel = () => {
loading={progress.isLoading && progress.value !== 100}
onChange={handleLogo}
isRound={false}
maxSize="640KB"
/>
{progress.isLoading || progress.value !== 0 || errors["logo"] ? (
<ProgressUpload
@@ -29,7 +29,7 @@ import { networkService } from "../../../main";
["companyName", "url", "timezone", "color", "publish", "logo"],
["monitors", "showUptimePercentage", "showBarcode"],
];
const tabList = ["General Settings", "Contents"];
const tabList = ["General settings", "Contents"];
const hasInitForm = initForm && Object.keys(initForm).length > 0;
const [form, setForm] = useState(
hasInitForm
@@ -143,7 +143,7 @@ import { networkService } from "../../../main";
/>
))}
</TabList>
</Box>
</Box>
<StatusFormProvider
form={form}
setForm={setForm}
+2 -2
View File
@@ -181,10 +181,10 @@ const logoImageValidation = joi.object({
}),
size: joi
.number()
.max(800*800)
.max(3000000)
.messages({
"number.base": "File size must be a number.",
"number.max": "File size must be less than 640KB.",
"number.max": "File size must be less than 3MB.",
"number.empty": "File size required.",
}),
});