- Replace Doc icon with Reorder icon
- Replace Text input with Search component - Extend Search component to accept start and end adorment
This commit is contained in:
1 parent
d844078ed7
commit
23d97f8e56
8 files changed
+122
-53
No files matched your search
@@ -181,7 +181,7 @@ const CreateMaintenance = () => {
|
||||
setSearch(value);
|
||||
};
|
||||
|
||||
const handleSelectMonitors = (monitors) => {
|
||||
const handleSelectMonitors = (_, monitors) => {
|
||||
setForm({ ...form, monitors });
|
||||
const { error } = maintenanceWindowValidation.validate(
|
||||
{ monitors },
|
||||
|
||||
@@ -22,7 +22,7 @@ import { networkService } from "../../../main";
|
||||
const CreateStatus = ({ initForm }) => {
|
||||
const theme = useTheme();
|
||||
const mode = useSelector((state) => state.ui.mode);
|
||||
const {authToken} = useSelector((state) => state.auth);
|
||||
const { authToken } = useSelector((state) => state.auth);
|
||||
const {apiBaseUrl} = useSelector((state) => state.settings);
|
||||
const [tabIdx, setTabIdx] = useState(0);
|
||||
const [errors, setErrors] = useState({});
|
||||
@@ -46,7 +46,6 @@ import { networkService } from "../../../main";
|
||||
// showBarcode: false,
|
||||
}
|
||||
);
|
||||
|
||||
const setActiveTabOnErrors = () => {
|
||||
let newIdx = -1;
|
||||
Object.keys(errors).map((id) => {
|
||||
@@ -72,7 +71,6 @@ import { networkService } from "../../../main";
|
||||
delete form.logo;
|
||||
//let localData = {...form, monitors: form.monitors.map(m=>m.url)}
|
||||
let localData = {...form, monitors: form.monitors, theme: mode}
|
||||
|
||||
if (hasValidationErrors(localData, publicPageGeneralSettingsValidation, setErrors)) {
|
||||
setActiveTabOnErrors();
|
||||
return;
|
||||
@@ -85,7 +83,8 @@ import { networkService } from "../../../main";
|
||||
// if (error) return;
|
||||
|
||||
//form.logo = { ...logo, size: formatBytes(logo?.size) };
|
||||
let config = { authToken: authToken, url: apiBaseUrl, data: localData };
|
||||
localData = {...form, monitors: form.monitors.map(m=>m.url),theme: mode}
|
||||
let config = { authToken: authToken, url: "status-page", data: localData };
|
||||
try{
|
||||
const res = await networkService.createStatusPage(config)
|
||||
if (!res.status === 200) {
|
||||
|
||||
@@ -6,6 +6,8 @@ import CreateStatus from "./CreateStatus";
|
||||
import { useEffect, useState } from "react";
|
||||
import { networkService } from "../../main";
|
||||
import { useSelector } from "react-redux";
|
||||
import { createToast } from "../../Utils/toastUtils"
|
||||
import { logger } from "../../Utils/Logger";
|
||||
|
||||
const Status = () => {
|
||||
const theme = useTheme();
|
||||
@@ -13,13 +15,18 @@ const Status = () => {
|
||||
const {authToken} = useSelector((state) => state.auth);
|
||||
const {apiBaseUrl} = useSelector((state) => state.settings);
|
||||
const [initForm, setInitForm] = useState({});
|
||||
|
||||
useEffect(() => {
|
||||
const getStatusPage = async () => {
|
||||
let config = { authToken: authToken, url: apiBaseUrl };
|
||||
let res = await networkService.getStatusPageByUrl(config);
|
||||
if(res && res.data)
|
||||
setInitForm( res.data.data)
|
||||
let config = { authToken: authToken, url: "status-page" };
|
||||
try {
|
||||
let res = await networkService.getStatusPageByUrl(config);
|
||||
if(res && res.data)
|
||||
setInitForm( res.data.data)
|
||||
}catch (error) {
|
||||
createToast({ body: "Failed to fetch status page data" });
|
||||
logger.error("Failed to fetch status page", error);
|
||||
}
|
||||
|
||||
};
|
||||
getStatusPage();
|
||||
}, []);
|
||||
|
||||
Reference in new issue
Block a user