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